Standard Supplemental Concepts#

group std_supplemental_concepts

Assortment of concept definitions to supplement those provided by the standard. These are generally either similar to existing concepts, but implemented more or less stringently to account for use-cases in which the standard implementations are incompatible, completely novel concepts, filling in gaps in the API surface that the standard doesn’t cover, or concept definitions corresponding to standard type traits that have not had corresponding concept definitions defined for them.

Example:#

#include <hyperion/mpl/concepts/std_supplemental.h>

using namespace hyperion::mpl::concepts;
struct trivially_move_but_not_copyable {
    trivially_move_but_not_copyable(const trivially_move_but_not_copyable&) = delete;
    trivially_move_but_not_copyable(trivially_move_but_not_copyable&&) = default;

    auto operator=(const trivially_move_but_not_copyable&)
        -> trivially_move_but_not_copyable& = delete;
    auto operator=(trivially_move_but_not_copyable&&)
        -> trivially_move_but_not_copyable& = default;
};

static_assert(TriviallyMovable<trivially_move_but_not_copyable>);
static_assert(!TriviallyMovable<std::vector<int>>);
template<typename TType>
concept TriviallyMovable#
#include <hyperion/mpl/type_traits/std_supplemental.h>

Concept defining what a trivially movable type is. A type that is trivially movable is both trivially move constructible and trivially move assignable.

For a type to be trivially move constructible, the type must be move constructible, and its move constructor must either not be user provided in any way, or explicitly defaulted by declaring it as = default. Similarly, for a type to be trivially move assignable, the type must be move assignable, and its move assignment operator must either not be user provided in any way, or explicitly defaulted by declaring it as = default.

Requirements#

  • TType must be trivially move constructible

  • TType must be trivially move assignable

tparam TType:

The type to check