Posted By: Rat (prilis mnoho her) on 'CZprogram'
Title:     Re: gccy
Date:      Wed Aug  3 15:27:40 2005

 Zdar,
mno na uvod - ona je to defakto obycejna struktura obsahujici par dat, akorat 
je tech struktur vic v zavislosti na tride, ktera ji pouziva. Navic ty data 
by mely byt inicializovane uz pri loadu knihovny, coz bohuzel konstruktor 
neumoznuje. To jen tak pro uplnost, ze nejsem zas tak hrozne prase ;) 

 Co se tyce toho template <>, tak to jsem netusil, ze to jest treba a popravde 
me to celkem aji prekvapuje. Ale s tim uz to jede, takze dik. struct uz tam 
byl predtim, akorat omyl pri zjednodusovani examplu.

         Krysa 

> No nazdar,
>  ta konstrukce ze tride priradis nejakou hodnotu bez volani konstruktoru je 
> mi krajne podezrela. Tohle by ti proste projit nemelo. Ale udelej z toho
> struct
> a prepis na
> 
> template <class T>
> struct C
> {
>  T a;
>  static C<T> x;
> };
> 
> template <> C<int> C<int>::X = {0};
> 
> a melo by to projit. 
> Nemuzu to zkusit, mam tu verzi gcc 3.2, ale mozna je zakomapny pes prave v
> tom,
> ze v novejsi verzi gcc potrebujes uvest ten typ. Nebo ze kasles na to, ze
> bys 
> mel pouzit template<> a spolehas na gcc, ze si to vymysli za tebe.
> Doufam, ze aspon ejdno zabere :-) 
> 
> > i Zdar,
> > narazil jsem na problem, zjednodusene:
> > 
> > template <typename T>
> > class C
> > {
> >         T a;
> >         static C x;
> > };
> > 
> > C<int> C<int>::x = { 0 };
> > 
> > Kompilace:
> > 
> > g++ -c a.cxx
> > a.cxx:8: error: too few template-parameter-lists
> > a.cxx:8: error: expected `,' or `;' before '=' token
> > 
> > Verze:
> > g++ -v
> > Reading specs from /usr/lib/gcc/i386-redhat-linux/3.4.3/specs
> > Configured with: ../configure --prefix=/usr --mandir=/usr/share/man 
> > --infodir=/usr/share/info --enable-shared --enable-threads=posix 
> > --disable-checking --with-system-zlib --enable-__cxa_atexit 
> > --disable-libunwind-exceptions --enable-java-awt=gtk
> > --host=i386-redhat-linux
> > Thread model: posix
> > gcc version 3.4.3 20050227 (Red Hat 3.4.3-22.1)
> > 
> > 
> > V 3.3* to fungovalo bez problemu.
> > 
> >         Krysa 
> >                 rat@atrey.karlin.mff.cuni.cz              Jsem Krysa
> >                 http://atrey.karlin.mff.cuni.cz/~rat/
> -
> Clovek je nejpomalejsi zname zarizeni typu I/O.
>                                                                  Quasimodo
                rat@atrey.karlin.mff.cuni.cz              Jsem Krysa
                http://atrey.karlin.mff.cuni.cz/~rat/

Search the boards