1
0
Fork 0
mirror of https://github.com/Neargye/magic_enum.git synced 2026-01-09 23:34:23 +00:00
Commit graph

104 commits

Author SHA1 Message Date
neargye
083298a045 fix namespace 2025-09-01 01:21:32 +04:00
ZXShady
aaf57737d5
Add prefix trimming (#414) 2025-08-31 22:56:19 +04:00
ZXShady
d642b05dcb
Add adl_ranges (#413)
Co-authored-by: lsemprini <17140216+lsemprini@users.noreply.github.com>
2025-06-11 21:00:01 +04:00
Daniil Goncharov
ff6e5dd1c8
fix 379 (#382) 2025-02-20 12:37:47 +04:00
Arni
a72a0536c7
fix installing via cmake (#374) 2024-10-14 18:05:55 +03:00
neargye
0c1d10a624 fix tests 2024-06-29 17:13:32 +03:00
neargye
bc2e94853b add enum_reflected 2024-06-29 16:47:56 +03:00
neargye
414fb654d3 update copyright 2024-01-02 02:50:34 +04:00
neargye
73c1d83646 fix build 2024-01-02 02:19:26 +04:00
neargye
e26b05e0a0 clean-up 2023-12-18 00:56:13 +04:00
Daniil Goncharov
e09f25780a
checking that the enum is valid (not empty and not forward declaration) (#323) 2023-12-16 17:00:00 +04:00
Vitaly
5523803cfc
Explicitly mark the result of detail::names as constexpr (#305)
It might make no sense, but on MSVC it can generate a compile-time
error, especially if an enumerator's value is out of range.

Example:
error C3615: constexpr function 'magic_enum::detail::names' cannot
result in a constant expression
...
note: failure was caused by call of undefined function or one not
declared 'constexpr'
...
note: see usage of '__builtin_array_init_helper'
2023-11-09 14:09:37 +04:00
neargye
43070070e6 fix enum_type_name in namespace 2023-06-21 12:45:59 +04:00
neargye
7a881a68ba add enum_next_value and enum_prev_value 2023-06-12 17:45:42 +04:00
neargye
e7749da06b add MAGIC_ENUM_NO_ASSERT 2023-06-12 17:43:19 +04:00
neargye
f2ddc4ba62 add more test 2023-06-02 11:24:25 +04:00
neargye
6fe7ffbf35 fix enum name in namespace 2023-05-30 14:37:45 +04:00
neargye
6fec6f6386 add more test 2023-05-30 13:24:25 +04:00
neargye
abf48fc20e fix enum name in class 2023-05-30 12:54:30 +04:00
Daniil Goncharov
8f6c9905fd
Enable wchar_t as string_view value_type (#272) 2023-05-24 19:05:20 +04:00
neargye
ed43fd5fa2 move iostream_operators to magic_enum_iostream 2023-05-21 20:55:52 +04:00
neargye
9c710f6119 add more test 2023-05-21 17:09:30 +04:00
neargye
427a47394f * Remove MAGIC_ENUM_ENABLE_NONASCII
* Optimize template instantiations
* Remove auto is_flags
* Change flags API
2023-05-21 04:08:07 +04:00
neargye
737ed4fc7f add fmt support 2023-05-19 19:49:36 +04:00
talisein
8111a0d17d
Move NONASCII tests to their own file (#261) 2023-05-13 03:44:45 +04:00
neargye
8bd403f888 fix #216, fix #199 2022-11-07 21:00:16 +04:00
neargye
4802f793bb clean-up 2022-06-28 14:57:34 +04:00
Bela Schaum
dd80219653
Magic enum format in a separated header file (#185) 2022-06-28 14:45:47 +04:00
neargye
c59aec8b1c fuse separated into separate header 2022-05-10 21:22:57 +04:00
Bela Schaum
ed09da9f36
Discontinouos uint8_t test + fix (#182) 2022-04-17 23:40:54 +04:00
neargye
b6bf0aa2a8 add namespace magic_enum::istream_operators 2022-04-07 19:18:44 +04:00
Daniil Goncharov
2e7313d3f7
clean-up & improve (#170) 2022-03-28 18:56:16 +04:00
Daniil Goncharov
cee99df7b5
fix bool (#172) 2022-03-28 18:55:25 +04:00
Bela Schaum
64bedded2a
Enum switch (#168) 2022-03-18 16:07:00 +04:00
Daniil Goncharov
60de6bff8c
new customize (#166) 2022-03-18 13:58:07 +04:00
Bela Schaum
c1568c5b26
Constexpr switch names (#142) 2022-03-11 14:08:25 +02:00
Daniil Goncharov
b0c0e02bdc
add compile time enum_index (#159) 2022-03-09 10:07:09 +02:00
Pavel I. Kryukov
9d1cf196cf
Make enum_fuse typesafe (fixes #143) (#145) 2022-03-08 10:38:19 +02:00
Bela Schaum
9268bb3042
Case insensivity based on #112 (#139) 2022-02-18 23:31:36 +02:00
neargye
756b139368 remove throw from enum_fuse 2022-02-16 19:01:14 +02:00
neargye
63ff515163 clean-up 2022-02-10 20:17:44 +02:00
Pavel I. Kryukov
1f8e29b140
Add enum fusing function (#127) 2022-02-10 19:58:59 +02:00
Daniil Goncharov
aecf0db795
New enum-flags API (#120) 2022-01-08 17:30:44 +02:00
neargye
6a1db3b8b6 add tests 2022-01-04 22:00:03 +02:00
neargye
c7a0c83ed4 constexpr_for not work on vs2017 2021-10-09 02:40:44 +03:00
neargye
018673a0a4 add tests constexpr_for 2021-10-09 02:22:59 +03:00
Komachin
38f86e4d09
Added support for non-ASCII characters (UNIX/Linux) (#95) 2021-08-09 17:44:30 +03:00
Alexander Karatarakis
41c916432b
Fix underflow in out of range check (#88)
* Special case bool in cmp_less to avoid msvc's warnings

* Fix underflow in out of range check

The previous fix addressed bool but it seems that was not the heart
of the issue.

The problem is that (lhs - 1) can underflow.

Another example of the check trigger when it shouldn't is:
uint8_t with min_value set to 0 and a value of uint8_t::max
lhs-1 would underflow and find max (see added test).

The issue happens when lhs == rhs. To avoid that situation: flip the if-else!
`cmp_less(rhs, lhs)`means that rhs is strictly less than lhs, so
the check will not trigger when lhs == rhs.

Also, cleanup the bool special-case, as it is no longer necessary.

Note: for the bug to manifest, it is important that the min
of the enums is customized to be 0, so corresponding enum_range
specializations need to be present in the regression tests.
2021-06-25 15:00:54 +03:00
neargye
b927151677 update tests 2021-06-24 17:52:04 +03:00
neargye
739942ab7d fix enums with underlying type bool 2021-06-24 11:48:37 +03:00