Utopia  2
Framework for studying models of complex & adaptive systems.
Classes | Namespaces | Typedefs | Variables
type_traits.hh File Reference
#include <cmath>
#include <iomanip>
#include <iostream>
#include <limits>
#include <type_traits>
#include <vector>
#include <tuple>
#include <utility>
#include <string>
#include <sstream>
#include <string_view>
#include <boost/hana/ext/std/tuple.hpp>
#include <boost/hana/for_each.hpp>
#include <boost/hana/tuple.hpp>
#include <armadillo>
Include dependency graph for type_traits.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Utopia::Utils::remove_pointer< T, U >
 Helper function for removing pointer qualifiers from a type recursivly This is the recursion base case. More...
 
struct  Utopia::Utils::remove_pointer< T, std::enable_if_t< std::is_pointer_v< T >, std::void_t<> > >
 Helper function for removing pointer qualifiers from a type recursivly Provides a member type definition called 'type' which is equal to T if the first template argument is of type T* or T** or T***... More...
 
struct  Utopia::Utils::remove_pointer< T, std::enable_if_t< std::is_array_v< T >, std::void_t<> > >
 Oveload of remove_pointer metafunction for array types (stack allocated) More...
 
struct  Utopia::Utils::remove_qualifier< T >
 Function for removing the qualifiers from a type T. Qualifiers are 'const', 'volative', pointer, reference or any legal combination thereof. More...
 
struct  Utopia::Utils::is_string< T >
 Check if a type T is a string-like type, i.e. std::basic_string, const char*, char*, or basic_string_view. More...
 
struct  Utopia::Utils::is_string< std::basic_string< Ts... > >
 Overload of is_string for basic_string. More...
 
struct  Utopia::Utils::is_string< std::basic_string_view< Ts... > >
 Overload of is_string for basic_string_view. More...
 
struct  Utopia::Utils::is_string< const char * >
 Overload of is_string for pure const char*. More...
 
struct  Utopia::Utils::is_string< char * >
 Overload of is_string for pure char*. More...
 
struct  Utopia::Utils::is_iterable< T, typename >
 Check if a type T is iterable, i.e., if it defines T::iterable. More...
 
struct  Utopia::Utils::is_iterable< T, std::void_t< typename T::iterator > >
 Check if a type T is iterable, i.e., if it defines T::iterable. More...
 
struct  Utopia::Utils::is_container< T, U >
 Check if a type is a container type, which does not include string types. More...
 
struct  Utopia::Utils::is_container< T, std::void_t< std::enable_if_t< is_iterable_v< remove_qualifier_t< T > > and not is_string_v< remove_qualifier_t< T > >, int > > >
 Check if a type T is a container type. A container for us is every iterable that is not a string. More...
 
struct  Utopia::Utils::is_associative_container< T, typename >
 Check if a type T is an associative container type, i.e. a container type T that defines T::key_type and T::key_compare. Check out https://en.cppreference.com/w/cpp/named_req/AssociativeContainer for more details. More...
 
struct  Utopia::Utils::is_associative_container< T, std::void_t< std::enable_if_t< is_container_v< T >, int >, typename T::key_type, typename T::key_compare > >
 Check if a type T is an associative container type, i.e. a container type T that defines T::key_type and T::key_compare. Check out https://en.cppreference.com/w/cpp/named_req/AssociativeContainer for more details. More...
 
struct  Utopia::Utils::is_unordered_associative_container< T, typename >
 Check if a type T is an unordered associative container type, i.e. a container type T that defines T::key_type, T::value_type and T::hasher. Check out https://en.cppreference.com/w/cpp/named_req/UnorderedAssociativeContainer for more details. More...
 
struct  Utopia::Utils::is_unordered_associative_container< T, std::void_t< std::enable_if_t< is_container_v< T >, int >, typename T::key_type, typename T::value_type, typename T::hasher > >
 Check if a type T is an unordered associative container type, i.e. a container type T that defines T::key_type, T::value_type and T::hasher. Check out https://en.cppreference.com/w/cpp/named_req/UnorderedAssociativeContainer for more details. More...
 
struct  Utopia::Utils::is_linear_container< T, typename >
 Check if a type T is a linear container. A linear container for us is any type T that is a container and neither an associative nor an unordered associative container. More...
 
