Skip to content

Usability issue: boost::tribool::value_t is public #16

@fekir

Description

@fekir

The tribool interface is not very user-friendly, I saw more than once following error:

assignment:

boost::tribool v1 = boost::tribool::false_value;
boost::tribool v2 = boost::tribool::true_value;
boost::tribool v3 = boost::tribool::indeterminate_value;

comparison:

v1 == boost::tribool::false_value;
v2 == boost::tribool::true_value;
v3 == boost::tribool::indeterminate_value;

The issue is frequent because of auto completion.
Since operator==, operator safe_bool and the function indeterminate it is possible to query the status of boost::tribool, I do not think there are good reasons for the value_t to be public.

If boost::tribool::value_t is changed to private, some function like indeterminate and operator! needs to be made friends, but otherwise there should be no other issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions