[LC++]Inlining with templated member functions

Vincent Penquerc'h Vincent.Penquerch at artworks.co.uk
Mon Jul 1 19:05:06 UTC 2002


> struct MyStruct {
> ...
>    template<typename A> void put(A const& a);
> ...
> };
> 
> and later did
> 
> template<typename A>
> inline void put(A const& a) {
> ... // do something
> }

Shouldn't it be:

template<typename A>
inline void Mystruct::put<A>(A const& a) {}
?
The compiler will see your body as another template function,
not a method of Mystruct.

-- 
Vincent Penquerc'h 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.linux.org.au/pipermail/tuxcpprogramming/attachments/20020701/4a4172e6/attachment.htm 


More information about the tuxCPProgramming mailing list