Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-08-17 13:46:12


From: "David Abrahams" <dave_at_[hidden]>
> From: "Peter Dimov" <pdimov_at_[hidden]>
>
>
> > From: "David Abrahams" <dave_at_[hidden]>
> > [quotation moved to top]
> > > From: "Victor A. Wagner, Jr." <vawjr_at_[hidden]>
> > > > isn't this going to cause some unexpected/surprising behavior when
> > > someone
> > > > tries:
> > > >
> > > > a[n] = someT;
> >
> > > No, there won't be any behavior because compilation will fail.
> >
> > It is not guaranteed to fail. operator[] returns a non-const value_type,
> and
> > rvalues of class types are assignable.
>
> Good point. Should the return type be const?

I think so, at least for conforming compilers. Borland C++, in particular,
often has problems with cv qualifiers (argument deduction doesn't strip
them.)


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk