Class templates and friend function templates
- From: "BigMan" <fn42551@xxxxxxxxxxxxxxxx>
- Date: Sat, 23 Jul 2005 22:39:00 +0300
I have a class template like this:
template< typename t > class c;
I'd also like to have an operator == for objects of types, which are different specializations of c:
template< typename t1, typename t2 >
bool operator ==
(
s< t1 > const&
, s< t2 > const&
);In order to implement this operator, I need it to be a friend of both s< t1 > and s< t2 >. For the sake of safety, I'd like no other specialization of c to have this operator as its friend. Is this possible and, if so, how?
.
- Follow-Ups:
- Re: Class templates and friend function templates
- From: John Carson
- Re: Class templates and friend function templates
- From: Carl Daniel [VC++ MVP]
- Re: Class templates and friend function templates
- Prev by Date: Re: How to set a backgroundcolor for a windows control (Trackbar) ?
- Next by Date: cast array to structure
- Previous by thread: how can i modify the ip address ,mask,default gateway in VC?
- Next by thread: Re: Class templates and friend function templates
- Index(es):
Loading