Posted By: Quasimodo (Quasimodo) on 'CZprogram' Title: Re: gcc Date: Wed Aug 3 12:41:28 2005 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