Skip to content

enum_flags limitation? #314

Description

@Benualdo

Hi, I did not know about the magic_enum::enum_flags funcs until recently but the limitations are unclear to me.

e.g. I use

#define MAGIC_ENUM_RANGE_MIN 0
#define MAGIC_ENUM_RANGE_MAX 256

and I have this enum

enum class Flags : u64
{
  A = 0x0000000000000001,
  B = 0x0000000000000002,
  C = 0x0000000000000004, 
  D = 0x0000000000000008, 
  E = 0x0000000000000010, 
  F = 0x0000000000000020,
  G = 0x0000000000000040, 
  H = 0x0000000000000080,  
  I = 0x0000000000000100,
  J = 0x0000000000000200,
  K = 0x0000000000000400
};

magic_enum::enum_name returns empty string for anything above 256 as expected but magic_enum::enum_flags_name(1026) works and returns "B|K".

Does the MAGIC_ENUM_RANGE_MAX apply to enum flags and how? Is it the maximum amount of flags avaible? Thanks

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions