On 7/4/19 8:00 AM, Robert Ramey via Boost wrote:
On 7/3/19 12:40 PM, Andrey Semashev via Boost wrote:
On 7/3/19 7:42 PM, Robert Ramey via Boost wrote:
The policy based design is an implement technique to specify the set of legitimate variations of a design which the user might need without the need to write multiple types. Right now we have:
boost::variant std::variant boost::variant2 boost::outcome ?::expected boost::optional std::optional ... ?
Each one of these is a hodgepodge of design decisions arrived at after very, very, very long speculative discussion. That are really all just special cases of the the concept of "typesafe variant".
We've already had this discussion, and I'll reiterate that these types are not merely special cases - they serve their specific purposes and have interfaces and behavior tailored for their respective uses.
To me, it's just about code reuse. The class with the policies contains all the variations for different features. The aliases just select which features are to be used.
Code can be reused without implementing this meta-variant.