explicit icon indicating copy to clipboard operation
explicit copied to clipboard

tagged_bool: Add support for default value

Open fwinkl opened this issue 7 years ago • 0 comments

The tagged_bool could maybe benefit from a default value, which is false by default (following the convention of a default constructed bool) but can be overridden by the developer. While this is less explicit, if the name for the tagged_bool type is carefully chosen, the code gets more compact without much loss in explicitness. E.g.:

using EngineStarted = xplicit::tagged_bool<class EngineStartedTag, true>;
set_status(EngineStarted{});

fwinkl avatar Sep 10 '18 14:09 fwinkl