Posted By: Rat (prilis mnoho her) on 'CZprogram' Title: Re: gccy Date: Wed Aug 3 09:14:12 2005 > Mne to zas zahlasi: > g++ -c a.cxx > a.cxx:8: error: `C<int>::x' must be initialized by constructor, not by > `{...}' Hm, a kdyz zmenis class na struct, tak taky? Vzhledem k tomu, ze to nema zadne virtualni funkce, konstruktory ci destruktory, tak by to jit melo, ackoli u me ta zminovana 3.3* byla 3.3.2 nebo 3.3.3 (taky debian). Krysa > Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.5/specs > Configured with: ../src/configure -v > --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr > --mandir=/usr/share/man --infodir=/usr/share/info > --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared > --with-system-zlib --enable-nls --without-included-gettext > --enable-__cxa_atexit --enable-clocale=gnu --enable-debug > --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux > Thread model: posix > gcc version 3.3.5 (Debian 1:3.3.5-6) > > Co znamena ten zapis > C<int> C<int>::x = { 0 }; > ? > > > > 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/ > -- > AUTHOR > Written by FIXME unknown. rat@atrey.karlin.mff.cuni.cz Jsem Krysa http://atrey.karlin.mff.cuni.cz/~rat/