VCCC  2024.05
VisualCamp Common C++ library
is_printable.hpp
Go to the documentation of this file.
1 # /*
2 # * Created by YongGyu Lee on 2020/12/08.
3 # */
4 #
5 # ifndef VCCC_TYPE_TRAITS_IS_PRINTABLE_HPP
6 # define VCCC_TYPE_TRAITS_IS_PRINTABLE_HPP
7 #
8 # include <ostream>
9 # include <type_traits>
10 #
12 
13 namespace vccc {
14 
25 template<typename T, typename = void>
26 struct is_printable : std::false_type {};
27 
28 template<typename T>
29 struct is_printable<T, void_t<
30  decltype(std::declval<std::ostream&>() << std::declval<const T&>())
31 >> : std::true_type {};
32 
34 
35 } // namespace vccc
36 
37 # endif // VCCC_TYPE_TRAITS_IS_PRINTABLE_HPP
void void_t
Definition: void_t.hpp:19
Definition: matrix.hpp:495
Definition: directory.h:12
Definition: is_printable.hpp:26