bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Automatially move from $n (was: C++11 move semantics)


From: Frank Heckenbach
Subject: Re: Automatially move from $n (was: C++11 move semantics)
Date: Sun, 01 Apr 2018 23:13:38 +0200

Hans Åberg wrote:

> An advantage with operators names is avoiding parentheses, but a
> problem is that they are hard to search for, but here, since they
> will always together with the $k, that should not be a problem.
> Candidate names might be operator * & ~ + -.

As I said, I'm not really fond of (mis)using operators like that.
Of course, you (or anyone else) might disagree and do it like that,
Bison neither encourages nor prevents it.

My "%define" proposal is an alternative (also completely optional;
if you don't set it, it won't do anything). I think it's a bit
easier to use and more general -- it will apply to all types
(including primitive types, where moving is the same as copying, so
effectively no change for them), whereas you'd have to define the
overloaded operator for each relevant type (and couldn't blindly
define it for all types as it already has a meaning for some of
them). Do you have any objections to my "%define" proposal?

Regards,
Frank



reply via email to

[Prev in Thread] Current Thread [Next in Thread]