Support Class Library
A set of tools providing classes and utility
toString.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <iostream>
4 #include <string>
5 #include <utility>
6 #include <scl/macros.h>
13 #include <scl/utils/toString.h>
14 
15 
23 template <
24  class T,
25  class T_ = META::decay_t<T>,
27  !(
28  META::is_same<T_, char>()
29  || META::is_same<T_, const char*>()
30  || META::is_same<T_, std::string>()
31  || META::defines_ostream_operator<T_>()
32  ) && scl::tools::meta::defines_scl_to_string<T>()
33  >>
34 >
35 std::ostream& operator<<(std::ostream& os, T&& obj){
36  return os << scl::utils::toString<T_>(std::forward<T>(obj));
37 }
void void_t
The must have.
Definition: void_t.h:10
std::ostream & operator<<(std::ostream &os, T &&obj)
Automatically define the ostream operator<< when scl::utils::ToString is specialized.
Definition: toString.h:35
typename std::enable_if< B, T >::type enable_if_t
An handy type alias for the result of std::enable_if.
Definition: enable_if.h:12