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

109 commits

Author SHA1 Message Date
neargye
50adc0691e fix clang-format 2023-05-23 21:12:42 +04:00
Daniil Goncharov
629f7b09af
add support big range (#268)
* add support big range

* remove string_view from n()

* fix containers
2023-05-22 19:44:28 +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
Ed Catmur
5367f5183c
Support gcc -fno-pretty-templates (#258)
https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html#index-fno-pretty-templates

The gcc option -fno-pretty-templates changes the __PRETTY_FUNCTION__ from e.g.
"auto n() [with E = E]" to "auto n<E>()" (more like MSVC).

Pass the entire __PRETTY_FUNCTION__ / __FUNCSIG__ to pretty_name(), and truncate it there, checking the last character if necessary to determine the format used.
2023-05-13 13:15:23 +04:00
talisein
8111a0d17d
Move NONASCII tests to their own file (#261) 2023-05-13 03:44:45 +04:00
Ezekiel Warren
48054f64ab
add bzlmod support (#254) 2023-04-26 20:16:08 +04:00
Valeri
fc88b4936a
meson: add options and tests (#255) 2023-04-24 23:36:25 +04:00
Bela Schaum
533c9509ef
add constexpr containers (#187) 2023-01-17 18:59:37 +04:00
neargye
b625fe721c ENABLE_NONASCII depends only on settings 2022-11-28 14:37:24 +02:00
neargye
8bd403f888 fix #216, fix #199 2022-11-07 21:00:16 +04:00
neargye
0fec11eda3 fix build 2022-08-13 18:12:55 +04:00
neargye
cd1ec187e6 fix #157 2022-08-13 18:09:42 +04:00
neargye
b5116d078d add aliases test 2022-08-13 17:51:46 +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
neargye
9ed19fb9e9 move is_flags to customize::enum_range
force set the enum-flag true or false
2022-01-27 15:34:41 +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
neargye
3cc7e2acde update catch2 2021-04-14 14:06:52 +03:00
Gregor Jasny
c1e7c1475a
chore: update catch2 to 2.13.4 for Apple Silicon support (#75) 2021-02-22 18:10:47 +02:00
neargye
0810148bae update copyring 2021-01-23 07:47:01 +02:00
Daniil Goncharov
690486e7f2
improve customize 2020-09-07 12:55:59 +03:00
neargye
5eadad5272 update test flag 2020-08-30 10:43:06 +03:00
neargye
d085812be2 update tests 2020-08-17 01:37:07 +05:00
neargye
02f2249239 clean-up 2020-08-16 17:43:22 +05:00
neargye
971a548693 remove strict enum_name 2020-08-16 15:16:15 +05:00
neargye
9c40cae91a add enum-flags test 2020-08-16 14:58:48 +05:00