Celeritas  0.5.0-86+4a8eea4
Public Member Functions | List of all members
celeritas::EnumStringMapper< T > Class Template Reference

Map enums to strings for user output. More...

#include <EnumStringMapper.hh>

Public Member Functions

template<class... Ts>
CELER_CONSTEXPR_FUNCTION EnumStringMapper (Ts... strings)
 Construct with one string per valid enum value.
 
char const * operator() (T value) const
 Convert an enum to the corresponding string.
 

Detailed Description

template<class T>
class celeritas::EnumStringMapper< T >

Map enums to strings for user output.

This should generally be a static const class.

Example:

char const* to_cstring(Foo value)
{
static EnumStringMapper<Foo> const convert{"foo", "bar", "baz"};
return convert(value);
}
char const * to_cstring(WLSTimeProfileSelection value)
Get a string corresponding to the wavelength shifting time model selection.
Definition: GeantOpticalPhysicsOptions.cc:18

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