Go to the documentation of this file.
4 #ifndef LEXY_LEXEME_HPP_INCLUDED
5 #define LEXY_LEXEME_HPP_INCLUDED
15 template <
typename Reader>
34 typename Reader::iterator,
typename OtherReader::iterator>>>
40 constexpr
bool empty() const noexcept
56 static_assert(std::is_pointer_v<iterator>);
60 constexpr std::size_t
size() const noexcept
62 return static_cast<std::size_t
>(
_end -
_begin);
75 template <
typename Reader>
78 template <
typename Input>
84 template <
typename Reader>
87 if constexpr (lexy::_detail::is_random_access_iterator<typename Reader::iterator>)
93 auto lhs_cur = lhs.
begin();
94 auto rhs_cur = rhs.
begin();
95 while (lhs_cur != lhs.
end() && rhs_cur != rhs.
end())
97 if (*lhs_cur != *rhs_cur)
102 return lhs_cur == lhs.
end() && rhs_cur == rhs.
end();
106 #endif // LEXY_LEXEME_HPP_INCLUDED
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
#define LEXY_DECAY_DECLTYPE(...)
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
LEXY_DECAY_DECLTYPE(*LEXY_DECLVAL(iterator &)) char_type
lexeme(const Reader &, typename Reader::iterator) -> lexeme< typename Reader::canonical_reader >
constexpr bool equal_lexemes(lexeme< Reader > lhs, lexeme< Reader > rhs)
#define LEXY_DECLVAL(...)
typename std::enable_if< B, T >::type enable_if_t