Public API

Namespaces

type_safe\exclude

Functions

operator|Creates a ts::flag_combo from two enums.
operator~Creates a ts::flag_mask for the single enum value.

Defines

Defines (boolean.hpp)

TYPE_SAFE_DETAIL_MAKE_PREDICATE(Name,Op)
struct Name
{
using is_transparent = int;

template <typename T1, typename T2>
constexpr bool operator()(T1&& a, T2&& b) const
noexcept(noexcept(std::forward<T1>(a) Op std::forward<T2>(b)))
{
return static_cast<bool>(std::forward<T1>(a) Op std::forward<T2>(b));
}
};


exclude

Defines (bounded_type.hpp)

TYPE_SAFE_DETAIL_MAKE(Name,Op)


exclude

Defines (config.hpp)

TYPE_SAFE_ENABLE_ASSERTIONS 0

Controls whether internal assertions are enabled.

It is disabled by default.

Mentioned in:

Getting Started / Installation

TYPE_SAFE_ENABLE_PRECONDITION_CHECKS 1

Controls whether preconditions are checked.

It is enabled by default.

TYPE_SAFE_ENABLE_WRAPPER 1

Controls whether the typedefs in [types.hpp]() use the type safe wrapper types.

It is enabled by default.

Mentioned in:

Getting Started / Installation

TYPE_SAFE_ARITHMETIC_POLICY 1

Controls whether [ts::arithmetic_policy_default]() is [ts::undefined_behavior_arithmetic](), [ts::checked_arithmetic](), or [ts::default_arithmetic]().

It is [ts::undefined_behavior_arithmetic]() by default.

Mentioned in:

Getting Started / Installation

TYPE_SAFE_DELETE_FUNCTIONS 0


exclude

TYPE_SAFE_USE_REF_QUALIFIERS 0

TYPE_SAFE_LVALUE_REF

TYPE_SAFE_RVALUE_REF

TYPE_SAFE_USE_RETURN_TYPE_DEDUCTION 0

TYPE_SAFE_USE_NOEXCEPT_DEFAULT 1


exclude

TYPE_SAFE_NOEXCEPT_DEFAULT(Val)
noexcept(Val)


exclude

TYPE_SAFE_USE_CONSTEXPR14 0


exclude

TYPE_SAFE_CONSTEXPR14


exclude

TYPE_SAFE_USE_EXCEPTIONS 0


exclude

TYPE_SAFE_THROW(Ex)
(Ex, type_safe::detail::on_disabled_exception())

TYPE_SAFE_TRY if (true)

TYPE_SAFE_CATCH_ALL if (false)

TYPE_SAFE_RETHROW type_safe::detail::on_disabled_exception()

TYPE_SAFE_USE_RTTI 0

Defines (constrained_type.hpp)

TYPE_SAFE_DETAIL_MAKE_OP(Op)
template <typename T, typename Constraint, class Verifier>
constexpr auto operator Op(const constrained_type<T, Constraint, Verifier>& lhs,
const constrained_type<T, Constraint, Verifier>&
rhs) noexcept(noexcept(lhs.get_value() Op rhs.get_value()))
->decltype(lhs.get_value() Op rhs.get_value())
{
return lhs.get_value() Op rhs.get_value();
}


exclude

Defines (force_inline.hpp)

TYPE_SAFE_FORCE_INLINE DEBUG_ASSERT_FORCE_INLINE

Defines (flag_set.hpp)

TYPE_SAFE_DETAIL_SELECT(Min,Max,Type)
template <std::size_t Size>
struct select_flag_set_int<Size, typename std::enable_if<(Size > Min && Size <= Max)>::type>
{
using type = Type;
};


exclude

Defines (strong_typedef.hpp)

TYPE_SAFE_DETAIL_MAKE_OP_STRONGTYPEDEF_OTHER(Op,Name,Result)
/** \exclude */
template <class StrongTypedef, typename OtherArg, typename Other,
typename = detail::enable_if_convertible_same<Other&&, OtherArg>>
constexpr Result operator Op(const Name<StrongTypedef, OtherArg>& lhs, Other&& rhs)
{
return Result(get(static_cast<const StrongTypedef&>(lhs))
Op detail::forward_or_underlying(detail::forward<Other>(rhs)));
}
/** \exclude */
template <class StrongTypedef, typename OtherArg, typename Other,
typename = detail::enable_if_convertible_same<Other&&, OtherArg>>
constexpr Result operator Op(Name<StrongTypedef, OtherArg>&& lhs, Other&& rhs)
{
return Result(get(static_cast<StrongTypedef&&>(lhs))
Op detail::forward_or_underlying(detail::forward<Other>(rhs)));
}


