c++ - Error not caught (friend class T;)
- dan (11/11) Jan 10 2004 template< typename Y >
- Matthew (18/29) Jan 10 2004 This is about the least valid error in the business. Check out
- Jonathan Turkanis (16/38) Jan 11 2004 that
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!
Jan 10 2004
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 inanelaborated 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 ---------------------------------------------------------------------------- ---
Jan 10 2004
"Matthew" <matthew.hat stlsoft.dot.org> wrote in message:used intemplate< 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 beanthatelaborated 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 noteComeau have recently added a --friendT option to v4.3.3 tospecificallylegalise it when compiling in --strict mode. This behaviour is oneof theone's most likely to be legalised in the next version of the standard, and is profoundlyuseful,so it'd be crazy for any vendor to attempt to change their supportfor it.CheersYou 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
Jan 11 2004