Skip to content

Commit 5bd7669

Browse files
committed
Remove warnings
1 parent 0d8ebc1 commit 5bd7669

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎header_utils.h‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,16 @@ template<int N>
3535
consteval cchar_decay_string<N> to_cchar_t(const char (&value)[N])
3636
{
3737
cchar_decay_string<N> result;
38-
for (int i = 0; i < N; ++i)
39-
result[i] = value[i];
38+
for (size_t i = 0; i < N; ++i)
39+
result[i] = static_cast<cchar_t>(value[i]);
4040
return result;
4141
}
4242

4343
consteval cchar_decay_string<1> to_cchar_t()
4444
{
4545
cchar_decay_string<1> result;
46-
result[0] = static_cast<cchar_t>(0);
46+
result.operator[](0) = static_cast<cchar_t>(0);
47+
// ^weird warning about ambiguous operator[] call here
4748
return result;
4849
}
4950

0 commit comments

Comments
 (0)