From 7577402008744593634 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f78e5,7458762a2c3b301d X-Google-Attributes: gidf78e5,public X-Google-ArrivalTime: 2001-08-23 02:23:00 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!212.74.64.35!colt.net!newspeer.clara.net!news.clara.net!dispose.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail From: comeau@panix.com (Greg Comeau) Newsgroups: comp.std.c++ Subject: Re: Are literals const? Date: Thu, 23 Aug 2001 09:22:38 GMT Organization: Comeau Computing; http://www.comeaucomputing.com Approved: Fergus Henderson , moderator of comp.std.c++ Message-ID: <9m1r5d$bsp$1@panix3.panix.com> References: <7dc3b1ea.0108220617.421ee131@posting.google.com> Reply-To: comeau@comeaucomputing.com X-Trace: mail2news.demon.co.uk 998558564 mail2news:16477 mail2news mail2news.demon.co.uk X-Complaints-To: abuse@demon.net X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov) Lines: 29 Xref: archiver1.google.com comp.std.c++:7090 In article <7dc3b1ea.0108220617.421ee131@posting.google.com>, Peter Dimov wrote: > int const & r = 5; > const_cast(r) = 6; > >Is this legal? I think that it is. >Literals aren't const (they are >about 90% const, but not 100% const.) I don't think that's the issue. The issue is which qualifiers it "picks up." This is really your code: const int temp = 5; int const & r = temp; const_cast(r) = 6; Do you think that's ok? -- Greg Comeau Countdown to "export": December 1, 2001 Comeau C/C++ ONLINE ==> http://www.comeaucomputing.com/tryitout World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90. Comeau C/C++ with Dinkumware's Libraries... Have you tried 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.research.att.com/~austern/csc/faq.html ]