From 4950279240272312235 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,7d7ff221635a5a63 X-Google-Attributes: gid109fba,public X-Google-Thread: f78e5,7d7ff221635a5a63 X-Google-Attributes: gidf78e5,public X-Google-ArrivalTime: 2002-10-15 12:37:38 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!212.74.64.35!colt.net!kibo.news.demon.net!mutlu.news.demon.net!demon!mail2news.demon.co.uk!devnull From: celtschk@web.de (Christopher Eltschka) Newsgroups: comp.lang.c++,comp.std.c++ Subject: Re: Nested comments Date: Tue, 15 Oct 2002 19:37:37 +0000 (UTC) Organization: Vienna University of Technology, Austria Lines: 47 Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++) Message-ID: References: <23b84d65.0208261548.4c36a1ad@posting.google.com> <23b84d65.0208271058.1bc25133@posting.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: mail2news.demon.co.uk 1034710657 5687 10.0.0.1 (15 Oct 2002 19:37:37 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Tue, 15 Oct 2002 19:37:37 +0000 (UTC) X-Received: from mulga.cs.mu.oz.au ([128.250.1.22]) by news.demon.co.uk with esmtp (Exim 4.05) id 181XVX-0001Ta-00 for mail2news@news.news.demon.net; Tue, 15 Oct 2002 19:37:35 +0000 X-Received: from localhost (localhost [[UNIX: localhost]]) by mulga.cs.mu.OZ.AU id FAA16498; Wed, 16 Oct 2002 05:37:30 +1000 (EST) X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f X-Path: comp-std-cpp-robomod!not-for-mail X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov) X-Delivered-To: std-c++@ncar.ucar.edu X-Newsgroups: comp.lang.c++,comp.std.c++ X-Newsreader: Gnus v5.5/XEmacs 20.4 - "Emerald" X-Headers-Are-Fun: Yes X-Virus-Scanned: by amavisd-milter (http://amavis.org/) X-MailScanner: PASSED (v1.2.6 82236 g9FItBMp001067 mailbox4.ucsd.edu) X-Spam-Status: No, hits=-8.0 required=5.0 tests=EMAIL_ATTRIBUTION,INVALID_MSGID,NOSPAM_INC, QUOTED_EMAIL_TEXT,REFERENCES,SPAM_PHRASE_00_01 version=2.41 Xref: archiver1.google.com comp.lang.c++:177312 comp.std.c++:14835 Gennaro Prota writes: > On 27 Aug 2002 21:10:04 GMT, Allan_W@my-dejanews.com (Allan W) wrote: > > >Gennaro Prota wrote > >> Compile-time detection :-) > >> > >> struct has_nested_comments { > >> static const bool value = /* /* */ > >> 1? false : // */ > >> true; > >> }; > >> > >> Of course it relies, like your solution, on that > >> > >> // */ > >> > >> at the end of a line, whose behavior for compilers that allow nested > >> comments depends on what the implementer decided to do. > > > > struct has_nested_comments { > > static const bool value = /* /* */ false /*/ true /* */; > > }; > > > > > Yes, it would be a real pearl for a feature-detection suite (uh?) :-) > But there's an error because (unless the implementer opted for some > very odd rule) when comments nest the /* just after the literal > "false" starts another comment. struct has_nested_comments { static const bool value = !(/*/*/0*/**/1); }; > > I hope others will not think we're taking it seriously! :-) Why? I'm *seriouly* having fun with it :-) --- [ comp.std.c++ is moderated. To submit articles, try just posting with ] [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]