kblib 0.2.3
General utilities library for modern C++
kblib::detail Namespace Reference

The namespace used for implementation details within kblib. More...

Classes

struct  apply_impl
 
struct  arithmetic_type
 Filter only arithmetic types. More...
 
struct  arithmetic_type< T, true >
 Filter only arithmetic types. More...
 
struct  buildiota_impl
 
struct  buildiota_impl< Array, false >
 
struct  buildiota_impl< construct_with_size< Container, N >, false >
 
struct  buildiota_impl< Container, true >
 
struct  filter_signed
 
struct  filter_signed< N, true >
 
struct  filter_unsigned
 
struct  filter_unsigned< N, true >
 
struct  next_larger_signed
 
struct  no_dangle
 
struct  no_dangle< T && >
 
struct  node
 
struct  pointer
 
struct  pointer< D, T, void_t< typename D::pointer > >
 
struct  str_type
 Converts arithmetic types to strings, but provides the identity transformation for all other types. More...
 
struct  str_type< char, char >
 Override for char to avoid conversion to integer. More...
 
struct  str_type< char16_t, char16_t >
 Override for char16_t to avoid conversion to integer. More...
 
struct  str_type< char32_t, char32_t >
 Override for char32_t to avoid conversion to integer. More...
 
struct  str_type< T, void >
 Performs a natural conversion to a stringlike type. More...
 
struct  str_type< wchar_t, wchar_t >
 Override for wchar_t to avoid conversion to integer. More...
 
struct  tag
 
struct  tuple_type
 Given a std::variant T, provides the member type which is a tuple of the same types. More...
 
struct  tuple_type< std::variant< Ts... > >
 Given a std::variant T, provides the member type which is a tuple of the same types. More...
 
struct  type_list
 
struct  type_map
 
struct  type_map_el
 
struct  value
 
struct  values
 
struct  values< std::index_sequence< Idxs... >, Ts... >
 

Typedefs

template<typename N >
using make_smap_el = type_map_el< static_cast< std::intmax_t >(msb_possible< N >()), N >
 
template<typename N >
using filter_signed_t = typename filter_signed< N >::type
 
template<typename N >
using filter_unsigned_t = typename filter_unsigned< N >::type
 
template<typename T >
using arithmetic_type_t = typename arithmetic_type< T >::type
 Equivalent to typename arithmetic_type<T>::type. More...
 
template<typename T >
using str_type_t = typename str_type< T >::type
 Provides the natural stringlike type for representing a T. More...
 
template<typename T >
using no_dangle_t = typename no_dangle< T >::type
 
template<typename T >
using tuple_type_t = typename tuple_type< T >::type
 

Functions

template<typename F , typename... Args, enable_if_t< not std::is_member_pointer< remove_cvref_t< F > >::value, int > = 0>
constexpr auto do_invoke (F &&f, Args &&... args) noexcept(noexcept(std::forward< F >(f)(std::forward< Args >(args)...))) -> decltype(auto)
 
template<typename F , typename Object , typename... Args, enable_if_t< not std::is_pointer< remove_cvref_t< Object > >::value and std::is_member_function_pointer< F >::value, int > = 0>
constexpr auto do_invoke (F f, Object &&obj, Args &&... args) noexcept(noexcept((std::forward< Object >(obj).*f)(std::forward< Args >(args)...))) -> decltype(auto)
 
template<typename F , typename Pointer , typename... Args, enable_if_t< std::is_pointer< Pointer >::value and std::is_member_function_pointer< F >::value, int > = 0>
constexpr auto do_invoke (F f, Pointer ptr, Args &&... args) noexcept(noexcept((ptr-> *f)(std::forward< Args >(args)...))) -> decltype(auto)
 
template<typename Member , typename Object , enable_if_t< not std::is_pointer< remove_cvref_t< Object > >::value and std::is_member_object_pointer< Member >::value, int > = 0>
constexpr auto do_invoke (Member mem, Object &&obj) noexcept -> decltype(auto)
 
template<typename Member , typename Pointer , enable_if_t< std::is_pointer< Pointer >::value and std::is_member_object_pointer< Member >::value, int > = 0>
constexpr auto do_invoke (Member mem, Pointer ptr) noexcept -> decltype(auto)
 
template<typename... Ts>
constexpr auto ignore (Ts &&...) noexcept -> void
 
template<typename T , std::size_t... Is>
constexpr auto swap_tuple_impl (T &a, T &b, std::index_sequence< Is... >) noexcept(noexcept(ignore(((void) swap(std::get< Is >(a), std::get< Is >(b)), 0)...))) -> void
 
constexpr auto msb (std::uintmax_t x) -> std::uintmax_t
 
template<typename Num >
constexpr auto msb_possible () -> Num
 
template<typename string , typename... S, std::size_t... I>
auto concat_impl (std::index_sequence< I... >, S &&... ins) -> string
 
