The mystery of C++20 concept boolean-testable

C++20 introduces a comparison concept boolean-testable, but I noticed its italics and the hyphens in the middle, indicating that it is for exposition-only, and since there is no so-called std::boolean_testable in <concepts>, we cannot use it in our own code.

What is the purpose of this exposition-only concept? And why is this concept so mysterious?

Answer

Its purpose, like all exposition-only concepts, is to simplify the specification in the standard. It’s simply a building block for specifying other (potentially user-facing) concepts without needing to repeat the thing the concept models. Of note, it appears in the specification of another exposition-only concept

template<class T, class U>
  concept weakly-equality-comparable-with = // exposition only
    requires(const remove_reference_t<T>& t,
             const remove_reference_t<U>& u) {
      { t == u } -> boolean-testable;
      { t != u } -> boolean-testable;
      { u == t } -> boolean-testable;
      { u != t } -> boolean-testable;
    };

weakly-equality-comparable-with is satisfied for types that overload the comparison operators with a return type that isn’t verbatim bool necessarily. We can still use these expressions to compare objects, and so the standard seeks to reason about them. And it’s not an hypothetical, they can appear in the wild. An example from the Palo Alto report:

… One such example is an early version of the QChar class (1.5 and earlier, at least) (Nokia Corporation, 2011).

class QChar
{
  friend int operator==(QChar c1, QChar c2);
  friend int operator!=(QChar c1, QChar c2);
};

We should be able to use this class in our standard algorithms, despite the fact that the operator does not return a bool.

As for your other question

And why is this concept so mysterious?

It isn’t. But if one examines it on cppreference alone, one may miss out on context since it may not be easy to cross-reference it there.