/Src/Dependencies/Boost/boost/xpressive/detail/core/matcher/assert_bos_matcher.hpp

http://hadesmem.googlecode.com/ · C++ Header · 39 lines · 21 code · 8 blank · 10 comment · 2 complexity · 26f070569e1f48b8717255189de3eb70 MD5 · raw file

  1. ///////////////////////////////////////////////////////////////////////////////
  2. // assert_bos_matcher.hpp
  3. //
  4. // Copyright 2008 Eric Niebler. Distributed under the Boost
  5. // Software License, Version 1.0. (See accompanying file
  6. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. #ifndef BOOST_XPRESSIVE_DETAIL_CORE_MATCHER_ASSERT_BOS_MATCHER_HPP_EAN_10_04_2005
  8. #define BOOST_XPRESSIVE_DETAIL_CORE_MATCHER_ASSERT_BOS_MATCHER_HPP_EAN_10_04_2005
  9. // MS compatible compilers support #pragma once
  10. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  11. # pragma once
  12. #endif
  13. #include <boost/xpressive/detail/detail_fwd.hpp>
  14. #include <boost/xpressive/detail/core/quant_style.hpp>
  15. #include <boost/xpressive/detail/core/state.hpp>
  16. namespace boost { namespace xpressive { namespace detail
  17. {
  18. ///////////////////////////////////////////////////////////////////////////////
  19. // assert_bos_matcher
  20. // match the beginning of the sequence (\A)
  21. struct assert_bos_matcher
  22. {
  23. BOOST_XPR_QUANT_STYLE(quant_none, 0, true)
  24. template<typename BidiIter, typename Next>
  25. static bool match(match_state<BidiIter> &state, Next const &next)
  26. {
  27. return state.bos() && next.match(state);
  28. }
  29. };
  30. }}}
  31. #endif