regression_multi_pass_position_iterator.cpp 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. // Copyright (c) 2010 Chris Hoeppler
  2. //
  3. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. // This code below failed to compile with MSVC starting with Boost V1.42
  6. #include <vector>
  7. #include <boost/spirit/include/classic_position_iterator.hpp>
  8. #include <boost/spirit/include/qi.hpp>
  9. namespace char_enc = boost::spirit::ascii;
  10. namespace qi = boost::spirit::qi;
  11. int main()
  12. {
  13. typedef std::vector<char> file_storage;
  14. typedef boost::spirit::classic::position_iterator<
  15. file_storage::const_iterator> iterator_type;
  16. qi::rule<iterator_type, std::string(), qi::blank_type> top =
  17. qi::lexeme[+char_enc::alpha];
  18. // I do not know what the hell is going under the hood of MSVC 9,
  19. // but the next line fixes compilation error.
  20. // error C3767: '!=': candidate function(s) not accessible
  21. iterator_type first, last;
  22. return first == last; // just to silence unused variable warnings
  23. }