Gromacs  2025.0-dev-20241009-5c23d5f
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Static Public Attributes
gmx::EnumClassSuitsEnumerationArray< EnumToTest > Class Template Reference

#include <gromacs/utility/enumerationhelpers.h>

Description

template<class EnumToTest>
class gmx::EnumClassSuitsEnumerationArray< EnumToTest >

Helper class to determine whether a template type that is an enum class has a Count field.

Having that field makes the enum class suitable for default use with EnumerationArray.

This class uses SFINAE to test whether the type EnumToTest has a Count field. If so, the overload of hasCountField returning Yes is declared for EnumToTest. Otherwise the default returning No is declared. So for all types, hasCountField is declared and has a characteristic return type. The size of that return type is a compile-time constant that can be used to implement the value member. Since hasCountField is never called, it needs no definitions.

Static Public Attributes

static constexpr bool value = sizeof(hasCountField<EnumToTest>(nullptr)) == sizeof(Yes)
 

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