[proto] Recent (rvalue support) changes in proto causes a whole bunch of regressions in Spirit

Hi, This code: #include <boost/spirit/include/qi.hpp> int main() { namespace qi = boost::spirit::qi; qi::rule<char const*> r; r %= (+qi::char_); return 0; } no longer works as expected. r %= (+qi::char_) becomes a no-op. Before it calls either: template <typename Expr> friend rule& operator%=(rule& r, Expr const& expr); // non-const version needed to suppress proto's %= kicking in template <typename Expr> friend rule& operator%=(rule& r, Expr& expr); Both defined in the rule class. Correct me if I'm wrong, but it seems the changes in proto forces us to support rvalue refs, but we are not ready for that yet and it's too late in the release cycle. Thoughts? Regards, -- Joel de Guzman http://www.boostpro.com http://boost-spirit.com

On 10/9/2011 8:32 PM, Joel de Guzman wrote:
Hi,
This code:
#include <boost/spirit/include/qi.hpp>
int main() { namespace qi = boost::spirit::qi;
qi::rule<char const*> r; r %= (+qi::char_);
return 0; }
no longer works as expected. r %= (+qi::char_) becomes a no-op. Before it calls either:
template <typename Expr> friend rule& operator%=(rule& r, Expr const& expr);
// non-const version needed to suppress proto's %= kicking in template <typename Expr> friend rule& operator%=(rule& r, Expr& expr);
Both defined in the rule class.
Correct me if I'm wrong, but it seems the changes in proto forces us to support rvalue refs, but we are not ready for that yet and it's too late in the release cycle.
Thoughts?
Bummer. I suggest adding an rvalue ref overload of operator%= that shares an implementation with the const lvalue one. Should just be a few lines of code. Is that a problem? As an alternative, you can use a domain/grammar to disable Proto's operator%= for Spirit rules. -- Eric Niebler BoostPro Computing http://www.boostpro.com

Joel de Guzman <joel <at> boost-consulting.com> writes: <snip>
Correct me if I'm wrong, but it seems the changes in proto forces us to support rvalue refs, but we are not ready for that yet and it's too late in the release cycle.
Thoughts?
Out of curiosity, is there any update on this?

On 10/20/2011 10:00 AM, Adam Merz wrote:
Joel de Guzman <joel <at> boost-consulting.com> writes: <snip>
Correct me if I'm wrong, but it seems the changes in proto forces us to support rvalue refs, but we are not ready for that yet and it's too late in the release cycle.
Thoughts?
Out of curiosity, is there any update on this?
I believe the issue was resolved by making downstream changes in Spirit. -- Eric Niebler BoostPro Computing http://www.boostpro.com

On 10/20/2011 10:00 AM, Adam Merz wrote:
Joel de Guzman <joel <at> boost-consulting.com> writes: <snip>
Correct me if I'm wrong, but it seems the changes in proto forces us to support rvalue refs, but we are not ready for that yet and it's too late in the release cycle.
Thoughts?
Out of curiosity, is there any update on this?
I believe the issue was resolved by making downstream changes in Spirit.
Yep, this was fixed in Spirit 2 weeks ago. Regards Hartmut --------------- http://boost-spirit.com http://stellar.cct.lsu.edu
participants (4)
-
Adam Merz
-
Eric Niebler
-
Hartmut Kaiser
-
Joel de Guzman