mirror of
https://github.com/Neargye/magic_enum.git
synced 2026-01-09 23:34:23 +00:00
compatibility with legacy
This commit is contained in:
parent
e904616102
commit
cb395dd852
1 changed files with 3 additions and 3 deletions
|
|
@ -109,15 +109,15 @@ struct static_string {
|
|||
|
||||
constexpr const char* data() const noexcept { return chars.data(); }
|
||||
|
||||
constexpr std::size_t size() const noexcept { return chars.size(); }
|
||||
constexpr std::size_t size() const noexcept { return N; }
|
||||
|
||||
constexpr operator std::string_view() const noexcept { return {data(), size()}; }
|
||||
|
||||
private:
|
||||
template <std::size_t... I>
|
||||
constexpr static_string(std::string_view str, std::index_sequence<I...>) noexcept : chars{{str[I]...}} {}
|
||||
constexpr static_string(std::string_view str, std::index_sequence<I...>) noexcept : chars{{str[I]..., '\0'}} {}
|
||||
|
||||
const std::array<char, N> chars;
|
||||
const std::array<char, N + 1> chars;
|
||||
};
|
||||
|
||||
template <>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue