1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2024-12-03 21:15:42 +00:00
Sprout/sprout/weed/context/parse_context_fwd.hpp

49 lines
1.4 KiB
C++
Raw Normal View History

2013-08-08 09:54:33 +00:00
/*=============================================================================
Copyright (c) 2011-2017 Bolero MURAKAMI
2013-08-08 09:54:33 +00:00
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
2011-11-13 08:54:38 +00:00
#ifndef SPROUT_WEED_CONTEXT_PARSE_CONTEXT_FWD_HPP
#define SPROUT_WEED_CONTEXT_PARSE_CONTEXT_FWD_HPP
#include <sprout/config.hpp>
namespace sprout {
namespace weed {
//
// parse_context
//
template<typename Iterator>
class parse_context {
public:
template<typename Expr, typename = void>
struct eval;
private:
Iterator first_;
Iterator last_;
public:
SPROUT_CONSTEXPR parse_context(Iterator first, Iterator last)
: first_(first)
, last_(last)
{}
SPROUT_CONSTEXPR parse_context(parse_context const& other, Iterator current)
: first_(current)
, last_(other.last_)
{}
SPROUT_CONSTEXPR Iterator begin() const {
return first_;
}
SPROUT_CONSTEXPR Iterator end() const {
return last_;
}
SPROUT_CONSTEXPR bool empty() const {
return first_ == last_;
}
};
} // namespace weed
} // namespace sprout
#endif // #ifndef SPROUT_WEED_CONTEXT_PARSE_CONTEXT_FWD_HPP