This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: template parameters cannot be friends
- From: Eljay Love-Jensen <eljay at adobe dot com>
- To: naje <najeiv at ukr dot net>, gcc-help at gcc dot gnu dot org
- Date: Fri, 21 May 2004 10:45:19 -0500
- Subject: Re: template parameters cannot be friends
- References: <E1BRBtC-000ANQ-00@storage.ukr.net>
Hi Naje,
>i do not need put method draw in Window's children.
- - - - - - - - - - - - - - - - - - - - -
#include <iostream>
using namespace std;
class Window
{
public:
void Draw() const
{
cout << "Window::Draw" << endl;
}
};
class BoxWindow : private Window
{
public:
using Window::Draw;
};
template <typename T>
void Draw(T const& object)
{
object.Draw();
}
int main()
{
BoxWindow box;
Draw(box);
}
- - - - - - - - - - - - - - - - - - - - -
HTH,
--Eljay