oficsu
aa24461613
Introduce contains_value()
...
* split enum_traits index
* add more proper way to check if enum contains certain value
* change description of contains_value() and add it in readme
2020-03-13 14:12:01 +05:00
oficsu
1e6c9a5a5a
replace C-style cast with static_cast
2020-03-12 11:28:09 +05:00
neargye
94b133abd8
update copyright
2020-02-25 15:52:19 +05:00
neargye
f42605bbf1
update doc
2020-02-14 18:04:15 +05:00
neargye
cae43830a3
more friendly static checks
2020-02-14 15:09:11 +05:00
Neargye
52d7323bca
fix doc
2020-01-31 14:22:19 +05:00
Neargye
2327f53634
v0.6.5
2020-01-31 14:13:11 +05:00
Neargye
59a9cddb6d
clean-up
2020-01-31 14:08:38 +05:00
Paul Kunysch
2f0a3bcae7
improve conan compiler version check ( #24 )
2020-01-31 14:55:50 +05:00
Daniil Goncharov
e01940170f
update ci
2020-01-29 15:34:19 +05:00
Neargye
0361df110f
update doc
2020-01-25 23:52:21 +05:00
Neargye
e3dd165a4a
add compile check at enum_name
2020-01-25 23:51:50 +05:00
Neargye
6b220c83fc
update doc
2020-01-25 23:09:55 +05:00
Neargye
79a1916df2
fix doc
2020-01-25 23:04:44 +05:00
Neargye
06a8669d49
update doc
2020-01-25 23:01:16 +05:00
neargye
a576c077be
fix code style
2020-01-15 15:42:42 +05:00
neargye
f900f4e01d
v0.6.4
2019-12-30 17:17:18 +05:00
neargye
5aa0f247a3
update example
2019-12-30 17:00:31 +05:00
neargye
1b9dea0892
update readme
2019-12-17 17:39:22 +05:00
Neargye
1d7f773bfa
explicit ctr
2019-12-13 11:22:11 +05:00
Neargye
70cf23a7e3
suppress specific warnings
2019-12-13 11:19:21 +05:00
Neargye
5bea6283aa
update example
2019-12-13 11:18:34 +05:00
neargye
3393b85145
clean-up
2019-11-23 19:40:30 +05:00
neargye
35fe1b1a20
update ci
2019-11-20 17:14:40 +05:00
neargye
3b2ebf7e55
add enum concept
2019-11-18 13:35:59 +05:00
neargye
e325a70663
fix macro check support
2019-11-18 13:35:45 +05:00
neargye
60948a4810
update ci
2019-11-18 13:35:32 +05:00
neargye
49d2429cf1
update doc and example
2019-10-26 22:09:23 +05:00
Alexander Karatarakis
f951f3f04e
Fix typo in version ( #20 )
2019-10-24 13:30:10 +03:00
neargye
10d09b1c99
add cstdint because used std::int*_t
2019-10-18 19:21:47 +05:00
neargye
64856beffb
v0.6.3
2019-10-18 13:33:06 +05:00
neargye
5a33daa766
update enum_traits
2019-10-17 13:18:37 +05:00
neargye
497a0c0b69
update gitignore
2019-10-17 13:08:44 +05:00
neargye
69709876c3
update ci
2019-10-16 14:12:54 +05:00
neargye
a6d25eb4c8
update catch to fix clang-9 build
2019-10-16 14:11:25 +05:00
neargye
d022583a1a
clean-up cast, size check
2019-10-16 14:11:15 +05:00
neargye
00f46ae79c
fix test
2019-10-14 21:10:50 +05:00
neargye
a36721d6c7
clang 5 linker fail: undefined reference to `magic_enum::enum_range<number>::min/max'
2019-10-14 19:45:03 +05:00
neargye
3804a9d3b2
update test
2019-10-14 17:55:45 +05:00
neargye
851e7f1a4e
clean-up test
2019-10-14 17:47:36 +05:00
neargye
6c9c498faa
clean-up mixed_sign_less
2019-10-14 17:29:35 +05:00
neargye
1c04e115de
update readme
2019-10-14 15:16:58 +05:00
neargye
5873f123f3
clean-up
2019-10-14 13:54:17 +05:00
neargye
4066fa35e5
get values on all reflected_range to avoid additional work
2019-10-14 13:10:15 +05:00
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