Jpp  master_rocky-40-g5f0272dcd
the software that should make you happy
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

◆ is() [1/2]

template<class T >
template<class U >
static auto JStreamAvailable< T >::is ( U *  ) -> decltype(std::declval< std::istream & >() >> std::declval< U & >())
staticprivate

◆ os() [1/2]

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

◆ is() [2/2]

template<class T >
template<typename >
static auto JStreamAvailable< T >::is (   ...) -> std::false_type
staticprivate

◆ os() [2/2]

template<class T >
template<typename >
static auto JStreamAvailable< T >::os (   ...) -> std::false_type
staticprivate

Member Data Documentation

◆ has_istream

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.

◆ has_ostream

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: