I have a SmartPtr template class with which I need to override operator<< to extract the implementation class to an output stream. The implementation class already has friend functions to output to ostream and ofstream so I just need some way to dereference the interface. It seems to me that something like...
friend ostream& operator<<(ostream&, SmartPtr<I, A>&);
ostream& operator<<(ostream& out, SmartPtr<I, A>& cSmartPtr)
{
return (operator<<(out, *(cSmartPtr.m_lpI)));
}
should do the trick, but I think i'm referencing the template class incorrectly. Does anyone have any helpful hints????
Please reply.
Crowe
friend ostream& operator<<(ostream&, SmartPtr<I, A>&);
ostream& operator<<(ostream& out, SmartPtr<I, A>& cSmartPtr)
{
return (operator<<(out, *(cSmartPtr.m_lpI)));
}
should do the trick, but I think i'm referencing the template class incorrectly. Does anyone have any helpful hints????
Please reply.
Crowe