1

I tried the following example from the spirit x3 docs

#include <string>
#include <iostream>
#include "boost/spirit/home/x3.hpp"

namespace x3 = boost::spirit::x3;

int main()
{
  std::pair<double, double> p;
  std::string input("1.0 2.0");
  std::string::iterator input_pos = input.begin();
  x3::phrase_parse(input_pos, input.end(),
      x3::double_ >> x3::double_,
      x3::space, p);
}

The error i get is

[...]/boost/boost-1.61.0/include/boost/spirit/home/x3/support/traits/move_to.hpp:62:18: error: no match for ‘operator=’ (operand types are ‘std::pair<double, double>’ and ‘std::remove_reference<double&>::type {aka double}’)
             dest = std::move(src);

If i change p to be of type double it compiles and matches 2.0. This is obviously not my intention. I tried this with multiple version of gcc (4.9, 6.2, trunk) and boost version 1.61.0. I feel like this should be a configuration problem unless someone spots an error in the code.

Did someone experienced something similar and know where the problem lies?

Maikel
  • 1,204
  • 7
  • 19

0 Answers0