• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
6 // This code below failed to compile with MSVC starting with Boost V1.42
7 
8 #include <vector>
9 #include <boost/spirit/include/classic_position_iterator.hpp>
10 #include <boost/spirit/include/qi.hpp>
11 
12 namespace char_enc = boost::spirit::ascii;
13 namespace qi = boost::spirit::qi;
14 
main()15 int main()
16 {
17     typedef std::vector<char> file_storage;
18     typedef boost::spirit::classic::position_iterator<
19         file_storage::const_iterator> iterator_type;
20 
21     qi::rule<iterator_type, std::string(), qi::blank_type> top =
22         qi::lexeme[+char_enc::alpha];
23 
24     // I do not know what the hell is going under the hood of MSVC 9,
25     // but the next line fixes compilation error.
26     // error C3767: '!=': candidate function(s) not accessible
27     iterator_type first, last;
28 
29     return first == last; // just to silence unused variable warnings
30 }
31 
32