sub_match_impl.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // sub_match_impl.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_SUB_MATCH_IMPL_HPP_EAN_10_04_2005
  8. #define BOOST_XPRESSIVE_DETAIL_CORE_SUB_MATCH_IMPL_HPP_EAN_10_04_2005
  9. // MS compatible compilers support #pragma once
  10. #if defined(_MSC_VER)
  11. # pragma once
  12. #endif
  13. #include <boost/xpressive/sub_match.hpp>
  14. namespace boost { namespace xpressive { namespace detail
  15. {
  16. // TODO: sub_match_impl is a POD IFF BidiIter is POD. Pool allocation
  17. // of them can be made more efficient if they are. Or maybe all they
  18. // need is trivial constructor/destructor. (???)
  19. ///////////////////////////////////////////////////////////////////////////////
  20. // sub_match_impl
  21. //
  22. template<typename BidiIter>
  23. struct sub_match_impl
  24. : sub_match<BidiIter>
  25. {
  26. unsigned int repeat_count_;
  27. BidiIter begin_;
  28. bool zero_width_;
  29. sub_match_impl(BidiIter const &begin)
  30. : sub_match<BidiIter>(begin, begin)
  31. , repeat_count_(0)
  32. , begin_(begin)
  33. , zero_width_(false)
  34. {
  35. }
  36. };
  37. }}} // namespace boost::xpressive::detail
  38. #endif