This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
inner class in template class
- To: gcc at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org
- Subject: inner class in template class
- From: Levente Farkas <!spam-lfarkas at mindmaker dot hu>
- Date: Tue, 03 Aug 1999 11:46:43 +0200
- Organization: Mindmaker Ltd.
- Reply-To: lfarkas at mindmaker dot hu
hi,
is it a correct code or just the compilers can understand me ?:
(the intresting part are in comment:-))
---------
#include <iostream>
using namespace std;
template <class T>
class A
{
public:
class B
{
public:
T i;
};
T j;
};
/*
template<class T, class Ty = char, class Trail = char_traits<Ty> >
inline basic_ostream<Ty, Trail> & __cdecl
operator<<(basic_ostream<Ty, Trail> & stream, const A<T>::B & b)
{
return stream << b.i;
}
template<class T>
ostream& operator<<(ostream& stream, const A<T>::B & b)
{
return stream << b.i;
}
*/
ostream& operator<<(ostream& stream, const A<int>::B & b)
{
return stream << b.i;
}
void main()
{
A<int>::B b;
cout << b;
}
---------
-- Levente