O
Olumide
Hi,
I've got a class 'Runner' that declares a template class 'Corner' as
friend as follows:
template <typename T> class Corner
{
friend class T;
public:
Corner<T>( T& object );
private:
T& m_object;
};
template <typename T> Corner<T>::Corner( T& object ) : m_object
( object )
{
}
////////////////////////////////////////////////
class Runner
{
public:
template <typename Runner> friend class Corner;
void compute()
{
//Corner<Runner >( *this ); // causes linker error
}
};
The code compiles, but fails at the linking stage with the message:
unresolved external symbol "public: __thiscall Corner<class
Runner>::Corner<class Runner>(class Runner &)".
I'm working with Visual Studio .NET 2003.
Thanks,
- Olumide
(I'm using VS .NET 2003), but links
I've got a class 'Runner' that declares a template class 'Corner' as
friend as follows:
template <typename T> class Corner
{
friend class T;
public:
Corner<T>( T& object );
private:
T& m_object;
};
template <typename T> Corner<T>::Corner( T& object ) : m_object
( object )
{
}
////////////////////////////////////////////////
class Runner
{
public:
template <typename Runner> friend class Corner;
void compute()
{
//Corner<Runner >( *this ); // causes linker error
}
};
The code compiles, but fails at the linking stage with the message:
unresolved external symbol "public: __thiscall Corner<class
Runner>::Corner<class Runner>(class Runner &)".
I'm working with Visual Studio .NET 2003.
Thanks,
- Olumide
(I'm using VS .NET 2003), but links