Skip to content

do_ leads to incosistency #89

@xR3b0rn

Description

@xR3b0rn

Any unary lazy statement in boost::phoenix can be used like:

template <class I, class F>
void call_lzay_func(const I& i, const F& f)
{
    std::vector<int> 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:

do_
[
    cout << arg1 << ", "
]
.while_(arg1--),

to

do_(arg1--)
[
    cout << arg1 << ", "
]

Isn't the current implementation incosistent in the manner of my example?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions