regina::ReturnsTraits< T > Struct Template Reference

Helper class to assist with compile-time analysis of Regina's function objects. More...

`#include <utilities/registryutils.h>`

Inheritance diagram for regina::ReturnsTraits< T >:

## Detailed Description

### template<typename T>
struct regina::ReturnsTraits< T >

Helper class to assist with compile-time analysis of Regina's function objects.

For the purposes of this documentation:

- a void function object is any callable object with a `void` return type, such as a class with a bracket operator or simply a function reference;
- a non-void function object is a callable object that defines a ReturnType typedef, typically of a class derived from Returns<...>.

This helper class can be used to distinguish between void and non-void function objects, and/or (thanks to the C++11 SFINAE mechanism) define some other template function differently according to whether its template argument is a void or non-void function object. See the forCoords() functions in surfaces/coordregistry.h for an example of ReturnsTraits in action.

The template parameter T should either be a function object, or a reference to a function object (both lvalue and rvalue references are recognised). This class provides the following typedefs:

- In all cases, this class provides the typedef Deref, which simply strips any references from T and returns the type of the underlying function object.
- If T represents a non-void function object (i.e., the type `Deref::ReturnType` exists), then this class provides the typedef ReturnType, which is identical to `Deref::ReturnType`. Otherwise ReturnType is not defined.
- If T represents a void function object (i.e., the type `Deref::ReturnType` does not exist), then this class provides the typedef Void, which is simply `void`. Otherwise Void is not defined.

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

- utilities/registryutils.h

Copyright © 1999-2016, 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).