I am trying to apply the BOOST_FUSION_ADAPT_ADT to class as shown below:
class XY {
private:
std::string x; // lhs
std::list<std::list<std::string>> y;
public:
std::list<std::list<std::string>> const &getY() const {
return y;
}
void setY(std::list<std::list<std::string>> const &y) {
this->y = y;
}
std::string const &getX() const { return x; }
void setX(std::string const &x) { this->x = x; }
};
However, I am getting the following error, I can't quite figure out what is wrong.
xxxxxxxxxxxxxxx: error: no matching function for call to ‘Rule::setY(const std::__cxx11::basic_string<char>&)’
(std::list<std::list<std::string>> const&, std::list<std::list<std::string>> const&, obj.getY(), obj.setY(val))
^
xxxxxxxxxxxxxxx: note: candidate: void Rule::setY(const std::__cxx11::list<std::__cxx11::list<std::__cxx11::basic_string<char> > >&)
void setY(std::list<std::list<std::string>> const &y) {
You don't sow how you used it. However, when I try it there is no problem:
Live On Compiler Explorer
Prints