AK: Add a DeprecatedString::byte_at() getter

`operator[]` returns a char, this is used in Jakt.
This commit is contained in:
Ali Mohammad Pur 2022-12-09 20:05:00 +03:30 committed by Ali Mohammad Pur
parent c547b55a00
commit 7a17fd6d71
Notes: sideshowbarker 2024-07-17 03:26:48 +09:00

View file

@ -192,6 +192,12 @@ public:
return (*m_impl)[i];
}
[[nodiscard]] ALWAYS_INLINE u8 byte_at(size_t i) const
{
VERIFY(!is_null());
return bit_cast<u8>((*m_impl)[i]);
}
using ConstIterator = SimpleIterator<const DeprecatedString, char const>;
[[nodiscard]] constexpr ConstIterator begin() const { return ConstIterator::begin(*this); }