Support Class Library
A set of tools providing classes and utility
include
scl
tools
meta
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>
6
#include <
scl/tools/meta/void_t.h
>
7
#include <
scl/tools/meta/exists.h
>
8
#include <
scl/tools/meta/enable_if.h
>
9
#include <
scl/tools/meta/type_mod.h
>
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
(){
31
return
details::__ostream_op_defined<decay_t<T>
>::value;
32
}
33
}
34
}
35
}
scl::tools::meta::void_t
void void_t
The must have.
Definition:
void_t.h:10
scl
Global namespace of the SCL.
Definition:
alias.hpp:3
scl::tools::meta::details::__ostream_op_defined
Definition:
defines_ostream_operator.h:16
scl::tools::meta::defines_ostream_operator
constexpr bool defines_ostream_operator()
Determines whether or not the operator<< is defined for the given type and ostream.
Definition:
defines_ostream_operator.h:30
std
STL namespace.
exists.h
type_mod.h
enable_if.h
void_t.h
Generated by
1.8.13