struct  Utopia::Utils::is_linear_container< T, std::void_t< std::enable_if_t< not is_associative_container_v< T > and not is_unordered_associative_container_v< T > and is_container_v< T >, int > > >
 Check if a type T is a linear container. A linear container for us is any type T that is a container and neither an associative nor an unordered associative container. More...
 
struct  Utopia::Utils::is_random_access_container< T, typename >
 Check if a type T is a random access container, i.e., any container type T that has an iterator tagged with std::random_access_iterator_tag. More...
 
struct  Utopia::Utils::is_random_access_container< T, std::void_t< std::enable_if_t< is_linear_container_v< T > and std::is_convertible_v< typename std::iterator_traits< typename T::iterator >::iterator_category, std::random_access_iterator_tag > > > >
 Check if a type T is a random access container, i.e., any container type T that has an iterator tagged with std::random_access_iterator_tag. More...
 
struct  Utopia::Utils::has_vertex_descriptor< T, U >
 Check if a type T has a vertex descriptor. More...
 
struct  Utopia::Utils::has_vertex_descriptor< T, std::void_t< typename T::vertex_descriptor > >
 Check if a type T has a vertex descriptor. More...
 
struct  Utopia::Utils::has_edge_descriptor< T, U >
 Check if a type T has a edge descriptor. More...
 
struct  Utopia::Utils::has_edge_descriptor< T, std::void_t< typename T::edge_descriptor > >
 Check if a type T has an edge descriptor. More...
 
struct  Utopia::Utils::is_graph< T, U >
 Check if some type T is a graph by checking if it has edge - and vertex_descriptors. More...
 
struct  Utopia::Utils::is_graph< T, std::void_t< std::enable_if_t< has_edge_descriptor_v< T > and has_vertex_descriptor_v< T >, int > > >
 Check if some type T is a graph by checking if it has edge_- and vertex_descriptors. More...
 
struct  Utopia::Utils::get_size< T >
 Return the size of a Type T containing other types at compile time. If no object for which an overload exists is passed, the get_size::value defaults to 1, indicating a scalar. If you want to have another type to be usable with get_size, provide an overload for it as shown by the various overloads existing for get_size already. More...
 
struct  Utopia::Utils::get_size< std::array< T, N > >
 Overload for std::array. More...
 
struct  Utopia::Utils::get_size< std::tuple< Ts... > >
 Overload for std::tuple. More...
 
struct  Utopia::Utils::get_size< std::pair< A, B > >
 Overload for std::pair. More...
 
struct  Utopia::Utils::get_size< boost::hana::tuple< Ts... > >
 Overload for hana tuples. More...
 
struct  Utopia::Utils::get_size< arma::mat::fixed< N, M > >
 overload of get_size for armadillo type More...
 
struct  Utopia::Utils::get_size< arma::imat::fixed< N, M > >
 overload of get_size for armadillo type More...
 
struct  Utopia::Utils::get_size< arma::s32_mat::fixed< N, M > >
 overload of get_size for armadillo type More...
 
struct  Utopia::Utils::get_size< arma::u32_mat::fixed< N, M > >
 overload of get_size for armadillo type More...
 
struct  Utopia::Utils::get_size< arma::umat::fixed< N, M > >
 overload of get_size for armadillo type More...
 
struct  Utopia::Utils::get_size< arma::fmat::fixed< N, M > >
 overload of get_size for armadillo type More...
 
struct  Utopia::Utils::get_size< arma::vec::fixed< N > >
 overload of get_size for armadillo type More...
 
struct  Utopia::Utils::get_size< arma::ivec::fixed< N > >
 overload of get_size for armadillo type More...
 
struct  Utopia::Utils::get_size< arma::s32_vec::fixed< N > >
 overload of get_size for armadillo type More...
 
struct  Utopia::Utils::get_size< arma::uvec::fixed< N > >
 overload of get_size for armadillo type More...
 
struct  Utopia::Utils::get_size< arma::u32_vec::fixed< N > >
 overload of get_size for armadillo type More...
 
struct  Utopia::Utils::get_size< arma::fvec::fixed< N > >
 overload of get_size for armadillo type More...
 
struct  Utopia::Utils::get_size< arma::rowvec::fixed< N > >
 overload of get_size for armadillo type More...
 
struct  Utopia::Utils::get_size< arma::irowvec::fixed< N > >
 overload of get_size for armadillo type More...
 
struct  Utopia::Utils::get_size< arma::s32_rowvec::fixed< N > >
 overload of get_size for armadillo type More...
 
