Hello,
I reveive the following error with my code. If I switch to line (see the
**** in the code), it is OK.Is this a bug or did I am missing something
important.
Thanks
Serge
*******************************************
c:\tmp\lnk2019\lnk2019\lnk2019Dlg.cpp(25): error C2143: syntax error :
missing ';' before '<'
c:\tmp\lnk2019\lnk2019\lnk2019Dlg.cpp(25): error C2433: 'operator`=='' :
'friend' not permitted on data declarations
c:\tmp\lnk2019\lnk2019\lnk2019Dlg.cpp(25): error C2365: 'operator`=='' :
redefinition; previous definition was a 'member function'
c:\tmp\lnk2019\lnk2019\lnk2019Dlg.cpp(25): error C2238: unexpected token(s)
preceding ';'
*****************************************
template<class T,int InterfaceId>
class CLibSmartPointer ;
template<class T,int InterfaceId>
void f(T) ;
template<class T,int InterfaceId>
bool operator == (void*p, CLibSmartPointer<T,InterfaceId> &r) ;
template<class T,int InterfaceId>
class CLibSmartPointer
{
bool operator == (CLibSmartPointer<T,InterfaceId> &r) ; //
******************* switch with the next line
friend bool operator == <T,InterfaceId> (void* p,
CLibSmartPointer<T,InterfaceId> &r) ;
friend void f<T,InterfaceId>(T);
};
template<class T>
void f(T){}
template<class T, int InterfaceId>
inline bool operator == (void*p, CLibSmartPointer<T,InterfaceId> &r) {
return true ;
}