BVK Chaitanya
April 23rd, 2002, 01:24 AM
hello,
i have two template functions declared like below.
//////////////////
template <class A, class B>
void f1 (void);
template <class A, class B>
void f2 (void);
/////////////////////
and i have a class template as below
//////////////////////////
template <class T>
class test {
//.....
public:
// two friend declarations required here for f1 & f2;
};
/////////////////////////
i want the friend declarations in such a way that f1<XXX,YYY> can access private members of test<YYY> only, it can't have access to test<XXX> class;
similarly t2<AAAA,BBBB> should have acces to test<AAAA> only.
You got my question? how should i achieve this? how should be the friend declarations for f1, f2 functions in class test?
Please I really want this. Please give me a detailed explanation.
Thank you very much.
-Chaitu
i have two template functions declared like below.
//////////////////
template <class A, class B>
void f1 (void);
template <class A, class B>
void f2 (void);
/////////////////////
and i have a class template as below
//////////////////////////
template <class T>
class test {
//.....
public:
// two friend declarations required here for f1 & f2;
};
/////////////////////////
i want the friend declarations in such a way that f1<XXX,YYY> can access private members of test<YYY> only, it can't have access to test<XXX> class;
similarly t2<AAAA,BBBB> should have acces to test<AAAA> only.
You got my question? how should i achieve this? how should be the friend declarations for f1, f2 functions in class test?
Please I really want this. Please give me a detailed explanation.
Thank you very much.
-Chaitu