|
Boost : |
Subject: Re: [boost] Adding polymorphic_value to boost
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2017-11-20 02:03:46
AMDG
On 11/19/2017 04:41 PM, Peter Dimov via Boost wrote:
> Peter Bartlett wrote:
>
>> The only nit I had in the paper was that after all the banging on
>> about it 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()`.
>
Also, (ab)using operator* and operator-> like this
isn't something new. optional is the same.
In Christ,
Steven Watanabe
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk