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

Function template forward

boost::forward

Synopsis

// In header: <boost/move/utility.hpp>


template<typename T> output_reference forward(input_reference);

Description

This function provides limited form of forwarding that is usually enough for in-place construction and avoids the exponential overloading for achieve the limited forwarding in C++03.

For compilers with rvalue references this function provides perfect forwarding.

Otherwise:

  • If input_reference binds to const ::boost::rv<T> & then it output_reference is ::boost::rv<T> &

  • Else, output_reference is equal to input_reference.


PrevUpHomeNext