I have the following simple program which I can't get to compile.  Its based
on the spirit docs and bind example.  It differs from the bind example in
that the semantic action follows the standard prototype and takes two
arguments.

Basically I'm having trouble with the bind

I know its been discussed on the list but I never saw fix for it when I was
raised.  Also the fact that the example doesn't use the standard semantic
action prototype is sort of suspicious.

Could anyone help me with this?

Robert Ramey


#include <boost/bind.hpp>

#define BOOST_SPIRIT_SINGLE_GRAMMAR_INSTANCE
#include <boost/spirit/core.hpp>

using namespace boost::spirit;

class psort_parser :
    public boost::spirit::grammar<psort_parser>
{
    typedef boost::spirit::chlit<char> chlit_t;
    typedef boost::spirit::scanner<const char *> scanner_t;
        typedef boost::spirit::rule<> rule_t;
    int m_start_pos;
    int m_end_pos;

    void append_prange(char * const first, const char * const last);
public:
        rule_t prange;

    psort_parser();
};

psort_parser::psort_parser(){
    // character position
    prange = uint_p
        // all of these fail
        //[ boost::bind(& psort_parser::append_prange, this, _1)]
        //[ boost::bind<void>(& psort_parser::append_prange, this, _1)]
        //[ boost::bind(& psort_parser::append_prange, *this, _1)]
        //[ boost::bind<void>(& psort_parser::append_prange, *this, _1)]
        //[ boost::bind(& psort_parser::append_prange, boost::ref(*this),
_1)]
        //[ boost::bind(& psort_parser::append_prange, boost::ref(*this),
_1)]
        [ boost::bind(& psort_parser::append_prange)]
    ;
}




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
_______________________________________________
Boost-docs mailing list
[EMAIL PROTECTED]
Unsubscribe and other administrative requests: 
https://lists.sourceforge.net/lists/listinfo/boost-docs

Reply via email to