|
kblib 0.2.3
General utilities library for modern C++
|
Contains some type traits not in the standard library that are useful in the implementation of kblib. More...
#include "fakestd.h"#include "tdecl.h"#include <array>#include <cstring>#include <tuple>#include <type_traits>

Go to the source code of this file.
Namespaces | |
| namespace | kblib |
| The main namespace in which all entities from kblib are defined. | |
| namespace | kblib::detail |
| The namespace used for implementation details within kblib. | |
Typedefs | |
| template<typename T > | |
| using | kblib::alias = T |
| A simple identity alias for simplifying some compound type declarations, such as function pointers. More... | |
| template<typename U , typename T > | |
| using | kblib::ignore_t = typename ignore< U, T >::type |
| An alias for ignore<U, T>::type. More... | |
| template<typename T > | |
| using | kblib::class_of_t = typename class_of< T >::type |
| template<typename T > | |
| using | kblib::member_of_t = typename member_of< T >::type |
| template<typename Range > | |
| using | kblib::iterator_type_for_t = typename iterator_type_for< Range >::type |
| template<typename T > | |
| using | kblib::remove_reference_t = typename std::remove_reference< T >::type |
| Abbreviated name for std::remove_reference<T>::type for C++14. More... | |
Functions | |
| 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()> |
| Truncates an array to its first N elements. More... | |
| template<int trim, typename T , int N, typename Indices = std::make_integer_sequence<int, N - trim>> | |
| constexpr auto | kblib::trim_array (const T(&arr)[N]) -> std::array< T, N - trim > |
| Truncates the last trim elements from an array. More... | |
| template<int N, typename Indices = std::make_integer_sequence<int, N - 1>> | |
| constexpr auto | kblib::remove_null_terminator (const char(&arr)[N]) -> std::array< char, N - 1 > |
| Creates an array of only the meaningful characters in a string literal, and not the null terminator. More... | |
| template<typename T , typename F > | |
| auto | kblib::byte_cast (F v) noexcept -> T |
| Creates a T with the same object representation as the given F. More... | |
| template<typename C , typename = decltype(std::declval<C&>().resize(0))> | |
| auto | kblib::detail::calc_resizable (int) noexcept -> std::true_type |
| template<typename > | |
| auto | kblib::detail::calc_resizable (...) noexcept -> std::false_type |
| template<typename C , typename std::enable_if< has_reserve_v< C >, int >::type = 0> | |
| auto | kblib::try_reserve (C &c, std::size_t s) noexcept(noexcept(c.reserve(s))) -> void |
| Attempt to reserve capacity in a container. No-op if unsupported. More... | |
Variables | |
| template<typename... Ts> | |
| KBLIB_CONSTANT_V | kblib::contains_type_v = contains_type<Ts...>::value |
| template<typename... Ts> | |
| KBLIB_CONSTANT_V | kblib::contains_types_v = contains_types<Ts...>::value |
| template<typename C > | |
| KBLIB_CONSTANT_V | kblib::is_resizable_v = decltype(detail::calc_resizable<C>(0))::value |
| template<typename C , typename = void> | |
| KBLIB_CONSTANT_V | kblib::has_reserve_v = false |
| template<typename C , typename = void> | |
| KBLIB_CONSTANT_V | kblib::is_contiguous_v = false |
| Type trait to determine if a container is contiguous. More... | |
| template<typename T > | |
| KBLIB_CONSTANT_V | kblib::is_input_iterator_v = is_input_iterator<T>::value |
| template<typename T > | |
| KBLIB_CONSTANT_V | kblib::is_forward_iterator_v = is_forward_iterator<T>::value |
| template<typename T > | |
| KBLIB_CONSTANT_V | kblib::is_bidirectional_iterator_v = is_bidirectional_iterator<T>::value |
| template<typename T > | |
| KBLIB_CONSTANT_V | kblib::is_random_access_iterator_v = is_random_access_iterator<T>::value |
| template<typename T > | |
| KBLIB_CONSTANT_V | kblib::is_iterable_v = is_iterable<T>::value |
| template<typename T > | |
| KBLIB_CONSTANT_V | kblib::is_iterator_v = is_iterator<T>::value |
| template<typename T > | |
| KBLIB_CONSTANT_V | kblib::is_reference_v = std::is_reference<T>::value |
| Abbreviated name for std::is_reference<T>::value for C++14. More... | |
| template<typename CharT = char> | |
| KBLIB_CONSTANT auto | kblib::eof = std::char_traits<CharT>::eof() |
| Names the EOF value for the given character type in std::char_traits. More... | |
| template<typename T > | |
| KBLIB_CONSTANT_V | kblib::is_aliasing_type_v = is_aliasing_type<T>::value |
Contains some type traits not in the standard library that are useful in the implementation of kblib.
Definition in file traits.h.