Support Class Library
A set of tools providing classes and utility
defines_ostream_operator.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <type_traits>
4 #include <iostream>
5 #include <string>
10 
11 namespace scl{
12  namespace tools{
13  namespace meta{
14  namespace details{
15  template <class T, class = void>
16  struct __ostream_op_defined : std::false_type{};
17 
18  template <class T>
19  struct __ostream_op_defined<T, /*enable_if_t*/void_t<
20  /*exists<*/decltype(operator<<(std::declval<std::ostream&>(), std::declval<const T&>()))/*>()*/
21  >> : std::true_type{};
22  }
23 
29  template <class T>
30  inline constexpr bool defines_ostream_operator(){
32  }
33  }
34  }
35 }
void void_t
The must have.
Definition: void_t.h:10
Global namespace of the SCL.
Definition: alias.hpp:3
constexpr bool defines_ostream_operator()
Determines whether or not the operator<< is defined for the given type and ostream.
STL namespace.