Go to the documentation of this file.
4 #ifndef LEXY_LEXEME_HPP_INCLUDED
5 #define LEXY_LEXEME_HPP_INCLUDED
15 template <
typename Reader>
33 constexpr
bool empty() const noexcept
49 static_assert(std::is_pointer_v<iterator>);
53 constexpr std::size_t
size() const noexcept
55 return static_cast<std::size_t
>(
_end -
_begin);
68 template <
typename Reader>
71 template <
typename Input>
77 template <
typename Reader>
80 if constexpr (lexy::_detail::is_random_access_iterator<typename Reader::iterator>)
86 auto lhs_cur = lhs.
begin();
87 auto rhs_cur = rhs.
begin();
88 while (lhs_cur != lhs.
end() && rhs_cur != rhs.
end())
90 if (*lhs_cur != *rhs_cur)
95 return lhs_cur == lhs.
end() && rhs_cur == rhs.
end();
99 #endif // LEXY_LEXEME_HPP_INCLUDED
typename encoding::char_type char_type
string_view::value_type char_type
constexpr char_type operator[](std::size_t idx) const noexcept
constexpr bool empty() const noexcept
typename Input ::iterator iterator
constexpr iterator begin() const noexcept
constexpr Iterator next(Iterator iter)
constexpr lexeme(const Reader &reader, iterator begin) noexcept
#define LEXY_PRECONDITION(Expr)
constexpr lexeme() noexcept
constexpr const char_type * data() const noexcept
constexpr std::size_t size() const noexcept
typename Input ::encoding encoding
constexpr lexeme(iterator begin, iterator end) noexcept
constexpr iterator end() const noexcept
constexpr lexeme(iterator pos, std::size_t size) noexcept
lexeme(const Reader &, typename Reader::iterator) -> lexeme< typename Reader::canonical_reader >
constexpr bool equal_lexemes(lexeme< Reader > lhs, lexeme< Reader > rhs)