Re: Is there a work-around

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: David Lowndes (davidl_at_example.invalid)
Date: 05/19/04


Date: Wed, 19 May 2004 10:12:32 +0100


>I'm trying to make a friend function out of a template parameter. This
>seems to work on gcc 3.4.0 and comeau 4.3.3, but not in MSC++.

I don't know what the solution is, but as this compiles of with the
online Comeau compiler, I'm inclined to agree that this is a bug. As
it also fails with the Whidbey compiler I'll try to pass it on to MS.

Dave

-- 
MVP VC++ FAQ: http://www.mvps.org/vcfaq


Relevant Pages

  • Template class partial specialisation problem
    ... Template parameter is "int" ... Template parameter is "long" ... My compiler throws this out with: ... test.cpp:10: error: parse error before `)' token ...
    (comp.lang.cpp)
  • Re: Template function question
    ... with this code (why the compiler accepts the call to DoSomething2 but ... template parameter 'T' is ambiguous ... // or 'const int &' ... the compiler deduces T to be 'const int&', ...
    (microsoft.public.vc.language)
  • Re: friend function of template
    ... >> template parameter". ... >> This can be compiled under the online compiler Comeau. ... > template <int L, int M, int T> ...
    (microsoft.public.vc.language)
  • Re: Pass a contained class to template?
    ... > Is it possible to pass a contained class as a template parameter? ... As I say, no idea if it works, but if I were writing a compiler to ... > template <class T, class Cont> ...
    (microsoft.public.vc.language)
  • Forcing a template parameter to be derived from another
    ... Is there a way in C++ to force that a template parameter be derived from ... otherwise the compiler should give error. ... Is there a way to enforce this constraint? ...
    (comp.lang.cpp)