explicit
explicit copied to clipboard
tagged_bool: Add support for default value
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{});