M5Utility 0.0.2 git rev:5c1a751
Loading...
Searching...
No Matches
m5::stl::detail Namespace Reference

\exclude More...

Classes

struct  conjunction
 
struct  conjunction< B >
 
struct  conjunction< B, Bs... >
 
struct  default_constructor_tag
 
struct  expected_copy_assign_base
 
struct  expected_copy_assign_base< T, E, false >
 
struct  expected_copy_base
 
struct  expected_copy_base< T, E, false >
 
struct  expected_default_ctor_base
 
struct  expected_default_ctor_base< T, E, false >
 
struct  expected_delete_assign_base
 
struct  expected_delete_assign_base< T, E, false, false >
 
struct  expected_delete_assign_base< T, E, false, true >
 
struct  expected_delete_assign_base< T, E, true, false >
 
struct  expected_delete_ctor_base
 
struct  expected_delete_ctor_base< T, E, false, false >
 
struct  expected_delete_ctor_base< T, E, false, true >
 
struct  expected_delete_ctor_base< T, E, true, false >
 
struct  expected_move_assign_base
 
struct  expected_move_assign_base< T, E, false >
 
struct  expected_move_base
 
struct  expected_move_base< T, E, false >
 
struct  expected_operations_base
 
struct  expected_operations_base< void, E >
 
struct  expected_storage_base
 
struct  expected_storage_base< T, E, false, true >
 
struct  expected_storage_base< T, E, true, false >
 
struct  expected_storage_base< T, E, true, true >
 
struct  expected_storage_base< void, E, false, false >
 
struct  expected_storage_base< void, E, false, true >
 
struct  i_am_secret
 
struct  invoke_result_impl
 
struct  invoke_result_impl< F, decltype(detail::invoke(std::declval< F >(), std::declval< Us >()...), void()), Us... >
 
struct  is_expected_impl
 
struct  is_expected_impl< expected< T, E > >
 
struct  is_nothrow_swappable
 
struct  is_optional_impl
 
struct  is_optional_impl< optional< T > >
 
struct  is_swappable
 
struct  is_swappable< T[N], T[N]>
 
struct  no_init_t
 
struct  optional_copy_assign_base
 
struct  optional_copy_assign_base< T, false >
 
struct  optional_copy_base
 
struct  optional_copy_base< T, false >
 
struct  optional_delete_assign_base
 
struct  optional_delete_assign_base< T, false, false >
 
struct  optional_delete_assign_base< T, false, true >
 
struct  optional_delete_assign_base< T, true, false >
 
struct  optional_delete_ctor_base
 
struct  optional_delete_ctor_base< T, false, false >
 
struct  optional_delete_ctor_base< T, false, true >
 
struct  optional_delete_ctor_base< T, true, false >
 
struct  optional_move_assign_base
 
struct  optional_move_assign_base< T, false >
 
struct  optional_move_base
 
struct  optional_move_base< T, false >
 
struct  optional_operations_base
 
struct  optional_storage_base
 
struct  optional_storage_base< T, true >
 
struct  returns_void_impl
 
struct  returns_void_impl< F, void_t< invoke_result_t< F, U... > >, U... >
 
struct  TC
 
struct  voider
 

Typedefs

template<class T >
using remove_const_t = typename std::remove_const<T>::type
 
template<class T >
using remove_reference_t = typename std::remove_reference<T>::type
 
template<class T >
using decay_t = typename std::decay<T>::type
 
template<bool E, class T = void>
using enable_if_t = typename std::enable_if<E, T>::type
 
template<bool B, class T , class F >
using conditional_t = typename std::conditional<B, T, F>::type
 
template<class F , class... Us>
using invoke_result = invoke_result_impl<F, void, Us...>
 
template<class F , class... Us>
using invoke_result_t = typename invoke_result<F, Us...>::type
 
template<class T >
using is_expected = is_expected_impl<decay_t<T>>
 
template<class T , class E , class U >
using expected_enable_forward_value
 
template<class T , class E , class U , class G , class UR , class GR >
using expected_enable_from_other
 
template<class T , class U >
using is_void_or = conditional_t<std::is_void<T>::value, std::true_type, U>
 
template<class T >
using is_copy_constructible_or_void = is_void_or<T, std::is_copy_constructible<T>>
 
template<class T >
using is_move_constructible_or_void = is_void_or<T, std::is_move_constructible<T>>
 
template<class T >
using is_copy_assignable_or_void = is_void_or<T, std::is_copy_assignable<T>>
 
