Skip to content

Commit 427ce39

Browse files
Fix ArraySelector to compile with Clang
1 parent 6428d8a commit 427ce39

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/util/registry/registry_value.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,17 @@ struct ArraySelector final
9696
{
9797
static constexpr std::size_t Index = ArraySelector<T, N + 1>::Index;
9898
};
99+
100+
template <>
101+
struct ArraySelector<std::string> final {
102+
static constexpr std::size_t Index = Value::VariantType::IndexOf::string;
103+
};
104+
105+
template <>
106+
struct ArraySelector<char> final {
107+
static constexpr std::size_t Index = Value::VariantType::IndexOf::natural8;
108+
};
109+
99110
template <typename T, std::size_t N>
100111
struct ArraySelector<
101112
T,
@@ -109,6 +120,7 @@ struct ArraySelector<
109120
static constexpr std::size_t Index = N;
110121
};
111122
static_assert(ArraySelector<bool>::Index == Value::VariantType::IndexOf::bit);
123+
static_assert(ArraySelector<std::string>::Index == Value::VariantType::IndexOf::string);
112124
static_assert(ArraySelector<std::uint8_t>::Index == Value::VariantType::IndexOf::natural8);
113125
static_assert(ArraySelector<std::uint32_t>::Index == Value::VariantType::IndexOf::natural32);
114126
static_assert(ArraySelector<std::int8_t>::Index == Value::VariantType::IndexOf::integer8);

0 commit comments

Comments
 (0)