Boost logo

Boost :

From: Pedro Lamarão (pedro.lamarao_at_[hidden])
Date: 2005-06-24 20:49:00

The following test program doesn't work like I would expect.

#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(0x81);

    cout << (char(0x80) < char(0xFF)) << endl;

    rule_t test = range_p(0x80, 0xFF); // (*)

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

    return 0;

This is the program output.

[pedro_at_localhost http_client]$ $HOME/.local/gcc-3.4.4/bin/g++ -g -I
../../../.. -Wall -Wextra test.cpp -fsigned-char && ./a.out
Not hit.

[pedro_at_localhost http_client]$ $HOME/.local/gcc-3.4.4/bin/g++ -g -I
../../../.. -Wall -Wextra test.cpp -funsigned-char && ./a.out

[pedro_at_localhost http_client]$ $HOME/.local/gcc-3.4.4/bin/gcc -v
Reading specs from
Configured with: ../configure --prefix=/home/pedro/.local/gcc-3.4.4
Thread model: posix
gcc version 3.4.4

 Pedro Lamarão

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