> Message: 12
> Date: Mon, 20 Nov 2017 01:41:10 +0200
> From: "Peter Dimov" <[hidden email]>
> To: <[hidden email]>
> Subject: Re: [boost] Adding polymorphic_value to boost
> Message-ID: <E0D82A60493A491CBFFD0E264E3917D1@pdimov5>
> Content-Type: text/plain; format=flowed; charset="iso-8859-1";
> Peter Bartlett wrote:
> > The only nit I had in the paper was that after all the banging on about
> > being a value type, we are given operator bool, operator* and operator->,
> > making it pointer-like again. Could operator T& and operator T const&
> > work?
> Polymorphic means virtual functions, and when you have a
> polymorphic_value<T> pv, where T has a virtual function `f`, you can call
> `pv->f()`. With a conversion to T&, you can't call `pv.f()`.
I believe I've seen other libraries (maybe Optional) provide the helpful
comment above accessors used like this to the effect that 'this accessor
syntax does not imply pointer semantics.'
I guess -> and * accessors would not be required if there was such as thing
as overloaded dot operator.