Regina 7.3 Calculation Engine
Public Attributes | List of all members
regina::EnableIf< condition, T, defaultValue > Struct Template Reference

A struct that holds either a single value of type T or nothing at all, depending on whether the given compile-time condition holds. More...

#include <utilities/typeutils.h>

Public Attributes

value { defaultValue }
 The data member to store if condition is true. More...
 

Detailed Description

template<bool condition, typename T, T defaultValue>
struct regina::EnableIf< condition, T, defaultValue >

A struct that holds either a single value of type T or nothing at all, depending on whether the given compile-time condition holds.

If condition is true, then this struct holds a single data member value of type T, which will be initialised on construction with defaultValue.

The advantage to using this class over std::conditional is that it supports assigning a default value on construction.

Template Parameters
conditiontrue if the data member should be included, or false if this struct should be empty.
Tthe data type to store.
defaultValuethe value to assign the data member upon construction.

Member Data Documentation

◆ value

template<bool condition, typename T , T defaultValue>
T regina::EnableIf< condition, T, defaultValue >::value { defaultValue }

The data member to store if condition is true.


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

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