Re: Problems with binary member and friend operator in template class

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/30/06, John Love-Jensen  wrote:
>
> Try this:
> template <typename T2> friend P<T2> operator+(T2, const P<T2>&); // line 15

1) Can a template be a friend ? I always thought that only concrete
instantiations
of template can be declared as friend.

2) By the way, "friend" in c++.
I think (I currently have no access to compiler), that in gcc-4.0.2 :
class B{};
class A{
  typedef B BB;
  friend BB;
};
won't be accepted, although gcc-3.36 did accept this.
If true, why ?

Thank you.
Dima.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux