Regina 7.0 Calculation Engine
Public Types | List of all members
regina::OutputBase< T > Struct Template Reference

Provides a type alias to help identify where in the class hierarchy the output functions T::str() and T::detail() are implemented. More...

#include <core/output.h>

Public Types

using type = typename std::remove_reference< decltype(test(std::declval< T >()))>::type
 The class in which T::str() and T::detail() are implemented. More...
 

Detailed Description

template<class T>
struct regina::OutputBase< T >

Provides a type alias to help identify where in the class hierarchy the output functions T::str() and T::detail() are implemented.

If T is a class derived (directly or indirectly) from some class Output<...>, then OutputBase<T>::type is defined to be this parent class Output<...>. If T is derived from multiple Output<...> classes (like SnapPeaTriangulation is), then this ambiguity will be resolved if possible by prioritising Output<T, ...>.

If T is not derived from any class Output<...>, then OutputBase<T>::type is defined to be T itself.

This helper class can be useful when trying to disambiguate between the implementation of str() that is inherited from Output, versus an extended implementation of str() (perhaps with more arguments) that is implemented in the class T itself.

Precondition
T is a class or struct type.

Member Typedef Documentation

◆ type

template<class T >
using regina::OutputBase< T >::type = typename std::remove_reference< decltype(test(std::declval<T>()))>::type

The class in which T::str() and T::detail() are implemented.

If T is derived from the Output template class, then this type is the corresponding Output<X> base class. Otherwise, this type is T itself.

Note
The implementation of this type alias does not look for str() or detail() at all. Instead, it is based purely on the inheritance condition as stated above.

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

Copyright © 1999-2021, The Regina development team
This software is released under the GNU General Public License, with some additional permissions; see the source code for details.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@maths.uq.edu.au).