enum_class

September 14, 2025 ยท View on GitHub

  • Shows how to use xtd::enum_object class and enum_class_ helper.

Sources

  • src/enum_class.cpp
  • CMakeLists.txt

Build and run

Open "Command Prompt" or "Terminal". Navigate to the folder that contains the project and type the following:

xtdc run

Output

name = value_four
value = 3
as<int> = 3
values = [0, 1, 2, 3]
names = [value_one, value_two, value_three, value_four]
entries = [(0, value_one), (1, value_two), (2, value_three), (3, value_four)]

Contents

  1. 1Sources
  2. 2Build and run
  3. 3Output