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

copy_reference_

template<class T, class U>
struct copy_reference
{
    typedef see-below type;
};

template<class T, class U>
using copy_reference_t = typename copy_reference<T, U>::type;

type: T ref, where ref are the ref-qualifiers of U.

Header: #include <boost/type_traits/copy_reference.hpp> or #include <boost/type_traits.hpp>>

Table 1.19. Examples

Expression

Result Type

copy_reference<int, char>::type

int

copy_reference<int, char&>::type

int&

copy_reference<int, char&&>::type

int&&

copy_reference<int&, char>::type

int&

copy_reference<int&, char&>::type

int&

copy_reference<int&, char&&>::type

int&

copy_reference<int&&, char>::type

int&&

copy_reference<int&&, char&>::type

int&

copy_reference<int&&, char&&>::type

int&&


Compiler Compatibility: All current compilers are supported by this trait. The type alias copy_reference_t is only available if the compiler supports template aliases.


PrevUpHomeNext