Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > non-type template args and friend declarations

Reply
Thread Tools

non-type template args and friend declarations

 
 
Wolfgang Meyer
Guest
Posts: n/a
 
      04-23-2004
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?
 
Reply With Quote
 
 
 
 
Rob Williscroft
Guest
Posts: n/a
 
      04-23-2004
Wolfgang Meyer wrote in
news:(E-Mail Removed) om 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.
--
http://www.victim-prime.dsl.pipex.com/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
C++0x -- fun(Args&...) and fun(Args const&...) er C++ 2 12-20-2010 07:52 PM
Declaring a template class with two template params a friend in anon-template class A L C++ 1 08-25-2010 07:25 AM
Is there a class or method to construct url args or extract url args? Ken Varn ASP .Net 2 06-22-2005 12:26 PM
args v. *args passed to: os.path.join() Pierre Fortin Python 2 09-18-2004 06:59 PM
When passing functions as args,how to pass extra args for passed function? python@sarcastic-horse.com Python 3 09-17-2003 12:25 AM



Advertisments