File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -164,5 +164,13 @@ ErrorOr<char8_t> CharacterConverter::pop_utf8() {
164164 return static_cast <char8_t >(output);
165165}
166166
167+ template <> ErrorOr<char8_t > CharacterConverter::pop () { return pop_utf8 (); }
168+ template <> ErrorOr<char32_t > CharacterConverter::pop () { return pop_utf32 (); }
169+
170+ template <> size_t CharacterConverter::sizeAs<char8_t >() {
171+ return state->total_bytes ;
172+ }
173+ template <> size_t CharacterConverter::sizeAs<char32_t >() { return 1 ; }
174+
167175} // namespace internal
168176} // namespace LIBC_NAMESPACE_DECL
Original file line number Diff line number Diff line change @@ -33,17 +33,13 @@ class CharacterConverter {
3333 bool isValidState ();
3434
3535 template <typename CharType> size_t sizeAs ();
36- template <> size_t sizeAs<char8_t >() { return state->total_bytes ; }
37- template <> size_t sizeAs<char32_t >() { return 1 ; }
3836
3937 int push (char8_t utf8_byte);
4038 int push (char32_t utf32);
4139
4240 ErrorOr<char8_t > pop_utf8 ();
4341 ErrorOr<char32_t > pop_utf32 ();
4442 template <typename CharType> ErrorOr<CharType> pop ();
45- template <> ErrorOr<char8_t > pop () { return pop_utf8 (); }
46- template <> ErrorOr<char32_t > pop () { return pop_utf32 (); }
4743};
4844
4945} // namespace internal
You can’t perform that action at this time.
0 commit comments