template<class T >
using is_move_assignable_or_void = is_void_or<T, std::is_move_assignable<T>>
 
template<class Exp >
using exp_t = typename detail::decay_t<Exp>::value_type
 
template<class Exp >
using err_t = typename detail::decay_t<Exp>::error_type
 
template<class Exp , class Ret >
using ret_t = expected<Ret, err_t<Exp>>
 
template<class... Ts>
using void_t = typename voider<Ts...>::type
 
template<class T >
using is_optional = is_optional_impl<decay_t<T>>
 
template<class U >
using fixup_void = conditional_t<std::is_void<U>::value, monostate, U>
 
template<class F , class U , class = invoke_result_t<F, U>>
using get_map_return = optional<fixup_void<invoke_result_t<F, U>>>
 
template<class F , class... U>
using returns_void = returns_void_impl<F, void, U...>
 
template<class T , class... U>
using enable_if_ret_void = enable_if_t<returns_void<T &&, U...>::value>
 
template<class T , class... U>
using disable_if_ret_void = enable_if_t<!returns_void<T &&, U...>::value>
 
template<class T , class U >
using enable_forward_value
 
template<class T , class U , class Other >
using enable_from_other
 
template<class T , class U >
using enable_assign_forward
 
template<class T , class U , class Other >
using enable_assign_from_other
 

Functions

template<typename E >
TL_EXPECTED_11_CONSTEXPR void throw_exception (E &&e)
 
template<typename Fn , typename... Args, typename = enable_if_t<std::is_member_pointer<decay_t<Fn>>::value>, int = 0>
constexpr auto invoke (Fn &&f, Args &&...args) noexcept(noexcept(std::mem_fn(f)(std::forward< Args >(args)...))) -> decltype(std::mem_fn(f)(std::forward< Args >(args)...))
 
template<typename Fn , typename... Args, typename = enable_if_t<!std::is_member_pointer<decay_t<Fn>>::value>>
constexpr auto invoke (Fn &&f, Args &&...args) noexcept(noexcept(std::forward< Fn >(f)(std::forward< Args >(args)...))) -> decltype(std::forward< Fn >(f)(std::forward< Args >(args)...))
 
template<class Exp , class F , class Ret = decltype(detail::invoke(std::declval<F>(), *std::declval<Exp>())), detail::enable_if_t<!std::is_void< exp_t< Exp > >::value > * = nullptr>
auto and_then_impl (Exp &&exp, F &&f) -> Ret
 
template<class Exp , class F , class Ret = decltype(detail::invoke(std::declval<F>())), detail::enable_if_t< std::is_void< exp_t< Exp > >::value > * = nullptr>
constexpr auto and_then_impl (Exp &&exp, F &&f) -> Ret
 
template<class Exp , class F , detail::enable_if_t<!std::is_void< exp_t< Exp > >::value > * = nullptr, class Ret = decltype(detail::invoke(std::declval<F>(), *std::declval<Exp>())), detail::enable_if_t<!std::is_void< Ret >::value > * = nullptr>
constexpr auto expected_map_impl (Exp &&exp, F &&f) -> ret_t< Exp, detail::decay_t< Ret > >
 
template<class Exp , class F , detail::enable_if_t<!std::is_void< exp_t< Exp > >::value > * = nullptr, class Ret = decltype(detail::invoke(std::declval<F>(), *std::declval<Exp>())), detail::enable_if_t< std::is_void< Ret >::value > * = nullptr>
auto expected_map_impl (Exp &&exp, F &&f) -> expected< void, err_t< Exp > >
 
template<class Exp , class F , detail::enable_if_t<!std::is_void< exp_t< Exp > >::value > * = nullptr, class Ret = decltype(detail::invoke(std::declval<F>(), std::declval<Exp>().error())), detail::enable_if_t<!std::is_void< Ret >::value > * = nullptr>
constexpr auto map_error_impl (Exp &&exp, F &&f) -> expected< exp_t< Exp >, detail::decay_t< Ret > >
 
template<class Exp , class F , detail::enable_if_t<!std::is_void< exp_t< Exp > >::value > * = nullptr, class Ret = decltype(detail::invoke(std::declval<F>(), std::declval<Exp>().error())), detail::enable_if_t< std::is_void< Ret >::value > * = nullptr>
auto map_error_impl (Exp &&exp, F &&f) -> expected< exp_t< Exp >, monostate >
 
template<class Exp , class F , class Ret = decltype(detail::invoke(std::declval<F>(), std::declval<Exp>().error())), detail::enable_if_t<!std::is_void< Ret >::value > * = nullptr>
auto or_else_impl (Exp &&exp, F &&f) -> Ret
 
