non-type template args and friend declarations

W

Wolfgang Meyer

template<bool constness>
class X
{
public:
friend class X<!constness>;
...
};


Is this legal C++?
g++ doesn't warn with -ansi -predantic. So I suppose it is?
 
R

Rob Williscroft

Wolfgang Meyer wrote in
in comp.lang.c++:
template<bool constness>
class X
{
public:
friend class X<!constness>;
...
};


Is this legal C++?
g++ doesn't warn with -ansi -predantic. So I suppose it is?

The mandatory: "No ... is a syntax error" aside, Yes.

Rob.
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top