template<typename CharT >
auto to_int_type (CharT ch)
 
template<typename CharT , typename IntT >
auto to_char_type (IntT ch)
 
auto tolower (char ch)
 
auto towlower (wchar_t ch)
 
auto toupper (char ch)
 
auto towupper (wchar_t ch)
 
constexpr auto get_hash_order () -> endian
 
template<typename T , int N, int... I>
constexpr auto trim_array (const T(&arr)[N], std::integer_sequence< int, I... >) -> std::array< T, std::integer_sequence< int, I... >::size()>
 Truncates an array to its first N elements. More...
 
template<typename C , typename = decltype(std::declval<C&>().resize(0))>
auto calc_resizable (int) noexcept -> std::true_type
 
template<typename >
auto calc_resizable (...) noexcept -> std::false_type
 
template<typename Variant , typename F , std::size_t... Is>
constexpr auto indexed_visitor_impl (std::index_sequence< Is... >) -> auto
 Generates an array of function pointers which will unwrap the variant and pass the index to the function. More...
 
template<typename V , typename F , std::size_t I, std::size_t... Is>
constexpr decltype(auto) visit_impl (V &&v, F &&f, std::index_sequence< I, Is... >)
 
template<typename V , typename F , std::size_t I, std::size_t... Is>
constexpr void visit_nop_impl (V &&v, F &&f, std::index_sequence< I, Is... >)
 

Variables

template<typename T >
constexpr std::intmax_t max_val = std::numeric_limits<T>::max()
 
template<typename F , typename... Ts>
constexpr bool invocable_with_all_v = (ignore_t<std::invoke_result_t<F, Ts>, std::true_type>::value and ...)
 
template<typename Callable , typename Variant >
constexpr bool v_invocable_with_all_v = false
 

Detailed Description

The namespace used for implementation details within kblib.

Typedef Documentation

◆ arithmetic_type_t

template<typename T >
using kblib::detail::arithmetic_type_t = typedef typename arithmetic_type<T>::type

Equivalent to typename arithmetic_type<T>::type.

Definition at line 104 of file stringops.h.

◆ filter_signed_t

template<typename N >
using kblib::detail::filter_signed_t = typedef typename filter_signed<N>::type

Definition at line 821 of file fakestd.h.

◆ filter_unsigned_t

template<typename N >
using kblib::detail::filter_unsigned_t = typedef typename filter_unsigned<N>::type

Definition at line 832 of file fakestd.h.

◆ make_smap_el

template<typename N >
using kblib::detail::make_smap_el = typedef type_map_el<static_cast<std::intmax_t>(msb_possible<N>()), N>

Definition at line 789 of file fakestd.h.

◆ no_dangle_t

template<typename T >
using kblib::detail::no_dangle_t = typedef typename no_dangle<T>::type

Definition at line 191 of file tdecl.h.

◆ str_type_t

template<typename T >
using kblib::detail::str_type_t = typedef typename str_type<T>::type

Provides the natural stringlike type for representing a T.

Definition at line 204 of file stringops.h.

◆ tuple_type_t

template<typename T >
using kblib::detail::tuple_type_t = typedef typename tuple_type<T>::type

Equivalent to typename tuple_type<T>::type

Definition at line 136 of file variant.h.

Function Documentation

◆ calc_resizable() [1/2]

template<typename >
auto kblib::detail::calc_resizable (   ...) -> std::false_type
noexcept

◆ calc_resizable() [2/2]

template<typename C , typename = decltype(std::declval<C&>().resize(0))>
auto kblib::detail::calc_resizable ( int  ) -> std::true_type
noexcept

◆ concat_impl()

template<typename string , typename... S, std::size_t... I>
auto kblib::detail::concat_impl ( std::index_sequence< I... >  ,
S &&...  ins 
) -> string

Definition at line 279 of file stringops.h.

◆ do_invoke() [1/5]

template<typename F , typename... Args, enable_if_t< not std::is_member_pointer< remove_cvref_t< F > >::value, int > = 0>
constexpr auto kblib::detail::do_invoke ( F &&  f,
Args &&...  args 
) -> decltype(auto)
constexprnoexcept

Definition at line 87 of file fakestd.h.

◆ do_invoke() [2/5]

template<typename F , typename Object , typename... Args, enable_if_t< not std::is_pointer< remove_cvref_t< Object > >::value and std::is_member_function_pointer< F >::value, int > = 0>
constexpr auto kblib::detail::do_invoke ( f,
Object &&  obj,
Args &&...  args 
) -> decltype(auto)
constexprnoexcept

Definition at line 96 of file fakestd.h.

◆ do_invoke() [3/5]

template<typename F , typename Pointer , typename... Args, enable_if_t< std::is_pointer< Pointer >::value and std::is_member_function_pointer< F >::value, int > = 0>
constexpr auto kblib::detail::do_invoke ( f,
Pointer  ptr,
Args &&...  args 
) -> decltype(auto)
constexprnoexcept

