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

Macro BOOST_MOVE_TO_LV

BOOST_MOVE_TO_LV

Synopsis

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

BOOST_MOVE_TO_LV(ARG)

Description

This macro is used to achieve portable optimal move constructors.

In C++03 mode, when accessing a member of type through a rvalue (implemented as a rv<T> & type, where rv<T> derives from T) triggers a potential UB as the program never creates objects of type rv<T>. This macro casts back rv<T> to T& so that access to member types are done through the original type.

In C++11 compilers the cast from a rvalue reference of a derived type to a rvalue reference of a base type is implicit, so it's a no-op.


PrevUpHomeNext