https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71899

            Bug ID: 71899
           Summary: An internal BooleanTestable trait should be provided
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: daniel.kruegler at googlemail dot com
  Target Milestone: ---

I suggest to provide an internal type trait that corresponds to the currently
discussed BooleanTestable requirement set as described in LWG 2743:

http://cplusplus.github.io/LWG/lwg-active.html#2743

This trait could be used in SFINAE-constraints such as for the recently added
comparison functions of std::optional or as argument of static_assert for the
existing comparison functions of std::tuple and possibly other places as well.

In the absence of any better name, I suggest to introduce a type trait named
__is_boolean_testable in header <type_traits>.

Given that LWG 2743 is not resolved yet, I recommend to start with a very weak
set of requirements for some type T, e.g. the logical AND of

std::is_convertible<const T&, bool>::value
std::is_constructible<bool, const T&>::value

I'm willing to provide this contribution.

Reply via email to