struct  Utopia::Utils::get_size< arma::u32_rowvec::fixed< N > >
 overload of get_size for armadillo type More...
 
struct  Utopia::Utils::get_size< arma::urowvec::fixed< N > >
 overload of get_size for armadillo type More...
 
struct  Utopia::Utils::get_size< arma::frowvec::fixed< N > >
 overload of get_size for armadillo type More...
 
struct  Utopia::Utils::is_array_like< T, U >
 Check if a given type is homogeneous and has a size which is a compile time constant. The most common type which fulfils these requirements is std::array, hence the name 'is_array_like'. For a new type to be considered array_like, this functor has to be overloaded together with get_size. More...
 
struct  Utopia::Utils::has_static_size_base< T, s >
 Determine if type T is 'tuplelike'. This is not intended to be used explicitly, refer to 'has_static_size', which serves this purpose. More...
 
struct  Utopia::Utils::has_static_size< T >
 Determine if type T is tuple_like, i.e., has a compile time constant size which is smaller than std::numeric_limits< std::size_t >::max() = 18446744073709551615. This size is unreasonable and hence used to check invalidity. More...
 
class  Utopia::Utils::is_callable< T, X >
 Check if a type T is callable, i.e., if it has. More...
 
class  Utopia::Utils::is_callable< T, std::void_t< std::enable_if_t< std::is_class_v< std::decay_t< T > >, T > > >
 Determines if the type T implements a call operator with arbitrary signature. More...
 
struct  Utopia::Utils::is_callable< T, std::void_t< std::enable_if_t< std::is_class_v< std::decay_t< T > >, T > > >::Fallback
 
struct  Utopia::Utils::is_callable< T, std::void_t< std::enable_if_t< std::is_class_v< std::decay_t< T > >, T > > >::Derived
 
struct  Utopia::Utils::Nothing
 Represent a type that does nothing and represents nothing, hence can be used in metaprogramming whenever no action is desired. More...
 

Namespaces

 Utopia
 
 Utopia::Utils
 

Typedefs

template<typename T >
using Utopia::Utils::remove_pointer_t = typename remove_pointer< T >::type
 Shorthand for 'typename remove_pointer<T>::type'. More...
 
template<typename T >
using Utopia::Utils::remove_qualifier_t = typename remove_qualifier< T >::type
 Shorthand for 'typename remove_qualifier::value'. More...
 

Variables

template<typename T >
constexpr bool Utopia::Utils::is_string_v = is_string< T >::value
 Shorthand for 'is_string<T>::value'. More...
 
template<typename T >
constexpr bool Utopia::Utils::is_iterable_v = is_iterable< T >::value
 shorthand for is_iterable<T>::value More...
 
template<typename T >
constexpr bool Utopia::Utils::is_container_v = is_container< T >::value
 Shorthand for 'is_container::value. More...
 
template<typename T >
constexpr bool Utopia::Utils::is_associative_container_v
 Shorthand for is_associative_container<T>::value. More...
 
template<typename T >
constexpr bool Utopia::Utils::is_unordered_associative_container_v
 Shorthand for is_unordered_associative_container<T>::value. More...
 
template<typename T >
constexpr bool Utopia::Utils::is_linear_container_v = is_linear_container< T >::value
 Shorthand for is_linear_container<T>::value. More...
 
template<typename T >
constexpr bool Utopia::Utils::is_random_access_container_v
 shorthand for is_linear_container<T>::value More...
 
template<typename T >
constexpr bool Utopia::Utils::has_vertex_descriptor_v
 Shorthand for has_vertex_descriptor<T>::value. More...
 
template<typename T >
constexpr bool Utopia::Utils::has_edge_descriptor_v = has_edge_descriptor< T >::value
 shothand for has_edge_descriptor<T>::value More...
 
template<typename T >
constexpr bool Utopia::Utils::is_graph_v = is_graph< T >::value
 Shorthand for is_graph<T>::value. More...
 
template<typename T >
constexpr std::size_t Utopia::Utils::get_size_v = get_size< T >::value
 
template<typename T >
constexpr bool Utopia::Utils::is_array_like_v = is_array_like< T >::value
 Shorthand for is_array_like<T>::value. More...
 
template<typename T >
constexpr bool Utopia::Utils::has_static_size_v = has_static_size< T >::value
 Shorthand for has_static_size::value. More...
 
template<typename T >
constexpr bool Utopia::Utils::is_callable_v = is_callable< T >::value
 Shorthand for is_callable<T>::value. More...