5 msgNo warning on unused variable
7 msgAccessing the vector elements
2 msgRegarding stack pointer
4 msgAltivec and GCC
4 msgProblem building gcc 4.1.1 (fortran) in MinGW
1 msgStrange cast problem
3 msggcc and binutils interdependency
2 msgdouble to int64 loses 1 problem
1 msggcc binaries for windows available at winports.org
1 msgABI problem: building libgcc_s for n64 MIPS glibc.
1 msgcompilation failure on sco
9 msg-x option for gcc
1 msggcc 4.1.1 include order
6 msgHandling pre-increment and post-increment in GCC
1 msgGNAT: Problems with Coverage metrics/instrument...

coding rules for template classes
\ Rolf Schumacher (18 Oct 2006)
. \ John \(Eljay\) Love-Jensen (18 Oct 2006)

1 msgm32 option and libgcc.a
1 msgHow to find code in the gcc source tree
4 msggcc_assert()!
2 msgGimple to RTL conversion!
Subject:RE: coding rules for template classes
Group:Gcc-help
From:John \(Eljay\) Love-Jensen
Date:18 Oct 2006


Hi Rolf,

Your questions are off topic for this forum.

> Does someone know of good coding rules for template classes, other than "put all in the .h file"?

Look here...
http://www.parashift.com/c++-faq-lite/templates.html

> If a template declaration is separated from the definition as to deliver declaration only to the user how will the definition get compiled to code?

It won't. The declaration+definition of a template is different from the instantiation of a template.

It would be like saying "I want to have 'inline int DoSomething(int, int);' declaration in the header for delivery to the user, but the definition elsewhere where the user can't see it. How will the definition get compiled (instantiated) to the user's code?"

> Do I need a third "instantiation" file? Is there some literature about this around?

There is something like this, but it doesn't do what you want. And it isn't supported very well by C++ compiler vendors in general, so tends to be used infrequently.

For GCC, look here...
http://gcc.gnu.org/onlinedocs/gcc/Template-Instantiation.html

HTH,
--Eljay


© 2004-2008 readlist.com