Regina Calculation Engine
|
Helper class to assist with compile-time analysis of Regina's function objects. More...
#include <utilities/registryutils.h>
Helper class to assist with compile-time analysis of Regina's function objects.
For the purposes of this documentation:
void
return type, such as a class with a bracket operator or simply a function reference;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:
Deref::ReturnType
exists), then this class provides the typedef ReturnType, which is identical to Deref::ReturnType
. Otherwise ReturnType is not defined.Deref::ReturnType
does not exist), then this class provides the typedef Void, which is simply void
. Otherwise Void is not defined.