Support Class Library
A set of tools providing classes and utility
Main Page
Related Pages
+
Namespaces
Namespace List
+
Namespace Members
+
All
_
a
c
d
e
f
h
i
l
m
n
o
p
r
s
t
u
v
w
+
Functions
_
a
c
d
e
f
h
i
l
m
n
o
p
r
s
t
u
w
Variables
+
Typedefs
a
c
d
e
f
h
i
l
m
n
r
s
t
u
v
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
~
+
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
~
+
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
+
Typedefs
a
c
d
e
f
g
i
k
l
m
n
o
p
q
r
s
t
v
Related Functions
+
Files
File List
+
File Members
+
All
a
c
d
m
o
r
s
t
v
Functions
+
Macros
a
c
d
m
r
s
t
v
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Friends
Macros
Pages
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