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

602 commits

Author SHA1 Message Date
neargye
6b95773b05 clean-up tests 2019-10-14 13:03:28 +05:00
Alexander Karatarakis
db4c55c36a Change the way range_min()/max() is calculated (#19)
This was previously done via parameter expansion. The expanded form
looks like this:
A(128) && A(127) && ... && A(X) && ... && A(0)

where A(X) is the actual range_max which is crafted to return 'false'.
Static analysis detects that expressions after A(X) are
dead code due to short-circuiting.

The new implementation uses a simple loop to find the extrema,
similarly to the loop in detail::values().
Furthermore, it uses only one parameter expansion (for reflected_set_v),
as opposed to two (one for range_min and one for range_max).
2019-10-14 10:44:42 +03:00
Alexander Karatarakis
0f36cd5b0f Introduce mixed_sign_less()/min()/max() (#18)
Previously, there was mixed sign comparison:
```
reflected_min_v = -120 > 0U ? -120 : 0
```
which returns -120 because the condition is true, since the
compiler casts the signed value to unsigned, leading to a huge value.
This caused the following values as result:

```
reflected_min_v == -120
min_v = -1
static_cast<U>(min_v) = 18446744073709551615
```

The last one is used in magic_enum::enum_index().
2019-10-14 10:44:09 +03:00
neargye
1f3ea64407 v0.6.2 2019-10-08 13:20:14 +05:00
neargye
00bd8528ce update doc
fix MAGIC_ENUM_NO_CHECK_SUPPORT
2019-10-04 13:58:08 +05:00
neargye
2a259f1b55 update doc 2019-10-03 19:43:18 +05:00
neargye
cd73e2b974 add doc 2019-10-03 19:40:42 +05:00
neargye
1f61e72c26 fix type cast 2019-10-03 17:33:18 +05:00
neargye
77314d254d clean-up 2019-10-03 17:08:11 +05:00
neargye
0b262f7cc8 fix cvref 2019-10-03 14:50:09 +05:00
Alexander Karatarakis
3f0aad9f74 Fix regression of enum_cast<>() when used with refs (EnumT& vs EnumT) (#16) 2019-10-03 12:02:39 +05:00
neargye
cbbb6dd8f1 add comment to MAGIC_ENUM_SUPPORTED 2019-10-02 17:52:04 +05:00
neargye
105c8f067e remove is_fixed_enum
non stable and useless
2019-10-02 17:06:36 +05:00
neargye
c947afdbae change check support compiler 2019-10-02 15:28:53 +05:00
neargye
75c9d9bce5 caching entries 2019-10-01 16:58:55 +05:00
neargye
2c0b00a7ed add error if count < 0, fix #15 2019-10-01 16:58:35 +05:00
neargye
92dfab4ac4 improve enum_value for dense enums 2019-09-30 19:08:29 +05:00
neargye
77918a74c5 fix build on gcc<9 2019-09-30 17:17:50 +05:00
neargye
2f9400bcf3 wow, msvc not follow standard 2019-09-29 17:50:05 +05:00
neargye
52f36fc5a0 removed definition that used only once 2019-09-29 17:47:54 +05:00
neargye
8eb87a9a88 v0.6.1 2019-09-29 16:31:58 +05:00
neargye
26dcd30d9a update ci 2019-09-29 16:30:47 +05:00
neargye
289b96e561 update example 2019-09-29 16:22:58 +05:00
neargye
2541180874 update test 2019-09-29 16:22:47 +05:00
neargye
48ff12026f update readme 2019-09-29 16:22:25 +05:00
neargye
370a1d5236 improvement
* SFINAE-friendly
* overhead reduction
* add enum_index
* add enum_traits
* less bin size
2019-09-29 16:22:09 +05:00
neargye
455e4dcf9b strengthened noexcept 2019-09-09 19:38:30 +05:00
neargye
3edfd58e59 clean-up naming 2019-09-03 17:53:26 +05:00
neargye
2eac4ccd06 update readme 2019-08-30 02:35:59 +05:00
neargye
1f94f282c0 fix conan.py 2019-08-30 02:35:47 +05:00
neargye
c0ae150a26 add macro to no check support 2019-08-29 18:52:20 +05:00
neargye
317029850a fix type cast and clean-up 2019-08-29 18:52:16 +05:00
neargye
c9337182f4 fix is_magic_enum_supported 2019-08-27 20:30:12 +05:00
neargye
a9a8892026 fix static_assert msg 2019-08-27 18:14:02 +05:00
neargye
669b7ac9bc update conan.py 2019-08-27 17:12:21 +05:00
neargye
e30e8d81bd less bin size, improving check supported compiler, clean-up
thanks @rollbear
2019-08-27 16:50:23 +05:00
neargye
2e61a86b2f improve name_impl 2019-08-25 17:02:00 +05:00
neargye
22167885d7 update tests 2019-08-24 20:09:50 +05:00
neargye
850196eb02 fix test_package 2019-08-24 17:40:44 +05:00
neargye
65662f0491 update ci 2019-08-24 14:58:36 +05:00
neargye
7707d08ff5 error if unsupported compiler 2019-08-24 14:16:24 +05:00
neargye
a9f8797ff2 add compiler explorer to readme 2019-08-24 13:19:38 +05:00
neargye
6e4a051424 update ci 2019-08-24 13:15:31 +05:00
neargye
a2bb347f05 update cmake 2019-08-24 13:10:55 +05:00
neargye
91b36336cb update readme 2019-08-24 12:41:24 +05:00
neargye
409e9e1afd add conan 2019-08-24 12:33:30 +05:00
neargye
ef36e2e218 update readme 2019-08-20 17:15:31 +05:00
neargye
7c7cdc906b fix bitwise_operators 2019-08-20 00:01:53 +05:00
neargye
e15c38ac65 update tests 2019-08-19 21:58:58 +05:00
neargye
2b76827698 clean-up bitwise_operators 2019-08-19 21:58:52 +05:00