exclude

TYPE_SAFE_DETAIL_MAKE_OP_OTHER_STRONGTYPEDEF(Op,Name,Result)
/** \exclude */
template <class StrongTypedef, typename OtherArg, typename Other,
typename = detail::enable_if_convertible_same<Other&&, OtherArg>>
constexpr Result operator Op(Other&& lhs, const Name<StrongTypedef, OtherArg>& rhs)
{
return Result(detail::forward_or_underlying(detail::forward<Other>(lhs))
Op get(static_cast<const StrongTypedef&>(rhs)));
}
/** \exclude */
template <class StrongTypedef, typename OtherArg, typename Other,
typename = detail::enable_if_convertible_same<Other&&, OtherArg>>
constexpr Result operator Op(Other&& lhs, Name<StrongTypedef, OtherArg>&& rhs)
{
return Result(detail::forward_or_underlying(detail::forward<Other>(lhs))
Op get(static_cast<StrongTypedef&&>(rhs)));
}

TYPE_SAFE_DETAIL_MAKE_OP_MIXED(Op,Name,Result)
TYPE_SAFE_DETAIL_MAKE_OP_STRONGTYPEDEF_OTHER(Op, Name, Result)
TYPE_SAFE_DETAIL_MAKE_OP_OTHER_STRONGTYPEDEF(Op, Name, Result)

TYPE_SAFE_DETAIL_MAKE_OP_COMPOUND(Op,Name)


exclude

TYPE_SAFE_DETAIL_MAKE_OP_COMPOUND_MIXED(Op,Name)
/** \exclude */
template <class StrongTypedef, typename OtherArg, typename Other,
typename = detail::enable_if_convertible_same<Other&&, OtherArg>>
TYPE_SAFE_CONSTEXPR14 StrongTypedef& operator Op(Name<StrongTypedef, OtherArg>& lhs,
Other&& rhs)
{
get(static_cast<StrongTypedef&>(lhs))
Op detail::forward_or_underlying(detail::forward<Other>(rhs));
return static_cast<StrongTypedef&>(lhs);
}
/** \exclude */
template <class StrongTypedef, typename OtherArg, typename Other,
typename = detail::enable_if_convertible_same<Other&&, OtherArg>>
TYPE_SAFE_CONSTEXPR14 StrongTypedef&& operator Op(Name<StrongTypedef, OtherArg>&& lhs,
Other&& rhs)
{
get(static_cast<StrongTypedef&&>(lhs))
Op detail::forward_or_underlying(detail::forward<Other>(rhs));
return static_cast<StrongTypedef&&>(lhs);
}


exclude

TYPE_SAFE_DETAIL_MAKE_STRONG_TYPEDEF_OP(Name,Op)
template <class StrongTypedef>
struct Name
{};
TYPE_SAFE_DETAIL_MAKE_OP(Op, Name, StrongTypedef)
TYPE_SAFE_DETAIL_MAKE_OP_COMPOUND(Op## =, Name)
template <class StrongTypedef, typename Other>
struct mixed_##Name
{};
TYPE_SAFE_DETAIL_MAKE_OP_MIXED(Op, mixed_##Name, StrongTypedef)
TYPE_SAFE_DETAIL_MAKE_OP_COMPOUND_MIXED(Op## =, mixed_##Name)
template <class StrongTypedef, typename Other>
struct mixed_##Name##_noncommutative
{};
TYPE_SAFE_DETAIL_MAKE_OP_STRONGTYPEDEF_OTHER(Op, mixed_##Name##_noncommutative, StrongTypedef)
TYPE_SAFE_DETAIL_MAKE_OP_COMPOUND_MIXED(Op## =, mixed_##Name##_noncommutative)


exclude

Defines (types.hpp)

TYPE_SAFE_DETAIL_WRAP(templ,x)
x






Add Discussion as Guest

Log in