0

I'm getting this error: include/boost/spirit/home/phoenix/bind/detail/member_function_ptr.hpp:109:35: No viable conversion from 'boost::spirit::unused_type' to 'const std::__1::basic_string'

#define BOOST_SPIRIT_USE_PHOENIX_V3

#define spirit boost::spirit
#define phoenix boost::phoenix

component_ = lit( '-' ) >> string_[ phoenix::bind( &SemanticActionsType::new_component_name, &actions_, spirit::qi::_1 )]

Here is the SemanticActions class:

template< typename IterType >
class SemanticActions
{
public:
    SemanticActions( Design_p d ) : design_( d )
    {
    }

    void print(int const& i) const
    {
        std::cout << i << std::endl;
    }

    void new_component_name ( std::string const & s) const
    {
        cout << "new component name" << endl;
    }

Any ideas? I've tried passing in a pair of iterators (begin, end) as well as the constant string with no success.

statguy
  • 1,627
  • 3
  • 13
  • 22
  • The lit( '-' ) should not be captured in the semantic action, I'm trying to capture only the string_. – statguy Jan 01 '14 at 03:10
  • 2
    Are you sure your `string_` rule has an attribute of string? It should be something like `qi::rule` if you don't use a skipper (the parentheses are important). If you provide a simple (almost) compilable example you'll get a better chance at a good answer. – llonesmiz Jan 01 '14 at 13:16
  • 1
    You're showing too little code. Why don't you tell us what you're trying to achieve and the relevant code? That way we don't have to peer at different isolated pieces of the puzzle, trying to give you the right magical hints :) – sehe Jan 01 '14 at 13:49
  • 2
    As a side note, avoid macros when possible. Use `namespace spirit = boost::spirit;` instead. – K-ballo Jan 01 '14 at 17:22

0 Answers0