Definition at line 106 of file fakestd.h.

◆ do_invoke() [4/5]

template<typename Member , typename Object , enable_if_t< not std::is_pointer< remove_cvref_t< Object > >::value and std::is_member_object_pointer< Member >::value, int > = 0>
constexpr auto kblib::detail::do_invoke ( Member  mem,
Object &&  obj 
) -> decltype(auto)
constexprnoexcept

Definition at line 115 of file fakestd.h.

◆ do_invoke() [5/5]

template<typename Member , typename Pointer , enable_if_t< std::is_pointer< Pointer >::value and std::is_member_object_pointer< Member >::value, int > = 0>
constexpr auto kblib::detail::do_invoke ( Member  mem,
Pointer  ptr 
) -> decltype(auto)
constexprnoexcept

Definition at line 124 of file fakestd.h.

◆ get_hash_order()

constexpr auto kblib::detail::get_hash_order ( ) -> endian
constexpr

Definition at line 215 of file tdecl.h.

◆ ignore()

template<typename... Ts>
constexpr auto kblib::detail::ignore ( Ts &&  ...) -> void
constexprnoexcept

Definition at line 646 of file fakestd.h.

◆ indexed_visitor_impl()

template<typename Variant , typename F , std::size_t... Is>
constexpr auto kblib::detail::indexed_visitor_impl ( std::index_sequence< Is... >  ) -> auto
constexpr

Generates an array of function pointers which will unwrap the variant and pass the index to the function.

Definition at line 143 of file variant.h.

◆ msb()

constexpr auto kblib::detail::msb ( std::uintmax_t  x) -> std::uintmax_t
constexpr

Definition at line 732 of file fakestd.h.

◆ msb_possible()

template<typename Num >
constexpr auto kblib::detail::msb_possible ( ) -> Num
constexpr

Definition at line 743 of file fakestd.h.

◆ swap_tuple_impl()

template<typename T , std::size_t... Is>
constexpr auto kblib::detail::swap_tuple_impl ( T &  a,
T &  b,
std::index_sequence< Is... >   
) -> void
constexprnoexcept

Definition at line 650 of file fakestd.h.

◆ to_char_type()

template<typename CharT , typename IntT >
auto kblib::detail::to_char_type ( IntT  ch)
inline

Definition at line 564 of file stringops.h.

◆ to_int_type()

template<typename CharT >
auto kblib::detail::to_int_type ( CharT  ch)
inline

Definition at line 560 of file stringops.h.

◆ tolower()

auto kblib::detail::tolower ( char  ch)
inline

Definition at line 568 of file stringops.h.

◆ toupper()

auto kblib::detail::toupper ( char  ch)
inline

Definition at line 576 of file stringops.h.

◆ towlower()

auto kblib::detail::towlower ( wchar_t  ch)
inline

Definition at line 572 of file stringops.h.

◆ towupper()

auto kblib::detail::towupper ( wchar_t  ch)
inline

Definition at line 580 of file stringops.h.

◆ trim_array()

template<typename T , int N, int... I>
constexpr auto kblib::detail::trim_array ( const T(&)  arr[N],
std::integer_sequence< int, I... >   
) -> std::array<T, std::integer_sequence<int, I...>::size()>
constexpr

Truncates an array to its first N elements.

Parameters
arrAn array of at least N elements to truncate.
IsAn implementation detail.
Returns
std::array<T, Is.size()> An array consisting of the first N elements of arr.

Definition at line 105 of file traits.h.

◆ visit_impl()

template<typename V , typename F , std::size_t I, std::size_t... Is>
constexpr decltype(auto) kblib::detail::visit_impl ( V &&  v,
F &&  f,
std::index_sequence< I, Is... >   
)
constexpr

Definition at line 261 of file variant.h.

◆ visit_nop_impl()

template<typename V , typename F , std::size_t I, std::size_t... Is>
constexpr void kblib::detail::visit_nop_impl ( V &&  v,
F &&  f,
std::index_sequence< I, Is... >   
)
constexpr

Definition at line 276 of file variant.h.

Variable Documentation

◆ invocable_with_all_v

template<typename F , typename... Ts>
constexpr bool kblib::detail::invocable_with_all_v = (ignore_t<std::invoke_result_t<F, Ts>, std::true_type>::value and ...)
constexpr

Definition at line 230 of file variant.h.

◆ max_val

template<typename T >
constexpr std::intmax_t kblib::detail::max_val = std::numeric_limits<T>::max()
constexpr

Definition at line 730 of file fakestd.h.

◆ v_invocable_with_all_v

template<typename Callable , typename Variant >
constexpr bool kblib::detail::v_invocable_with_all_v< F, const std::variant< Ts... > && > = false
constexpr

Definition at line 234 of file variant.h.