rotate

Description

The rotate function adaptor moves the first parameter to the last parameter.

Synopsis

template<class F>
rotate_adaptor<F> rotate(F f);

Semantics

assert(rotate(f)(x, xs...) == f(xs..., x));

Requirements

F must be:

Example

#include <boost/hof.hpp>
#include <cassert>

int main() {
    int r = boost::hof::rotate(boost::hof::_ - boost::hof::_)(2, 5);
    assert(r == 3);
}