using friend and template class

D

dslater

The problem here is that template_class is not a class - it is a
template for creating classes. You can do something like:

friend template_class<foo>;

to make the template_class<foo> class a friend, but
template_class<bar> will not be a friend. To do what you're looking
for would require an extention to the C++ language so that you could
write something like:

template <typename T> friend template_class<T>;

Unfortunatly, this construct simply doesn't exist. I would not be at
all suprised if the designers have a very good reason for this,
although I haven't taken the time to look into it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,143
Messages
2,570,822
Members
47,368
Latest member
michaelsmithh

Latest Threads

Top