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(),
                                              test_hit);
    if (info.hit)
        cout << "Hit!" << endl;
    else
        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
true
a.out: ../../../../boost/spirit/core/primitives/primitives.hpp:148:
boost::spirit::range<CharT>::range(CharT, CharT) [with CharT = int]:
Assertion `!(last < first)' failed.
Aborted

--
 Pedro Lamarão

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk