1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- [/
- Copyright 2019 Glen Joseph Fernandes
- (glenjofe@gmail.com)
- Distributed under the Boost Software License,
- Version 1.0. (See accompanying file LICENSE_1_0.txt
- or copy at http://www.boost.org/LICENSE_1_0.txt).
- ]
- [section:copy_reference copy_reference_]
- template<class T, class U>
- struct copy_reference
- {
- typedef __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 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&&`]]
- ]
- [all_compilers] The type alias `copy_reference_t` is only available if the compiler
- supports template aliases.
- [endsect]
|