UgMisc 0.3
Miscellaneous C++ header library
Loading...
Searching...
No Matches
TypesPrinter< OStream > Class Template Reference

#include <samples/samples_types_printer.hpp>

Public Member Functions

 TypesPrinter (OStream &os)
 TypesPrinter (const TypesPrinter &)=default
 TypesPrinter (TypesPrinter &&)=default
template<class T>
const TypesPrinterprint () const
template<class T>
const TypesPrinterprint (T &&) const
template<class T>
const TypesPrinteroperator() () const

Detailed Description

template<class OStream>
class TypesPrinter< OStream >

The type name is the first of these expressions which is valid:

  • T::sTypeName()
  • T::sTypeName
  • typeid(T).name()` */ template<typename T> inline auto getTypeName() { using Access = _samples::TypeNameAccess; ugmisc::static_member_value<Access, T> value_get;

    return ugmisc::static_member_caller<Access, T>::fallback([&]() { If we are here, Calling sTypeName() failed. So we try to get the value of sTypeName. And finally fall back to typeid(U).name(). return value_get.get([]() { return typeid(T).name(); }); })(); }

/** Prints the list of type parameters, given a type which is itself an instance of a template with those type parameters.

The name of a single type is obtained using getTypeName().

Definition at line 64 of file samples_types_printer.hpp.

Constructor & Destructor Documentation

◆ TypesPrinter()

template<class OStream>
TypesPrinter< OStream >::TypesPrinter ( OStream & os)
inline

Definition at line 129 of file samples_types_printer.hpp.

Member Function Documentation

◆ operator()()

template<class OStream>
template<class T>
const TypesPrinter & TypesPrinter< OStream >::operator() ( ) const
inline

Definition at line 146 of file samples_types_printer.hpp.

◆ print() [1/2]

template<class OStream>
template<class T>
const TypesPrinter & TypesPrinter< OStream >::print ( ) const
inline

Definition at line 134 of file samples_types_printer.hpp.

◆ print() [2/2]

template<class OStream>
template<class T>
const TypesPrinter & TypesPrinter< OStream >::print ( T && ) const
inline

Definition at line 141 of file samples_types_printer.hpp.


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