
30 Jan
2014
30 Jan
'14
3:15 p.m.
HK>> The first has an rvalue as its left hand side operand, while the HK>> second one uses an lvalue there. HK>> VA> How does it explain that neither of VA> boost::spirit::lex::detail::operator += gets called? Now I understand what is going on. An rvalue cannot be bound to a non-const reference. boost::spirit::lex::detail::operator+= has a non-const reference as the first parameter and this->self("SOME_STATE") returns an rvalue. Therefore the compiler doesn't call boost::spirit::lex::detail::operator+=, but uses template <typename Left, typename Right> operator +=(Left &&left, Right &&right) from boost::proto::expns_ instead. -- -- Vyacheslav Andrejev