Boost logo

Boost :

From: Pedro Lamarão (pedro.lamarao_at_[hidden])
Date: 2005-06-24 21:11:59

Pedro Lamarão wrote:
> The following test program doesn't work like I would expect.

Another form of the same phenomenon:

[pedro_at_localhost http_client]$ cat test.cpp
#include <iostream>
#include <string>

#include <boost/spirit/core.hpp>

int main () {
    using namespace std;
    using namespace boost::spirit;

    typedef rule<scanner<string::iterator> > rule_t;

    string s; s += char(0x80);

    cout << boolalpha << (char(0x80) < char(0x7F)) << endl;
    rule_t test_hit = range_p(0x80, 0x7F);

    parse_info<string::iterator> info = parse(s.begin(), s.end(),
    if (info.hit)
        cout << "Hit!" << endl;
        cout << "Not hit." << endl;

    return 0;

[pedro_at_localhost http_client]$ export LANG=C
[pedro_at_localhost http_client]$ $HOME/.local/gcc-3.4.4/bin/g++ -g -I
../../../.. -Wall -Wextra test.cpp -fsigned-char && ./a.out
a.out: ../../../../boost/spirit/core/primitives/primitives.hpp:148:
boost::spirit::range<CharT>::range(CharT, CharT) [with CharT = int]:
Assertion `!(last < first)' failed.

 Pedro Lamarão

Boost list run by bdawes at, gregod at, cpdaniel at, john at