mirror of
https://github.com/Neargye/magic_enum.git
synced 2026-01-09 23:34:23 +00:00
* fixes 'std::ptrdiff_t' to 'std::size_t' casting error
addresses this compiler warning:
```text
[..]/magic_enum_utility.hpp:101:31: warning: conversion to ‘std::size_t’ {aka ‘long unsigned int’} from ‘std::ptrdiff_t’ {aka ‘long int’} may change the sign of the result [-Wsign-conversion]
101 | return enum_value<D, S>(index);
| ^~~~~
```
* suppresses `-Wuseless-cast` for static_cast<char_type>('\0')
needed in case 'char_type' is 'char' (common on Linux but rare on Windows?)
```text
[..]/magic_enum.hpp:275:114: warning: useless cast to type ‘using magic_enum::char_type = using std::basic_string_view<char>::value_type = char’ {aka ‘char’} [-Wuseless-cast]
275 | constexpr static_str(string_view str, std::integer_sequence<std::uint16_t, I...>) noexcept : chars_{str[I]..., static_cast<char_type>('\0')} {}
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
|
||
|---|---|---|
| .. | ||
| magic_enum.hpp | ||
| magic_enum_all.hpp | ||
| magic_enum_containers.hpp | ||
| magic_enum_flags.hpp | ||
| magic_enum_format.hpp | ||
| magic_enum_fuse.hpp | ||
| magic_enum_iostream.hpp | ||
| magic_enum_switch.hpp | ||
| magic_enum_utility.hpp | ||