stl.h
Go to the documentation of this file.
#ifndef __utl_concepts_stl_h__
#define __utl_concepts_stl_h__
#include <utl/core/impl.h>
#include <utl/meta/meta.h>
#include <utl/utility/invoke.h>
#include <utl/concepts/defines.h>
namespace utl {
template <typename T>
using remove_cvref_t = std::remove_cv_t< std::remove_reference_t<T> >;
template <typename T>
using cref_ = const std::remove_reference_t<T>&;
template <typename T>
using _ref_t = std::add_lvalue_reference_t<T>;
template <typename _T1, typename _T2, typename _Ret =_T1>
using use_if_same_t = meta::eval<
meta::enable_if<
meta::same_<_T1, _T2>::value, _Ret
>
>;
template <class T, class U>
_utlConcept Same = meta::same_<T, U>::value;
// template<class T>
// _utlConcept Decayed = Same<T, std::decay_t<T>>;
template <class Derived, class Base>
_utlConcept DerivedFrom =
std::is_base_of<Base, Derived>::value &&
std::is_convertible<const volatile Derived*, const volatile Base*>::value;
template <class From, class To>
#if CXX_CONCEPTS
_utlConcept ConvertibleTo =
std::is_convertible<From, To>::value &&
requires(From (&f)()) {
static_cast<To>(f());
};
#else
_utlConcept ConvertibleTo = std::is_convertible<From, To>::value;
#endif
namespace common_impl {
// ========== common reference ===========
template<class T, class U>
using __cond_res =
decltype(false ? std::declval<T(&)()>()() : std::declval<U(&)()>()());
template<class From>
struct __copy_cv_ {
static_assert(!std::is_reference<From>::value);
template<class To> using apply = To;
};
template<class From>
struct __copy_cv_<const From> {
template<class To> using apply = const To;
};
template<class From>
struct __copy_cv_<volatile From> {
template<class To> using apply = volatile To;
};
template<class From>
struct __copy_cv_<const volatile From> {
template<class To> using apply = const volatile To;
};
template<class From, class To>
using __copy_cv = meta::invoke<__copy_cv_<From>, To>;
// CREF [meta.trans.other]/2.1
template<class T>
using __cref = std::add_lvalue_reference_t<const std::remove_reference_t<T>>;
// COMMON_REF [meta.trans.other]/2
template<class T, class U, class = void>
struct __common_ref_ {
static_assert(std::is_reference<T>::value, "");
static_assert(std::is_reference<U>::value, "");
};
template<class T, class U>
using __common_ref = meta::eval<__common_ref_<T, U>>;
// [meta.trans.other]/2.5
template<class T, class U>
using __lref_res = __cond_res<
__copy_cv<T, U> &,
__copy_cv<U, T> &
>;
// [meta.trans.other]/2.6
template<class T, class U, class R = __common_ref<T&, U&>>
using __rref_res = std::remove_reference_t<R>&&;
template<class T, class U>
struct __common_ref_<T&, U&,
meta::void_t<__lref_res<T, U>,
meta::when<std::is_reference<__lref_res<T, U>>::value>> > {
using type = __lref_res<T, U>;
};
template<class T, class U>
struct __common_ref_<T&&, U&&,
meta::void_t<__common_ref<T&, U&>,
meta::when<ConvertibleTo<T&&, __rref_res<T, U>>>,
meta::when<ConvertibleTo<U&&, __rref_res<T, U>>>> > {
using type = __rref_res<T, U>;
};
// [meta.trans.other]/2.7
template<class T, class U>
struct __common_ref_<T&&, U&,
meta::void_t<__common_ref<const T&, U&>,
meta::when<ConvertibleTo<T&&, __common_ref<const T&, U&>>>> > {
using type = __common_ref<const T&, U&>;
};
// [meta.trans.other]/2.8
template<class T, class U>
struct __common_ref_<T&, U&&,
meta::void_t<__common_ref<T&, const U&>,
meta::when<ConvertibleTo<U&&, __common_ref<T&, const U&>>>> > {
using type = __common_ref<T&, const U&>;
};
template<class>
struct __xref {
template<class U> using apply = U;
};
template<class T>
struct __xref<const T> {
template<class U> using apply = const U;
};
template<class T>
struct __xref<volatile T> {
template<class U> using apply = volatile U;
};
template<class T>
struct __xref<const volatile T> {
template<class U> using apply = const volatile U;
};
template<class T>
struct __xref<T&> {
template<class U> using apply =
std::add_lvalue_reference_t<meta::invoke<__xref<T>, U>>;
};
template<class T>
struct __xref<T&&> {
template<class U> using apply =
std::add_rvalue_reference_t<meta::invoke<__xref<T>, U>>;
};
template<class,
class,
template<class> class,
template<class> class
>
struct basic_common_reference { };
template<class T, class U>
using __basic_common_reference_t = meta::eval<
basic_common_reference<
remove_cvref_t<T>,
remove_cvref_t<U>,
__xref<T>::template apply,
__xref<U>::template apply
>
>;
template<class...>
struct common_reference {};
template<class... Ts>
using common_reference_t = meta::eval<
common_reference<Ts...>
>;
// [meta.trans.other]/5.2
template<class T>
struct common_reference<T> {
using type = T;
};
// [meta.trans.other]/5.3.4
template<class T, class U, class...>
struct __common_reference3
: std::common_type<T, U> {};
// [meta.trans.other]/5.3.3
template<class T, class U>
struct __common_reference3<T, U,
meta::void_t<__cond_res<T, U>>> {
using type = __cond_res<T, U>;
};
template<class T, class U, class...>
struct __common_reference2
: __common_reference3<T, U> {};
// [meta.trans.other]/5.3.2
template<class T, class U>
struct __common_reference2<T, U,
meta::void_t<__basic_common_reference_t<T, U>>> {
using type = __basic_common_reference_t<T, U>;
};
template <class T, class U, class...>
struct __common_reference
: __common_reference2<T, U> { };
template <class T, class U>
struct __common_reference<T, U,
meta::when<std::is_reference<T>::value && std::is_reference<U>::value>> {
using type = __common_ref<T, U>;
};
template<class T, class U>
struct common_reference<T, U> : __common_reference<T, U> { };
// [meta.trans.other]/5.4
template<class T, class U, class V, class... W>
//requires requires { typename common_reference_t<T, U>; }
struct common_reference<T, U, V, W...>
: common_reference <
common_reference_t<T, U>, V, W...
> {};
}
template<typename...Ts>
using common_reference = common_impl::common_reference<Ts...>;
template<typename... Ts>
using common_reference_t = meta::eval<
common_reference<Ts...>
>;
//FIXME: CommonReference needs better implementation
template <class T, class U>
_utlConcept CommonReference =
Same<common_reference_t<T, U>, common_reference_t<U, T>> &&
ConvertibleTo<T, common_reference_t<T, U>> &&
ConvertibleTo<U, common_reference_t<T, U>>;
// != std::Common on CommonReference
template <class T, class U>
_utlConcept Common =
#if CXX_CONCEPTS
Same<std::common_type_t<T, U>, std::common_type_t<U, T>> &&
requires {
static_cast<std::common_type_t<T, U>>(std::declval<T>());
static_cast<std::common_type_t<T, U>>(std::declval<U>());
};
// } &&
// CommonReference<
// std::add_lvalue_reference_t<const T>,
// std::add_lvalue_reference_t<const U>> &&
// CommonReference<
// std::add_lvalue_reference_t<std::common_type_t<T, U>>,
// std::common_reference_t<
// std::add_lvalue_reference_t<const T>,
// std::add_lvalue_reference_t<const U>
// >
// >;
#else
// meta::and_ <
Same<std::common_type_t<T, U>, std::common_type_t<U, T>>; //>
// meta::bool_<CommonReference<
// std::add_lvalue_reference_t<const T>,
// std::add_lvalue_reference_t<const U>
// >>,
// meta::bool_< CommonReference<
// std::add_lvalue_reference_t<std::common_type_t<T, U>>,
// common_reference_t<
// std::add_lvalue_reference_t<const T>,
// std::add_lvalue_reference_t<const U>
// >
// >>
// >::value;
#endif
template <class T>
_utlConcept Integral = std::is_integral<T>::value;
template <class T>
_utlConcept SignedIntegral = Integral<T> && std::is_signed<T>::value;
template <class T>
_utlConcept UnsignedIntegral = Integral<T> && !std::is_signed<T>::value;
template <typename T>
_utlConcept MoveAssignable = std::is_move_assignable<T>::value;
template <typename T>
_utlConcept CopyAssignable = std::is_copy_assignable<T>::value;
template<class LHS, class RHS>
_utlConcept Assignable =
#if CXX_CONCEPTS
std::is_lvalue_reference<LHS>::value &&
// CommonReference<
// const std::remove_reference_t<L>&,
// const std::remove_reference_t<R>&> &&
requires(LHS lhs, RHS&& rhs) {
lhs = std::forward<RHS>(rhs);
requires Same<
decltype(lhs = std::forward<RHS>(rhs)), LHS
>;
};
#else
std::is_assignable<LHS, RHS>::value;
#endif
#if CXX_VER < CXX_VER_STD_17
namespace swappable_with_impl {
struct is_swappable_with_ {
// can apply std::swap
template<typename _Tp,
typename _Up,
typename
= decltype(std::swap(std::declval<_Tp&>(), std::declval<_Up&>())),
typename
= decltype(std::swap(std::declval<_Up&>(), std::declval<_Tp&>()))>
static meta::true_ check(int);
// can not apply std::swap
template<typename, typename> static meta::false_ check(...);
};
}
template <typename _Tp, typename _Up>
struct is_swappable_with
: swappable_with_impl::is_swappable_with_ {
using type = decltype(check<_Tp, _Up>(0));
};
#else
using is_swappable = std::is_swappable;
using is_swappable_with = std::is_swappable_with;
#endif
// != std:: on CommonReference
template<class T, class U>
_utlConcept SwappableWith =
is_swappable_with<T, T>::type::value &&
is_swappable_with<U, U>::type::value &&
is_swappable_with<T, U>::type::value &&
is_swappable_with<U, T>::type::value;
// std::CommonReference<
// const std::remove_reference_t<T>&,
// const std::remove_reference_t<U>&
// >;
// != std:: we use is_swappable_with now is_swappable
template<class T>
_utlConcept Swappable = is_swappable_with<T, T>::type::value;
template <class T>
_utlConcept Destructible = std::is_nothrow_destructible<T>::value;
template <class T, class... Args>
_utlConcept Constructible =
Destructible<T> && std::is_constructible<T, Args...>::value;
template <class T>
_utlConcept DefaultConstructible = Constructible<T>;
template<class T>
_utlConcept MoveConstructible =
Constructible<T, T> && ConvertibleTo<T, T>;
template <class T>
_utlConcept CopyConstructible =
MoveConstructible<T> &&
Constructible<T, _ref_t<T>> && ConvertibleTo<_ref_t<T>, T> &&
Constructible<T, const _ref_t<T>> && ConvertibleTo<const _ref_t<T>, T> &&
Constructible<T, const T> && ConvertibleTo<const T, T>;
template <class T>
_utlConcept Movable =
std::is_object<T>::value &&
MoveConstructible<T> &&
Assignable<_ref_t<T>, T> &&
Swappable<T>;
template <class T>
_utlConcept Copyable =
CopyConstructible<T> &&
Movable<T> &&
Assignable<_ref_t<T>, const _ref_t<T>>;
#if CXX_CONCEPTS
template <class B>
_utlConcept Boolean =
Movable<remove_cvref_t<B>> &&
requires(const std::remove_reference_t<B>& b1,
const std::remove_reference_t<B>& b2, const bool a) {
requires ConvertibleTo<const std::remove_reference_t<B>&, bool>;
!b1; requires ConvertibleTo<decltype(!b1), bool>;
b1 && a; requires Same<decltype(b1 && a), bool>;
b1 || a; requires Same<decltype(b1 || a), bool>;
b1 && b2; requires Same<decltype(b1 && b2), bool>;
a && b2; requires Same<decltype(a && b2), bool>;
b1 || b2; requires Same<decltype(b1 || b2), bool>;
a || b2; requires Same<decltype(a || b2), bool>;
b1 == b2; requires ConvertibleTo<decltype(b1 == b2), bool>;
b1 == a; requires ConvertibleTo<decltype(b1 == a), bool>;
a == b2; requires ConvertibleTo<decltype(a == b2), bool>;
b1 != b2; requires ConvertibleTo<decltype(b1 != b2), bool>;
b1 != a; requires ConvertibleTo<decltype(b1 != a), bool>;
a != b2; requires ConvertibleTo<decltype(a != b2), bool>;
};
#else
namespace details {
// template <typename B> using try_op_not_ = decltype(!std::declval<cref_<B>>());
// template <typename B> using try_op_eq_ = decltype(std::declval<cref_<B>>() == std::declval<cref_<B>>());
// template <typename B> using try_op_neq_ = decltype(std::declval<cref_<B>>() != std::declval<cref_<B>>());
// template <typename B> using try_op_and_ = decltype(std::declval<cref_<B>>() && std::declval<cref_<B>>());
// template <typename B> using try_op_or_ = decltype(std::declval<cref_<B>>() || std::declval<cref_<B>>());
//
// template <typename B>
// struct is_boolean__ {
// using type = meta::and_ <
// meta::is_detected<B, try_op_not_>,
// meta::is_detected<B, try_op_eq_>,
// meta::is_detected<B, try_op_neq_>,
// meta::is_detected<B, try_op_and_>,
// meta::is_detected<B, try_op_or_>
// >;
// };
template <typename B, typename = void>
struct is_boolean_ {
using type = meta::false_;
};
template <typename B>
struct is_boolean_ <B, meta::void_t<
meta::use_if_same_t<bool, decltype(!std::declval<cref_<B>>())>,
meta::use_if_same_t<bool, decltype(std::declval<cref_<B>>() == std::declval<cref_<B>>())>,
meta::use_if_same_t<bool, decltype(std::declval<cref_<B>>() != std::declval<cref_<B>>())>,
meta::use_if_same_t<bool, decltype(std::declval<cref_<B>>() && std::declval<cref_<B>>())>,
meta::use_if_same_t<bool, decltype(std::declval<cref_<B>>() || std::declval<cref_<B>>())>
>> {
using type = meta::true_;
};
template <typename B>
using is_boolean_t = meta::eval <
is_boolean_<B>
>;
}
template <class B>
_utlConcept Boolean =
Movable<remove_cvref_t<B>> &&
//ConvertibleTo<const std::remove_reference_t<B>&, bool> &&
ConvertibleTo<const _ref_t<B>, bool> &&
Same<meta::true_, details::is_boolean_t<B>>;
#endif
namespace details {
template <typename T, typename U, typename = void>
struct is_weakly_equality_comparable_with_ {
using type = meta::false_;
};
template <typename T, typename U>
struct is_weakly_equality_comparable_with_<T, U, meta::void_t<
meta::use_if_same_t<bool, decltype(std::declval<cref_<T>>() == std::declval<cref_<U>>())>,
meta::use_if_same_t<bool, decltype(std::declval<cref_<T>>() != std::declval<cref_<U>>())>,
meta::use_if_same_t<bool, decltype(std::declval<cref_<U>>() == std::declval<cref_<T>>())>,
meta::use_if_same_t<bool, decltype(std::declval<cref_<U>>() != std::declval<cref_<T>>())>
>> {
using type = meta::true_;
};
template <typename T, typename U>
using is_weakly_equality_comparable_with_t = meta::eval<
is_weakly_equality_comparable_with_ <T, U>
>;
}
template <class T, class U>
_utlConcept WeaklyEqualityComparableWith =
#if CXX_CONCEPTS
requires(const std::remove_reference_t<T>& t,
const std::remove_reference_t<U>& u) {
t == u; requires Boolean<decltype(t == u)>;
t != u; requires Boolean<decltype(t != u)>;
u == t; requires Boolean<decltype(u == t)>;
u != t; requires Boolean<decltype(u != t)>;
};
#else
Same<meta::true_, details::is_weakly_equality_comparable_with_t<T, U>>;
#endif
template <class T>
_utlConcept EqualityComparable = WeaklyEqualityComparableWith<T, T>;
template <class T, class U>
_utlConcept EqualityComparableWith =
EqualityComparable<T> &&
EqualityComparable<U> &&
// CommonReference<
// const std::remove_reference_t<T>&,
// const std::remove_reference_t<U>&> &&
// EqualityComparable<
// common_reference_t<
// const std::remove_reference_t<T>&,
// const std::remove_reference_t<U>&>> &&
WeaklyEqualityComparableWith<T, U>;
#if CXX_CONCEPTS
template <class T>
_utlConcept StrictTotallyOrdered =
EqualityComparable<T> &&
requires(const std::remove_reference_t<T>& a,
const std::remove_reference_t<T>& b) {
a < b; requires Boolean<decltype(a < b)>;
a > b; requires Boolean<decltype(a > b)>;
a <= b; requires Boolean<decltype(a <= b)>;
a >= b; requires Boolean<decltype(a >= b)>;
};
#else
namespace details {
template <typename T, typename = void>
struct is_strict_totally_ordered_ {
using type = meta::false_;
};
template <typename T>
struct is_strict_totally_ordered_ <T, meta::void_t <
meta::use_if_same_t<bool, decltype(std::declval<cref_<T>>() < std::declval<cref_<T>>())>,
meta::use_if_same_t<bool, decltype(std::declval<cref_<T>>() > std::declval<cref_<T>>())>,
meta::use_if_same_t<bool, decltype(std::declval<cref_<T>>() <= std::declval<cref_<T>>())>,
meta::use_if_same_t<bool, decltype(std::declval<cref_<T>>() >= std::declval<cref_<T>>())>
>> {
using type = meta::true_;
};
template <typename T>
using is_strict_totally_ordered_t = meta::eval <
is_strict_totally_ordered_<T>
>;
}
template <class T>
_utlConcept StrictTotallyOrdered =
EqualityComparable<T> &&
Same <meta::true_, details::is_strict_totally_ordered_t<T>>;
#endif
#if CXX_CONCEPTS
template <class T, class U>
_utlConcept StrictTotallyOrderedWith =
StrictTotallyOrdered<T> &&
StrictTotallyOrdered<U> &&
// CommonReference<
// const std::remove_reference_t<T>&,
// const std::remove_reference_t<U>&
// > &&
// StrictTotallyOrdered<
// common_reference_t<
// const std::remove_reference_t<T>&,
// const std::remove_reference_t<U>&
// >
// > &&
EqualityComparableWith<T, U> &&
requires(const std::remove_reference_t<T>& t,
const std::remove_reference_t<U>& u) {
t < u; requires Boolean<decltype(t < u)>;
t > u; requires Boolean<decltype(t > u)>;
t <= u; requires Boolean<decltype(t <= u)>;
t >= u; requires Boolean<decltype(t >= u)>;
u < t; requires Boolean<decltype(u < t)>;
u > t; requires Boolean<decltype(u > t)>;
u <= t; requires Boolean<decltype(u <= t)>;
u >= t; requires Boolean<decltype(u >= t)>;
};
#else
namespace details {
template <typename T, typename U, typename = void>
struct is_strict_totally_ordered_with_ {
using type = meta::false_;
};
template <typename T, typename U>
struct is_strict_totally_ordered_with_ <T, U, meta::void_t <
meta::use_if_same_t<bool, decltype(std::declval<cref_<T>>() < std::declval<cref_<U>>())>,
meta::use_if_same_t<bool, decltype(std::declval<cref_<T>>() > std::declval<cref_<U>>())>,
meta::use_if_same_t<bool, decltype(std::declval<cref_<T>>() <= std::declval<cref_<U>>())>,
meta::use_if_same_t<bool, decltype(std::declval<cref_<T>>() >= std::declval<cref_<U>>())>,
meta::use_if_same_t<bool, decltype(std::declval<cref_<U>>() < std::declval<cref_<T>>())>,
meta::use_if_same_t<bool, decltype(std::declval<cref_<U>>() > std::declval<cref_<T>>())>,
meta::use_if_same_t<bool, decltype(std::declval<cref_<U>>() <= std::declval<cref_<T>>())>,
meta::use_if_same_t<bool, decltype(std::declval<cref_<U>>() >= std::declval<cref_<T>>())>
>> {
using type = meta::true_;
};
template <typename T, typename U>
using is_strict_totally_ordered_with_t = meta::eval <
is_strict_totally_ordered_with_<T, U>
>;
}
template <class T, class U>
_utlConcept StrictTotallyOrderedWith =
StrictTotallyOrdered<T> &&
StrictTotallyOrdered<U> &&
EqualityComparableWith<T, U> &&
Same <meta::true_, details::is_strict_totally_ordered_with_t<T, U>>;
#endif
template <class T>
_utlConcept Semiregular = Copyable<T> && DefaultConstructible<T>;
template <class T>
_utlConcept Regular = Semiregular<T> && EqualityComparable<T>;
template<class T>
_utlConcept Scalar =
std::is_scalar<T>::value && Regular<T>;
template<class T>
_utlConcept Arithmetic =
std::is_arithmetic<T>::value && Scalar<T> && StrictTotallyOrdered<T>;
template<class T>
_utlConcept FloatingPoint =
std::is_floating_point<T>::value && Arithmetic<T>;
template <class F, class... Args>
_utlConcept Invocable = is_invocable<F, Args...>::value;
// requires(F&& f, Args&&... args) {
// invoke(std::forward<F>(f), std::forward<Args>(args)...);
// };
template< class F, class... Args >
_utlConcept RegularInvocable = Invocable<F, Args...>;
template < class F, class... Args >
_utlConcept Predicate =
RegularInvocable<F, Args...> &&
Boolean<invoke_result_t<F, Args...>>;
template <class R, class T, class U>
_utlConcept Relation =
Predicate<R, T, T> && Predicate<R, U, U> &&
Predicate<R, T, U> && Predicate<R, U, T>;
template < class R, class T, class U >
_utlConcept StrictWeakOrder = Relation<R, T, U>;
}
#endif /* __utl_concepts_stl_h__ */
utl::Semiregular
_utlConcept Semiregular
Definition: stl.h:717
utl::common_impl::__copy_cv_< const volatile From >::apply
const volatile To apply
Definition: stl.h:116
utl::Swappable
_utlConcept Swappable
Definition: stl.h:425
utl::is_swappable
std::is_swappable is_swappable
Definition: stl.h:407
utl::SwappableWith
_utlConcept SwappableWith
Definition: stl.h:413
utl::common_impl::__copy_cv_::apply
To apply
Definition: stl.h:104
meta.h
Include all meta library.
utl::WeaklyEqualityComparableWith
_utlConcept WeaklyEqualityComparableWith
Definition: stl.h:582
utl::Common
_utlConcept Common
Definition: stl.h:301
_utlConcept
#define _utlConcept
utl concept keyword syntax wrapper
Definition: defines.h:56
utl::Copyable
_utlConcept Copyable
Definition: stl.h:480
utl::details::is_strict_totally_ordered_< T, meta::void_t< meta::use_if_same_t< bool, decltype(std::declval< cref_< T >>()< std::declval< cref_< T >>())>, meta::use_if_same_t< bool, decltype(std::declval< cref_< T >>() > std::declval< cref_< T >>())>, meta::use_if_same_t< bool, decltype(std::declval< cref_< T >>()<=std::declval< cref_< T >>())>, meta::use_if_same_t< bool, decltype(std::declval< cref_< T >>() >=std::declval< cref_< T >>())> > >::type
meta::true_ type
Definition: stl.h:638
utl::meta::void_t
void void_t
void_t type alias
Definition: detection.h:55
utl::details::is_strict_totally_ordered_::type
meta::false_ type
Definition: stl.h:628
utl::common_impl::__xref< const volatile T >::apply
const volatile U apply
Definition: stl.h:191
utl::StrictWeakOrder
_utlConcept StrictWeakOrder
Definition: stl.h:769
utl::common_impl::__common_ref_< T &&, U &, meta::void_t< __common_ref< const T &, U & >, meta::when< ConvertibleTo< T &&, __common_ref< const T &, U & > > > > >::type
__common_ref< const T &, U & > type
Definition: stl.h:166
utl::FloatingPoint
_utlConcept FloatingPoint
Definition: stl.h:743
utl::common_impl::__cond_res
decltype(false ? std::declval< T(&)()>()() :std::declval< U(&)()>()()) __cond_res
Definition: stl.h:99
utl::common_impl::__common_ref_< T &&, U &&, meta::void_t< __common_ref< T &, U & >, meta::when< ConvertibleTo< T &&, __rref_res< T, U > > >, meta::when< ConvertibleTo< U &&, __rref_res< T, U > > > > >::type
__rref_res< T, U > type
Definition: stl.h:158
utl::common_impl::__common_ref
meta::eval< __common_ref_< T, U > > __common_ref
Definition: stl.h:133
utl::details::is_weakly_equality_comparable_with_
Definition: stl.h:561
utl::common_impl::__common_ref_
Definition: stl.h:127
utl::meta::true_
bool_< true > true_
The type used as a compile-time boolean with true value.
Definition: integral.h:68
utl::cref_
const std::remove_reference_t< T > & cref_
Definition: stl.h:45
utl::StrictTotallyOrdered
_utlConcept StrictTotallyOrdered
Definition: stl.h:647
utl::common_impl::__common_reference
Definition: stl.h:259
utl::Assignable
_utlConcept Assignable
Definition: stl.h:366
utl::Scalar
_utlConcept Scalar
Definition: stl.h:729
utl::ConvertibleTo
_utlConcept ConvertibleTo
Definition: stl.h:87
utl::common_impl::__common_reference3< T, U, meta::void_t< __cond_res< T, U > > >::type
__cond_res< T, U > type
Definition: stl.h:244
utl::common_impl::__cref
std::add_lvalue_reference_t< const std::remove_reference_t< T > > __cref
Definition: stl.h:123
utl::CopyAssignable
_utlConcept CopyAssignable
Definition: stl.h:359
utl::common_impl::__xref< T && >::apply
std::add_rvalue_reference_t< meta::invoke< __xref< T >, U > > apply
Definition: stl.h:201
utl::meta::enable_if
std::enable_if< If, _Tp > enable_if
enable_if, imported from stl
Definition: sfinae.h:60
utl::use_if_same_t
meta::eval< meta::enable_if< meta::same_< _T1, _T2 >::value, _Ret > > use_if_same_t
Definition: stl.h:55
utl::meta::apply
apply_impl::apply_< Fn, Seq > apply
Definition: typelist.h:197
utl::Destructible
_utlConcept Destructible
Definition: stl.h:432
utl::Invocable
_utlConcept Invocable
Definition: stl.h:750
utl::details::is_boolean_
Definition: stl.h:530
utl::details::is_strict_totally_ordered_t
meta::eval< is_strict_totally_ordered_< T > > is_strict_totally_ordered_t
Definition: stl.h:644
utl::Same
_utlConcept Same
Definition: stl.h:62
utl::details::is_boolean_::type
meta::false_ type
Definition: stl.h:531
utl::details::is_strict_totally_ordered_with_::type
meta::false_ type
Definition: stl.h:683
utl::common_impl::__xref::apply
U apply
Definition: stl.h:179
utl::common_impl::__copy_cv_< const From >::apply
const To apply
Definition: stl.h:108
utl::common_reference_t
meta::eval< common_reference< Ts... > > common_reference_t
Definition: stl.h:286
utl::common_impl::__common_reference2< T, U, meta::void_t< __basic_common_reference_t< T, U > > >::type
__basic_common_reference_t< T, U > type
Definition: stl.h:255
utl::common_impl::basic_common_reference
Definition: stl.h:209
utl::CommonReference
_utlConcept CommonReference
Definition: stl.h:293
utl::meta::false_
bool_< false > false_
The type used as a compile-time boolean with false value.
Definition: integral.h:69
utl::meta::eval
typename Tp::type eval
Type alias for Tp::type. Used to evaluate/extract return type of metafunctions.
Definition: integral.h:49
invoke.h
invoke() and invoke traits implementation
utl::details::is_strict_totally_ordered_
Definition: stl.h:627
defines.h
Concepts defines.
utl::DerivedFrom
_utlConcept DerivedFrom
Definition: stl.h:71
utl::details::is_weakly_equality_comparable_with_< T, U, meta::void_t< meta::use_if_same_t< bool, decltype(std::declval< cref_< T >>()==std::declval< cref_< U >>())>, meta::use_if_same_t< bool, decltype(std::declval< cref_< T >>() !=std::declval< cref_< U >>())>, meta::use_if_same_t< bool, decltype(std::declval< cref_< U >>()==std::declval< cref_< T >>())>, meta::use_if_same_t< bool, decltype(std::declval< cref_< U >>() !=std::declval< cref_< T >>())> > >::type
meta::true_ type
Definition: stl.h:572
utl::EqualityComparableWith
_utlConcept EqualityComparableWith
Definition: stl.h:599
utl::common_impl::__copy_cv_< volatile From >::apply
volatile To apply
Definition: stl.h:112
utl::common_impl::__lref_res
__cond_res< __copy_cv< T, U > &, __copy_cv< U, T > &> __lref_res
Definition: stl.h:140
utl::common_impl::__xref< T & >::apply
std::add_lvalue_reference_t< meta::invoke< __xref< T >, U > > apply
Definition: stl.h:196
utl
STL&#39;s core language concepts.
Definition: _1wire.h:30
utl::Predicate
_utlConcept Predicate
Definition: stl.h:759
utl::MoveAssignable
_utlConcept MoveAssignable
Definition: stl.h:356
utl::meta::same_
Definition: operations.h:102
utl::common_impl::__xref< const T >::apply
const U apply
Definition: stl.h:183
utl::common_impl::__common_reference2
Definition: stl.h:248
utl::RegularInvocable
_utlConcept RegularInvocable
Definition: stl.h:756
utl::DefaultConstructible
_utlConcept DefaultConstructible
Definition: stl.h:444
utl::CopyConstructible
_utlConcept CopyConstructible
Definition: stl.h:459
utl::common_impl::__common_ref_< T &, U &&, meta::void_t< __common_ref< T &, const U & >, meta::when< ConvertibleTo< U &&, __common_ref< T &, const U & > > > > >::type
__common_ref< T &, const U & > type
Definition: stl.h:174
utl::remove_cvref_t
std::remove_cv_t< std::remove_reference_t< T > > remove_cvref_t
Definition: stl.h:42
utl::details::is_boolean_t
meta::eval< is_boolean_< B > > is_boolean_t
Definition: stl.h:548
utl::EqualityComparable
_utlConcept EqualityComparable
Definition: stl.h:596
utl::Integral
_utlConcept Integral
Definition: stl.h:340
utl::StrictTotallyOrderedWith
_utlConcept StrictTotallyOrderedWith
Definition: stl.h:706
utl::invoke_result_t
meta::eval< invoke_result< _Callable, _Args... > > invoke_result_t
invoke_result_t (for C++14)
Definition: invoke.h:180
utl::common_impl::__xref
Definition: stl.h:178
utl::MoveConstructible
_utlConcept MoveConstructible
Definition: stl.h:452
utl::details::is_strict_totally_ordered_with_< T, U, meta::void_t< meta::use_if_same_t< bool, decltype(std::declval< cref_< T >>()< std::declval< cref_< U >>())>, meta::use_if_same_t< bool, decltype(std::declval< cref_< T >>() > std::declval< cref_< U >>())>, meta::use_if_same_t< bool, decltype(std::declval< cref_< T >>()<=std::declval< cref_< U >>())>, meta::use_if_same_t< bool, decltype(std::declval< cref_< T >>() >=std::declval< cref_< U >>())>, meta::use_if_same_t< bool, decltype(std::declval< cref_< U >>()< std::declval< cref_< T >>())>, meta::use_if_same_t< bool, decltype(std::declval< cref_< U >>() > std::declval< cref_< T >>())>, meta::use_if_same_t< bool, decltype(std::declval< cref_< U >>()<=std::declval< cref_< T >>())>, meta::use_if_same_t< bool, decltype(std::declval< cref_< U >>() >=std::declval< cref_< T >>())> > >::type
meta::true_ type
Definition: stl.h:697
utl::common_impl::common_reference
Definition: stl.h:222
utl::_ref_t
std::add_lvalue_reference_t< T > _ref_t
Definition: stl.h:48
utl::Movable
_utlConcept Movable
Definition: stl.h:469
utl::UnsignedIntegral
_utlConcept UnsignedIntegral
Definition: stl.h:352
utl::common_impl::__rref_res
std::remove_reference_t< R > && __rref_res
Definition: stl.h:144
utl::common_impl::common_reference_t
meta::eval< common_reference< Ts... > > common_reference_t
Definition: stl.h:227
utl::Boolean
_utlConcept Boolean
Definition: stl.h:551
utl::common_impl::__copy_cv
meta::invoke< __copy_cv_< From >, To > __copy_cv
Definition: stl.h:119
utl::common_impl::__common_reference3
Definition: stl.h:237
utl::Regular
_utlConcept Regular
Definition: stl.h:723
utl::Constructible
_utlConcept Constructible
Definition: stl.h:438
utl::details::is_weakly_equality_comparable_with_t
meta::eval< is_weakly_equality_comparable_with_< T, U > > is_weakly_equality_comparable_with_t
Definition: stl.h:578
utl::common_impl::__copy_cv_
Definition: stl.h:102
utl::common_impl::__common_ref_< T &, U &, meta::void_t< __lref_res< T, U >, meta::when< std::is_reference< __lref_res< T, U > >::value > > >::type
__lref_res< T, U > type
Definition: stl.h:150
utl::meta::invoke
typename Fn::template apply< Args... > invoke
Definition: invoke.h:81
utl::details::is_strict_totally_ordered_with_t
meta::eval< is_strict_totally_ordered_with_< T, U > > is_strict_totally_ordered_with_t
Definition: stl.h:703
utl::details::is_boolean_< B, meta::void_t< meta::use_if_same_t< bool, decltype(!std::declval< cref_< B >>())>, meta::use_if_same_t< bool, decltype(std::declval< cref_< B >>()==std::declval< cref_< B >>())>, meta::use_if_same_t< bool, decltype(std::declval< cref_< B >>() !=std::declval< cref_< B >>())>, meta::use_if_same_t< bool, decltype(std::declval< cref_< B >>() &&std::declval< cref_< B >>())>, meta::use_if_same_t< bool, decltype(std::declval< cref_< B >>()||std::declval< cref_< B >>())> > >::type
meta::true_ type
Definition: stl.h:542
utl::swap
void swap(array< _Tp, _Nm > &lhs, array< _Tp, _Nm > &rhs) noexcept(noexcept(lhs.swap(rhs)))
Definition: array.h:214
utl::common_impl::__basic_common_reference_t
meta::eval< basic_common_reference< remove_cvref_t< T >, remove_cvref_t< U >, __xref< T >::template apply, __xref< U >::template apply > > __basic_common_reference_t
Definition: stl.h:219
utl::Relation
_utlConcept Relation
Definition: stl.h:764
utl::details::is_strict_totally_ordered_with_
Definition: stl.h:682
utl::Arithmetic
_utlConcept Arithmetic
Definition: stl.h:736
utl::common_impl::common_reference< T >::type
T type
Definition: stl.h:232
utl::meta::when
eval< detail::when_< If > > when
Well formed only if If is true.
Definition: sfinae.h:46
utl::common_impl::__common_reference< T, U, meta::when< std::is_reference< T >::value &&std::is_reference< U >::value > >::type
__common_ref< T, U > type
Definition: stl.h:265
utl::details::is_weakly_equality_comparable_with_::type
meta::false_ type
Definition: stl.h:562
utl::SignedIntegral
_utlConcept SignedIntegral
Definition: stl.h:346
impl.h
Implementation detail main forward header.
utl::common_impl::__xref< volatile T >::apply
volatile U apply
Definition: stl.h:187
utl::is_invocable
std::is_invocable trait for C++11
Definition: invoke.h:130
utl::is_swappable_with
std::is_swappable_with is_swappable_with
Definition: stl.h:408