|
Boost : |
Subject: Re: [boost] Adding polymorphic_value to boost
From: Peter Bartlett (pete_at_[hidden])
Date: 2017-11-19 22:34:09
>Soooooooo - In my humble opinion, this submission needs more work before it
could seriously considered for review as a boost library.
To offer a quick alternative view, my immediate impression upon reading
p0201 paper, was "ah cool, someone's finally formalizing why I've used pImpl
for more than a decade" i.e. "value-izing" a polymorphic hierarchy. Making
things a value type is very useful - coping and moving just "do as the ints
do" and so make them easy to use in contexts like, yes, a class having two
polymorphic member variables. None of that yucky stuff about remembering not
to leak the first one when the second fails to clone... just two normal
member variables.
I'd like to see this in boost:: and then std::. Because unique_ptr is so
well digested by now, it feels right that this could be done relatively
quickly.
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?
Pete
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk