Topic: [C++] Do the compiler/linker support member templates?
Author: Hubert Holin <hubert.holin@meteo.fr>
Date: 1999/03/09 Raw View
Somewhere in the E.U., le 19 Vent=F4se 207
Howard Hinnant wrote:
[SNIP]
> Pro4 supports member template functions, but the definition must appear
> within the class declaration. To prevent runaway inlining, the member
> template will only be inlined if the inline keyword appears.
[SNIP]
I agree that inlining is never mandatory for the compiler. However, it
is my understanding that if a (non-template) member definition appears
within the class declaration, then it is considered inline *BY DEFAULT*.
Is that not the case for member templates, or is this convention in
breach of the standard?
Hubert Holin
Hubert.Holin@Bigfoot.com
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: hinnant@_anti-spam_lightlink.com (Howard Hinnant)
Date: 1999/03/09 Raw View
In article <36E51952.88A93179@meteo.fr>, Hubert.Holin@meteo.fr,
Hubert.Holin@bigfoot.com wrote:
> > Pro4 supports member template functions, but the definition must appear
> > within the class declaration. To prevent runaway inlining, the member
> > template will only be inlined if the inline keyword appears.
>
> [SNIP]
>
> I agree that inlining is never mandatory for the compiler. However, it
> is my understanding that if a (non-template) member definition appears
> within the class declaration, then it is considered inline *BY DEFAULT*.
> Is that not the case for member templates, or is this convention in
> breach of the standard?
This was a Pro4 hack to get member templates to the customer faster. The
compiler only supported "inlined" member templates. In order to not cause
runaway code bloat, Metrowerks added the non-standard rule about the
inline keyword temporarily and for member templates only.
Pro5 will lift this restriction, and the member template implementation
will be standard.
-Howard
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: Martin von Loewis <loewis@informatik.hu-berlin.de>
Date: 1999/03/09 Raw View
Hubert Holin <hubert.holin@meteo.fr> writes:
> I agree that inlining is never mandatory for the compiler. However, it
> is my understanding that if a (non-template) member definition appears
> within the class declaration, then it is considered inline *BY DEFAULT*.
> Is that not the case for member templates, or is this convention in
> breach of the standard?
Yes, it certainly is inline by default. However, the compiler is not
required to inline inline functions, so it looks to me that this
approach (only inlining when explicit inline keyword is provided) is
indeed compliant with the standard.
Regards,
Martin
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]