mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-21 18:15:58 +00:00
AK: Add a DeprecatedString::byte_at() getter
`operator[]` returns a char, this is used in Jakt.
This commit is contained in:
parent
c547b55a00
commit
7a17fd6d71
|
@ -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); }
|
||||
|
|
Loading…
Reference in a new issue