tlx
wrap_unprintable.hpp File Reference
#include <tlx/meta/enable_if.hpp>
#include <ostream>
#include <utility>

Go to the source code of this file.

Classes

struct  has_ostream_operator< typename, typename >
 SFINAE magic helper for wrap_unprintable() More...
 

Namespaces

 tlx
 

Functions

template<typename Type >
struct has_ostream_operator<Type, decltype(std::declval< std::ostream & > ()<< std
 
template<typename Type >
enable_if<!has_ostream_operator<Type >::value, const char * >::type wrap_unprintable (Type, const char *instead="<unprintable>")
 SFINAE magic to return "<unprintable>" instead if the value HAS NO ostream operator << available. More...
 
template<typename Type >
enable_if< has_ostream_operator<Type >::value, Type >::type wrap_unprintable (Type value, const char *=nullptr)
 SFINAE magic to return the value if the value HAS a ostream operator << available. More...
 
template<typename Type >
enable_if<!has_ostream_operator<Type >::value, const char * >::type wrap_unp (Type, const char *instead="<unprintable>")
 SFINAE magic to return "<unprintable>" instead if the value HAS NO ostream operator << available. More...
 
template<typename Type >
enable_if< has_ostream_operator<Type >::value, Type >::type wrap_unp (Type value, const char *=nullptr)
 SFINAE magic to return the value if the value HAS a ostream operator << available. More...