Thread overview | |||||
---|---|---|---|---|---|
|
January 10, 2004 Error not caught (friend class T;) | ||||
---|---|---|---|---|
| ||||
template< typename Y > class x { friend class Y; }; Is an error, but compiles in DM. Comeau on-line compiler says: "ComeauTest.c", line 4: error: template parameter "Y" may not be used in an elaborated type specifier friend class Y; ^ Cheers! |
January 11, 2004 Re: Error not caught (friend class T;) | ||||
---|---|---|---|---|
| ||||
Posted in reply to dan | > template< typename Y > > class x > { > friend class Y; > }; > > Is an error, but compiles in DM. Comeau on-line compiler says: > > "ComeauTest.c", line 4: error: template parameter "Y" may not be used in an > elaborated type specifier > friend class Y; > ^ > Cheers! This is about the least valid error in the business. Check out http://www.cuj.com/documents/s=8942/cujweb0312wilson/, and also note that Comeau have recently added a --friendT option to v4.3.3 to specifically legalise it when compiling in --strict mode. This behaviour is one of the one's most likely to be legalised in the next version of the standard, and is profoundly useful, so it'd be crazy for any vendor to attempt to change their support for it. Cheers -- Matthew Wilson STLSoft moderator (http://www.stlsoft.org) Contributing editor, C/C++ Users Journal (www.synesis.com.au/articles.html#columns) "If I'm curt with you it's because time is a factor. I think fast, I talk fast, and I need you guys to act fast" -- Mr Wolf ---------------------------------------------------------------------------- --- |
January 11, 2004 Re: Error not caught (friend class T;) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthew | "Matthew" <matthew.hat@stlsoft.dot.org> wrote in message: > > template< typename Y > > > class x > > { > > friend class Y; > > }; > > > > Is an error, but compiles in DM. Comeau on-line compiler says: > > > > "ComeauTest.c", line 4: error: template parameter "Y" may not be used in > an > > elaborated type specifier > > friend class Y; > > ^ > > Cheers! > > This is about the least valid error in the business. Check out http://www.cuj.com/documents/s=8942/cujweb0312wilson/, and also note that > Comeau have recently added a --friendT option to v4.3.3 to specifically > legalise it when compiling in --strict mode. This behaviour is one of the > one's most likely to > be legalised in the next version of the standard, and is profoundly useful, > so it'd be crazy for any vendor to attempt to change their support for it. > > Cheers > You probably noticed a recent post by Andrei Alexandrescu on comp.lang.c++.moderated refering to your article. (See http://www.talkaboutprogramming.com/group/comp.lang.c++.moderated/messages/153854.html.) He asked "are friend template arguments a de facto feature ready to make it into the standard?" I was hoping some standards committee members would respond, but none did. What is your evidence that this will likely be legalized? I certainly hope you are right. Jonathan |
Copyright © 1999-2021 by the D Language Foundation