Mail Archives: cygwin/1998/11/30/11:23:22
Hi there !
I'm used g++ extensively under UNIX (AIX,IRIX,OSF,..) using GNU'
recommended approach to template instantiation (#pragma interface,
#pragma implementation and explicit instantiation). I'm more and more
beginning to like this method, because it's the only that prevents me
from recopiling tons of source code as in all 'automatic' instantiation
approaches (i.e.: MipsPro compiler 7.x under IRIX(SGI)).
There's one major difference in the syntax of explicit instantiation
betweeen gcc-2.8.1 and egcs-1.1:
Under gcc-2.8.1 it suffices to write
template operator<<(ostream &,const smanip<int> &);
whereas under egcs-1.1 (CygWin 20B) you must specify the return type
too, otherwise you get the error message 'no matching template for
explicit instantiation...':
template ostream & operator<<(ostream &,const smanip<int> &);
I the view of my eyes specifying the return type is obsolete, since a
function is uniquely defined by its name and argument types. The second
convetion runs under both, gcc and egcs, but I liked to use the short
form without return type, because it allows for 'semi-automatic'
instantiations derived from 'missing symbol' errors from the linker,
which contain only the functions name and argument types (possibly in
C++-mangled style (refer to binutils c++-filt tool)).
So could sombody tell me, which syntax is the syntax from the
correspondad ANSI working paper and how egcs and/or gcc will behave in
future versions ?
Thanks in advance,
Wolfgang
--
Mag. Wolfgang Glas
Institut fuer hydraulische Stroemungsmaschinen
Kopernikusgasse 24 Phone:++43/316/873/7578
A-8010 Graz Fax: ++43/316/873/7577
mailto:Wolfgang DOT Glas AT hfm DOT tu-graz DOT ac DOT at
http://fhysmsg01.tu-graz.ac.at/Wolfgang.Glas/
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -