This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Template friends


I figure my parser is wrong and g++ is correct, but I have no idea as to
why.

g++ --version == 3.4.1

Code fragment:

template<class T> class A;
template<class T> int foobar(const A<T> &x);

template<class T> class A
{
  ...
  friend int foobar<>(const A<T> &);
  ...
}

gives me this:
error: `dim' is neither function nor member function; cannot be declared
friend

So, I opened my copy of ISO 14882;2003 and read 14.5.3 and cannot find
what is wrong with my syntax. In fact, it looks similar to h<>() in the
14.5.3.2 example. So, what is wrong with the above syntax?

-- 
Al Niessner
818.354.0859

All opinions stated above are mine and do not necessarily reflect those
of JPL or NASA.

--------
|  dS  | >= 0
--------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]