Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

do_while_ Statement

#include <boost/phoenix/statement/do_while.hpp>

The syntax is:

do_
[
    sequenced_statements
]
.while_(conditional_expression)

Again, take note that while has a leading dot and a trailing underscore: .while_

Example: This code is almost the same as the previous example above with a slight twist in logic.

std::for_each(c.begin(), c.end(),
    (
        do_
        [
            cout << arg1 << ", "
        ]
        .while_(arg1--),
        cout << val("\n")
    )
);

PrevUpHomeNext