Jpp  18.2.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Static Public Attributes | Static Private Member Functions | List of all members
JStreamAvailable< T > Class Template Reference

Test availability of stream operators. More...

#include <JStreamAvailable.hh>

Static Public Attributes

static const bool has_istream = std::is_same<std::istream&, decltype(is<T>(0))>::value
 true if std::istream& operator>>(std::istream&, T&) is defined; else false More...
 
static const bool has_ostream = std::is_same<std::ostream&, decltype(os<T>(0))>::value
 true if std::ostream& operator<<(std::ostream&, const T&) is defined; else false More...
 

Static Private Member Functions

template<class U >
static auto is (U *) -> decltype(std::declval< std::istream & >() >> std::declval< U & >())
 
template<class U >
static auto os (U *) -> decltype(std::declval< std::ostream & >()<< std::declval< const U & >())
 
template<typename >
static auto is (...) -> std::false_type
 
template<typename >
static auto os (...) -> std::false_type
 

Detailed Description

template<class T>
class JStreamAvailable< T >

Test availability of stream operators.

Author
mdejong

Definition at line 19 of file JStreamAvailable.hh.

Member Function Documentation

template<class T >
template<class U >
static auto JStreamAvailable< T >::is ( U *  ) -> decltype(std::declval< std::istream & >() >> std::declval< U & >())
staticprivate
template<class T >
template<class U >
static auto JStreamAvailable< T >::os ( U *  ) -> decltype(std::declval< std::ostream & >()<< std::declval< const U & >())
staticprivate
template<class T >
template<typename >
static auto JStreamAvailable< T >::is (   ...) -> std::false_type
staticprivate
template<class T >
template<typename >
static auto JStreamAvailable< T >::os (   ...) -> std::false_type
staticprivate

Member Data Documentation

template<class T >
const bool JStreamAvailable< T >::has_istream = std::is_same<std::istream&, decltype(is<T>(0))>::value
static

true if std::istream& operator>>(std::istream&, T&) is defined; else false

Definition at line 28 of file JStreamAvailable.hh.

template<class T >
const bool JStreamAvailable< T >::has_ostream = std::is_same<std::ostream&, decltype(os<T>(0))>::value
static

true if std::ostream& operator<<(std::ostream&, const T&) is defined; else false

Definition at line 29 of file JStreamAvailable.hh.


The documentation for this class was generated from the following file: