Subject: Re: [boost] [yap] review part 3: tests + misc + summary
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2018-02-21 17:31:18
On 02/21/2018 10:11 AM, Zach Laine via Boost wrote:
> On Wed, Feb 21, 2018 at 10:28 AM, Steven Watanabe via Boost <
> boost_at_[hidden]> wrote:
>> On 02/20/2018 11:16 PM, Zach Laine via Boost wrote:
>>> On Tue, Feb 20, 2018 at 9:29 AM, Steven Watanabe via Boost <
>>> boost_at_[hidden]> wrote:
>>> That looks like a great candidate for an example, so I made one out of
>> evaluate(let(_a = 1_p << 3) [
>> _a << "1", _a << "2"
>> ], std::cout); // prints 3132, but should print 312
> Why should that print out 312? Isn't equivalent to:
> std::cout << 3 << "1", std::cout << 3 << "2"
> ? If not, why not?
The expected behavior is that _a is
a local variable, not macro-like substitution.
let(_a=<expr>) [ <body> ]
should be equivalent to
auto _a = <expr>;
#define _a <expr>
>> has exponential cost.
> Sure. It's also not allowed, though. From the let docs:
Right. Assume the whole thing is wrapped in let(_a=1_p)
and then it is legal. (each _a refers to the _a in the