From -62123117394399668
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f78e5,7458762a2c3b301d
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2001-08-24 10:22:00 PST
Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!colt.net!dispose.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail
From: joerg.barfurth@attglobal.net (Joerg Barfurth)
Newsgroups: comp.std.c++
Subject: Re: Are literals const?
Date: Fri, 24 Aug 2001 17:20:58 GMT
Organization: My beloved Family
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <1eymcil.1ha1g1s152ktroN%joerg.barfurth@attglobal.net>
References: <7dc3b1ea.0108220617.421ee131@posting.google.com> <9m24k7$e2d$1@glue.ucr.edu>
X-Trace: mail2news.demon.co.uk 998673664 mail2news:1137 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)
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
User-Agent: MacSOUP/D-2.4.6 (unregistered for 409 days)
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mulga.cs.mu.OZ.AU id DAA27978
Lines: 38
Xref: archiver1.google.com comp.std.c++:7122

<thp@cs.ucr.edu> wrote:

> Until recently I though that only lvalues could be const, but rvalues
> of struct/class types have a this-pointer by which their member
> functions can modify them.  So:
>=20
> struct Stuff {
>  void bar() const;
>  void baz();
> };
>=20
> const Stuff foo();
>=20
> int main() {
>   foo().bar(); // cool
>   foo().baz(); // error -- violates constness of rvalue foo().
> }
>=20
> That wedge opens the door for both const and volatile rvalues of all
> types.  (I'm still getting used to the notion.)

No. It opens the door only for const and volatile rvalues of class type.
rvalues of non-class types are not cv-qualified.

Regards, J=F6rg

--=20
J=F6rg Barfurth                         joerg.barfurth@attglobal.net
<<<<<<<<<<<<< using std::disclaimer;  <<<<<<<<<<<<<<<<<<<<<<<<<<<<
Software Developer                    http://www.OpenOffice.org
StarOffice Configuration              http://www.sun.com/staroffice

---
[ 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                ]



