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_cv_ref

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

template<class T, class U>
using copy_cv_ref_t = typename copy_cv_ref<T, U>::type;

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

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

Table 1.18. Examples

Expression

Result Type

copy_cv_ref<int, const char>::type

const int

copy_cv_ref<int, volatile char>::type

volatile int

copy_cv_ref<int, const volatile char>::type

const volatile int

copy_cv_ref<int, char&>::type

int&

copy_cv_ref<int, const char&>::type

const int&

copy_cv_ref<int, volatile char&>::type

volatile int&

copy_cv_ref<int, const volatile char&>::type

const volatile int&

copy_cv_ref<int, char&&>::type

int&&

copy_cv_ref<int, const char&&>::type

const int&&

copy_cv_ref<int, volatile char&&>::type

volatile int&&

copy_cv_ref<int, const volatile char&&>::type

const volatile int&&

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

int&

copy_cv_ref<int&, const char>::type

int&

copy_cv_ref<int&, volatile char&>::type

int&

copy_cv_ref<int&, const volatile char&&>::type

int&


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


PrevUpHomeNext