boostorg / boostorg/phoenix

do_ leads to incosistency

Open
#89 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
33
Forks
51
PR merge metrics
No merged PRs in 30d

Description

Any unary lazy statement in `boost::phoenix` can be used like:
```C++
template
void call_lzay_func(const I& i, const F& f)
{
std::vector vec;
f[push_back(ref(vec), i)]();
}
int i;
f(ref(i), for_(ref(i) = 0, ref(i) < 5, ref(i)++));
```
The only exception is the `do_` statement.

When I have a function taking a unary `boost::phonenix` lazy statement (like you can see in the example), I have to make a falling distinctive to handle the `do_` specially.

I can't see any benefit in this. In which this simply change would solve the problem, without changing the semantic:
```C++
do_
[
cout << arg1 << ", "
]
.while_(arg1--),
```
to
```C++
do_(arg1--)
[
cout << arg1 << ", "
]
```
Isn't the current implementation incosistent in the manner of my example?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.