1
0
Fork 0
mirror of https://github.com/Neargye/magic_enum.git synced 2026-01-10 23:44:29 +00:00

explicit ctr

This commit is contained in:
Neargye 2019-12-13 11:22:11 +05:00
parent 70cf23a7e3
commit 1d7f773bfa

View file

@ -103,7 +103,7 @@ inline constexpr bool is_enum_v = std::is_enum_v<T> && std::is_same_v<T, std::de
template <std::size_t N>
struct static_string {
constexpr static_string(std::string_view str) noexcept : static_string{str, std::make_index_sequence<N>{}} {
constexpr explicit static_string(std::string_view str) noexcept : static_string{str, std::make_index_sequence<N>{}} {
assert(str.size() == N);
}
@ -122,7 +122,7 @@ struct static_string {
template <>
struct static_string<0> {
constexpr static_string(std::string_view) noexcept {}
constexpr explicit static_string(std::string_view) noexcept {}
constexpr const char* data() const noexcept { return nullptr; }