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

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

while_ Statement

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

The syntax is:

while_(conditional_expression)
[
    sequenced_statements
]

Example: This code decrements each element until it reaches zero and prints out the number at each step. A newline terminates the printout of each value.

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

PrevUpHomeNext