- Shows how to use xtd::enum_object class, enum_class_ and flags_attribute_ helpers.
 
#include <xtd/as>
#include <xtd/console>
#include <xtd/enum_class>
 
 
  normal = 0b0,
  bold = 0b1,
  italic = 0b10,
  underline = 0b100,
  strikeout = 0b1000
);
 
 
auto main() -> int {
  console::write_line("name = {}", text_attribute::bold | text_attribute::italic);
  console::write_line(
"value = {}", 
enum_object(text_attribute::bold | text_attribute::italic).to_int32());
 
  console::write_line("as<int> = {}", as<int>(text_attribute::bold | text_attribute::italic));
}
 
Provides the base class for enumerations.
Definition enum_object.hpp:42
 
#define enum_class_(namespace_name, enum_class_t,...)
Provides the registration struct for enum class.
Definition enum_class.hpp:52
 
#define flags_attribute_(namespace_name, enum_type)
Provides the set attribute struct for enumerations helper.
Definition flags_attribute.hpp:34
 
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10