Version: SMASH-3.3
traits.h File Reference
#include <map>
#include <set>
#include <sstream>
#include <string>
#include <type_traits>
#include <vector>
#include "stringify.h"

Go to the source code of this file.

Classes

struct  smash::detail::is_stl_container< T >
 Implementation of the type trait to infer if a type is an STL container. More...
 
struct  smash::detail::is_stl_container< std::vector< Args... > >
 Trait specialization for std::vector. More...
 
struct  smash::detail::is_stl_container< std::set< Args... > >
 Trait specialization for std::set. More...
 
struct  smash::detail::is_stl_container< std::map< Args... > >
 Trait specialization for std::map. More...
 
struct  smash::is_stl_container< T >
 Type trait to infer if a type is an STL container. More...
 
struct  smash::is_tuple_like< T, Enable >
 Type trait to infer if a type is tuple-like (std::pair or std::tuple or std::array or few others). More...
 
struct  smash::is_tuple_like< T, std::void_t< decltype(std::tuple_size< T >::value)> >
 Trait specialization for the case when the type is tuple-like. More...
 
struct  smash::is_map_like< T >
 Type trait to infer if a type is map-like (for the moment only std::map is considered). More...
 
struct  smash::is_map_like< std::map< K, V, Args... > >
 Trait specialization for the case when the type is std::map. More...
 
struct  smash::is_streamable< S, T, Enable >
 Type trait to infer if a type can be streamed via the << operator. More...
 
struct  smash::is_streamable< S, T, std::void_t< decltype(std::declval< S & >()<< std::declval< T >())> >
 Trait specialization for the case when the type is streamable. More...
 
struct  smash::is_writable_to_stream< S, T, Enable >
 Type trait to infer if a type can be written via the << operator, by that not only meaning that an overload exists, but also that possible contained types can be streamed, too. More...
 
struct  smash::is_writable_to_stream< S, T, std::enable_if_t<!is_stl_container_v< T > &&!is_tuple_like_v< T > > >
 Trait specialization for the case in which the type is not a container and not tuple-like. More...
 
struct  smash::is_writable_to_stream< S, T, std::enable_if_t< is_stl_container_v< T > &&!is_map_like_v< T > > >
 Trait specialization for the case in which the type is an STL container, but not map-like. More...
 
struct  smash::is_writable_to_stream< S, T, std::enable_if_t< is_map_like_v< T > > >
 Trait specialization for the case in which the type is map-like. More...
 
struct  smash::is_writable_to_stream< S, T, std::enable_if_t< is_tuple_like_v< T > > >
 Trait specialization for the case in which the type is tuple-like. More...
 
struct  smash::has_to_string< T, Enable >
 Type trait to infer if there is an std::string to_string(T) overload for a given type T. More...
 
struct  smash::has_to_string< T, std::void_t< decltype(smash::to_string(std::declval< T >()))> >
 Trait specialization for the case when the overload is present. More...
 
struct  smash::has_to_string< std::bitset< N >, std::void_t< decltype(smash::to_string(std::declval< std::bitset< N >>()))> >
 Trait specialization for std::bitset types for which a different signature of the overload is required. More...
 

Namespaces

 smash
 
 smash::detail
 specialize a type for all of the STL containers.
 

Variables

template<typename T >
constexpr bool smash::is_stl_container_v = is_stl_container<T>::value
 Helper alias which is common to be defined next to a type trait. More...
 
template<typename T >
constexpr bool smash::is_tuple_like_v = is_tuple_like<T>::value
 Helper alias which is common to be defined next to a type trait. More...
 
template<typename T >
constexpr bool smash::is_map_like_v = is_map_like<std::decay_t<T>>::value
 Helper alias which is common to be defined next to a type trait. More...
 
template<typename S , typename T >
constexpr bool smash::is_streamable_v = is_streamable<S, T>::value
 Helper alias which is common to be defined next to a type trait. More...
 
template<typename S , typename T >
constexpr bool smash::is_writable_to_stream_v
 Helper alias which is common to be defined next to a type trait. More...
 
template<typename T >
constexpr bool smash::has_to_string_v = has_to_string<T>::value
 Helper alias which is always defined next to a type trait. More...