template<class Exp , class F , class Ret = decltype(detail::invoke(std::declval<F>(), std::declval<Exp>().error())), detail::enable_if_t< std::is_void< Ret >::value > * = nullptr>
detail::decay_t< Exp > or_else_impl (Exp &&exp, F &&f)
 
template<class Opt , class F , class Ret = decltype(detail::invoke(std::declval<F>(), *std::declval<Opt>())), detail::enable_if_t<!std::is_void< Ret >::value > * = nullptr>
constexpr auto optional_map_impl (Opt &&opt, F &&f) -> optional< Ret >
 
template<class Opt , class F , class Ret = decltype(detail::invoke(std::declval<F>(), *std::declval<Opt>())), detail::enable_if_t< std::is_void< Ret >::value > * = nullptr>
auto optional_map_impl (Opt &&opt, F &&f) -> optional< monostate >
 

Detailed Description

\exclude

Typedef Documentation

◆ enable_assign_forward

template<class T , class U >
using m5::stl::detail::enable_assign_forward
Initial value:
detail::enable_if_t<!std::is_same<optional<T>, detail::decay_t<U>>::value &&
!detail::conjunction<std::is_scalar<T>, std::is_same<T, detail::decay_t<U>>>::value &&
std::is_constructible<T, U>::value && std::is_assignable<T &, U>::value>

◆ enable_assign_from_other

template<class T , class U , class Other >
using m5::stl::detail::enable_assign_from_other
Initial value:
detail::enable_if_t<
std::is_constructible<T, Other>::value && std::is_assignable<T &, Other>::value &&
!std::is_constructible<T, optional<U> &>::value && !std::is_constructible<T, optional<U> &&>::value &&
!std::is_constructible<T, const optional<U> &>::value && !std::is_constructible<T, const optional<U> &&>::value &&
!std::is_convertible<optional<U> &, T>::value && !std::is_convertible<optional<U> &&, T>::value &&
!std::is_convertible<const optional<U> &, T>::value && !std::is_convertible<const optional<U> &&, T>::value &&
!std::is_assignable<T &, optional<U> &>::value && !std::is_assignable<T &, optional<U> &&>::value &&
!std::is_assignable<T &, const optional<U> &>::value && !std::is_assignable<T &, const optional<U> &&>::value>

◆ enable_forward_value

template<class T , class U >
using m5::stl::detail::enable_forward_value
Initial value:
detail::enable_if_t<std::is_constructible<T, U &&>::value && !std::is_same<detail::decay_t<U>, in_place_t>::value &&
!std::is_same<optional<T>, detail::decay_t<U>>::value>

◆ enable_from_other

template<class T , class U , class Other >
using m5::stl::detail::enable_from_other
Initial value:
detail::enable_if_t<
std::is_constructible<T, Other>::value && !std::is_constructible<T, optional<U> &>::value &&
!std::is_constructible<T, optional<U> &&>::value && !std::is_constructible<T, const optional<U> &>::value &&
!std::is_constructible<T, const optional<U> &&>::value && !std::is_convertible<optional<U> &, T>::value &&
!std::is_convertible<optional<U> &&, T>::value && !std::is_convertible<const optional<U> &, T>::value &&
!std::is_convertible<const optional<U> &&, T>::value>

◆ expected_enable_forward_value

template<class T , class E , class U >
using m5::stl::detail::expected_enable_forward_value
Initial value:
detail::enable_if_t<std::is_constructible<T, U &&>::value && !std::is_same<detail::decay_t<U>, in_place_t>::value &&
!std::is_same<expected<T, E>, detail::decay_t<U>>::value &&
!std::is_same<unexpected<E>, detail::decay_t<U>>::value>

◆ expected_enable_from_other

template<class T , class E , class U , class G , class UR , class GR >
using m5::stl::detail::expected_enable_from_other
Initial value:
detail::enable_if_t<
std::is_constructible<T, UR>::value && std::is_constructible<E, GR>::value &&
!std::is_constructible<T, expected<U, G> &>::value && !std::is_constructible<T, expected<U, G> &&>::value &&
!std::is_constructible<T, const expected<U, G> &>::value &&
!std::is_constructible<T, const expected<U, G> &&>::value && !std::is_convertible<expected<U, G> &, T>::value &&
!std::is_convertible<expected<U, G> &&, T>::value && !std::is_convertible<const expected<U, G> &, T>::value &&
!std::is_convertible<const expected<U, G> &&, T>::value>