15 #ifndef ARSENALGEAR_TYPE_HPP
16 #define ARSENALGEAR_TYPE_HPP
23 #include <type_traits>
25 #include <string_view>
43 template<
typename S,
typename T,
typename =
void>
47 template<
typename S,
typename T>
48 struct is_streamable <S, T, std::void_t<decltype( std::declval <S&>() <<std::declval<T>() ) > >: std::true_type {};
63 template <typename T, std::size_t N>
64 constexpr bool is_pointer_to_const_char( T(&)[N] )
66 return std::is_same_v <const char, T>;
78 constexpr bool is_pointer_to_const_char( T&& )
80 return std::is_same_v <const char *, T>;
93 constexpr bool is_str( const T& obj )
95 return is_pointer_to_const_char( obj ) || std::is_same_v<T, std::string> || std::is_same_v<T, std::string_view>;
107 template <typename Kind, typename... Kinds>
110 if constexpr ( ( std::is_same_v <Kind, Kinds> || ... ) )
Definition: stream.cpp:22
Struct used to check if a type is a streamable or not, i.e. it has operator << overload or not.
Definition: type.hpp:44