VCCC  2024.05
VisualCamp Common C++ library
is_string_like.hpp
Go to the documentation of this file.
1 # /*
2 # * Created by YongGyu Lee on 2021/01/22.
3 # */
4 #
5 # ifndef VCCC_TYPE_TRAITS_IS_STRING_LIKE_HPP
6 # define VCCC_TYPE_TRAITS_IS_STRING_LIKE_HPP
7 #
8 # include <type_traits>
9 # include <string>
10 # if __cplusplus > 201402L
11 # include <string_view>
12 # endif
14 
15 namespace vccc {
16 
28 template<typename T>
30  : public std::integral_constant<bool, is_specialization<std::decay_t<T>, std::basic_string>::value
31 # if __cplusplus > 201402L
32  || is_specialization<std::decay_t<T>, std::basic_string_view>::value
33 # endif
34  > {};
35 
36 template<>
37 struct is_string_like<const char*> : public std::true_type {};
38 
39 template<typename T>
41 
43 
44 } // namespace vccc
45 
46 # endif // VCCC_TYPE_TRAITS_IS_STRING_LIKE_HPP
typename is_string_like< T >::type is_string_like_t
Definition: is_string_like.hpp:40
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35
Definition: is_specialization.hpp:30
Definition: is_string_like.hpp:34