Skip to main content

magic_enum::customize

C++ API reference for the namespace magic_enum::customize.

Public API

Class: customize_t

Canonical path: magic_enum::customize::customize_t

Declared in: include/magic_enum/magic_enum.hpp

Signature

class customize_t : public std::pair<detail::customize_tag, string_view> {};

Summary

A class used for enum name customization that inherits from a pair containing a customization tag and a string view.

Constructor: customize_t

Canonical path: magic_enum::customize::customize_t::customize_t

Declared in: include/magic_enum/magic_enum.hpp

Signatures

Overload 1
constexpr customize_t(const char_type* srt);

Summary

Constructs a customize_t object from a character pointer.

Behavior

The constructor initializes the object by converting the character pointer to a string_view.

Parameters

  • srt: A pointer to a null-terminated character string.
Overload 2
constexpr customize_t(string_view srt);

Summary

Constructs a customize_t object from a string_view using a custom tag.

Behavior

The constructor initializes the base pair with a custom tag and the provided string view.

Parameters

  • srt: The string view representing the custom enum name.
Overload 3
constexpr customize_t(detail::customize_tag tag);

Summary

Constructs a customize_t object from a specific customization tag.

Behavior

The constructor initializes the base pair with the provided tag and an empty string view, asserting that the tag is not a custom tag.

Parameters

  • tag: The customization tag to be used.

Free Function: adl_info

Canonical path: magic_enum::customize::adl_info

Declared in: include/magic_enum/magic_enum.hpp

Signature

constexpr adl_info_holder<> adl_info();

Summary

Returns an adl_info_holder object for enum customization.

Behavior

The function returns a default-constructed adl_info_holder object.

Returns

  • Return value 1: A default-constructed adl_info_holder instance.

Free Function: enum_name

Canonical path: magic_enum::customize::enum_name

Declared in: include/magic_enum/magic_enum.hpp

Signature

constexpr customize_t enum_name(E) noexcept;

Summary

Returns the customized name for a specific enum value.

Behavior

The function returns the default customization tag for the given enum value.

Parameters

  • Parameter 1: The enum value for which to retrieve the customized name.

Returns

  • Return value 1: A customize_t object representing the name customization, defaulting to default_tag.

Free Function: enum_type_name

Canonical path: magic_enum::customize::enum_type_name

Declared in: include/magic_enum/magic_enum.hpp

Signature

constexpr customize_t enum_type_name() noexcept;

Summary

Returns the customized name for the enum type itself.

Behavior

The function returns the default customization tag for the enum type.

Returns

  • Return value 1: A customize_t object representing the type name customization, defaulting to default_tag.

Member Function: flag

Canonical path: magic_enum::customize::adl_info_holder::flag

Declared in: include/magic_enum/magic_enum.hpp

Signature

constexpr static adl_info_holder<is_flag, Min, Max, PrefixLength> flag();

Summary

Static factory method to create an adl_info_holder with a specific flag setting.

Behavior

The method returns a default-constructed adl_info_holder with the specified flag status.

Returns

  • Return value 1: An adl_info_holder instance with the updated flag status.

Member Function: minmax

Canonical path: magic_enum::customize::adl_info_holder::minmax

Declared in: include/magic_enum/magic_enum.hpp

Signature

constexpr static adl_info_holder<IsFlags, min, max, PrefixLength> minmax();

Summary

Static factory method to create an adl_info_holder with specific min and max range values.

Behavior

The method returns a default-constructed adl_info_holder with the specified minimum and maximum range values.

Returns

  • Return value 1: An adl_info_holder instance with the updated range limits.

Member Function: prefix

Canonical path: magic_enum::customize::adl_info_holder::prefix

Declared in: include/magic_enum/magic_enum.hpp

Signature

constexpr static adl_info_holder<IsFlags, Min, Max, prefix_len> prefix();

Summary

Static factory method to create an adl_info_holder with a specific prefix length.

Behavior

The method returns a default-constructed adl_info_holder with the specified prefix length.

Returns

  • Return value 1: An adl_info_holder instance with the updated prefix length.

Struct: adl_info_holder

Canonical path: magic_enum::customize::adl_info_holder

Declared in: include/magic_enum/magic_enum.hpp

Signature

struct adl_info_holder {};

Summary

A template struct that holds Argument Dependent Lookup (ADL) information for enum customization, including flag status, range limits, and prefix length.

Struct: enum_range

Canonical path: magic_enum::customize::enum_range

Declared in: include/magic_enum/magic_enum.hpp

Signature

struct enum_range {};

Summary

A template struct used to define the valid range of values for a specific enum type.

Struct: enum_range<E, decltype(void(magic_enum_define_range_adl(E{})))>

Canonical path: magic_enum::customize::enum_range<E, decltype(void(magic_enum_define_range_adl(E{})))>

Declared in: include/magic_enum/magic_enum.hpp

Signature

struct enum_range<E, decltype(void(magic_enum_define_range_adl(E{})))> : decltype(magic_enum_define_range_adl(E{})) {};

Summary

A template specialization of enum_range that inherits from the result of magic_enum_define_range_adl for the specified enum type.