Merge branch 'develop'

This commit is contained in:
John Maddock
2019-03-03 09:37:19 +00:00
17 changed files with 448 additions and 39 deletions

65
doc/copy_cv_ref.qbk Normal file
View File

@ -0,0 +1,65 @@
[/
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_cv_ref copy_cv_ref]
template<class T, class U>
struct copy_cv_ref
{
typedef __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 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&`]]
]
[all_compilers] The type alias `copy_cv_ref_t` is only available if the compiler
supports template aliases.
[endsect]

53
doc/copy_reference.qbk Normal file
View File

@ -0,0 +1,53 @@
[/
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]

View File

@ -9,7 +9,7 @@
[h4 Boost-1.70.0]
* Added new traits __is_bounded_array, __is_unbounded_array.
* Added new traits __is_bounded_array, __is_unbounded_array, __copy_reference, __copy_cv_ref.
[h4 Boost-1.68.0]

View File

@ -146,6 +146,8 @@
[def __is_complex [link boost_typetraits.reference.is_complex is_complex]]
[def __copy_cv [link boost_typetraits.reference.copy_cv copy_cv]]
[def __copy_cv_ref [link boost_typetraits.reference.copy_cv_ref copy_cv_ref]]
[def __copy_reference [link boost_typetraits.reference.copy_reference copy_reference]]
[def __type_identity [link boost_typetraits.reference.type_identity type_identity]]
[def __declval [link boost_typetraits.reference.declval declval]]
@ -307,6 +309,8 @@ that is the result of the transformation.
[include conditional.qbk]
[include common_type.qbk]
[include copy_cv.qbk]
[include copy_cv_ref.qbk]
[include copy_reference.qbk]
[include decay.qbk]
[include declval.qbk]
[include detected.qbk]

View File

@ -22,6 +22,8 @@
#include <boost/type_traits/common_type.hpp>
#include <boost/type_traits/conditional.hpp>
#include <boost/type_traits/copy_cv.hpp>
#include <boost/type_traits/copy_cv_ref.hpp>
#include <boost/type_traits/copy_reference.hpp>
#include <boost/type_traits/decay.hpp>
#include <boost/type_traits/declval.hpp>
#include <boost/type_traits/enable_if.hpp>

View File

@ -0,0 +1,31 @@
/*
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)
*/
#ifndef BOOST_TT_COPY_CV_REF_HPP_INCLUDED
#define BOOST_TT_COPY_CV_REF_HPP_INCLUDED
#include <boost/type_traits/copy_cv.hpp>
#include <boost/type_traits/copy_reference.hpp>
#include <boost/type_traits/remove_reference.hpp>
namespace boost {
template<class T, class U>
struct copy_cv_ref {
typedef typename copy_reference<typename copy_cv<T,
typename remove_reference<U>::type >::type, U>::type type;
};
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
template<class T, class U>
using copy_cv_ref_t = typename copy_cv_ref<T, U>::type;
#endif
} /* boost */
#endif

View File

@ -0,0 +1,35 @@
/*
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)
*/
#ifndef BOOST_TT_COPY_REFERENCE_HPP_INCLUDED
#define BOOST_TT_COPY_REFERENCE_HPP_INCLUDED
#include <boost/type_traits/add_lvalue_reference.hpp>
#include <boost/type_traits/add_rvalue_reference.hpp>
#include <boost/type_traits/is_lvalue_reference.hpp>
#include <boost/type_traits/is_rvalue_reference.hpp>
#include <boost/type_traits/conditional.hpp>
namespace boost {
template<class T, class U>
struct copy_reference {
typedef typename conditional<is_rvalue_reference<U>::value,
typename add_rvalue_reference<T>::type,
typename conditional<is_lvalue_reference<U>::value,
typename add_lvalue_reference<T>::type, T>::type>::type type;
};
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
template<class T, class U>
using copy_reference_t = typename copy_reference<T, U>::type;
#endif
} /* boost */
#endif

View File

@ -47,25 +47,25 @@ namespace boost
struct dont_care;
template <class T, class U, class Ret, class = boost::void_t<>>
template <class T, class U, class Ret, class = void>
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _ret_imp) : public boost::false_type {};
template <class T, class U, class Ret>
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _ret_imp)<T, U, Ret, boost::void_t<decltype(std::declval<typename add_reference<T>::type>() BOOST_TT_TRAIT_OP std::declval<typename add_reference<U>::type>())> >
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _ret_imp)<T, U, Ret, typename boost::make_void<decltype(std::declval<typename add_reference<T>::type>() BOOST_TT_TRAIT_OP std::declval<typename add_reference<U>::type>())>::type>
: public boost::integral_constant<bool, ::boost::is_convertible<decltype(std::declval<typename add_reference<T>::type>() BOOST_TT_TRAIT_OP std::declval<typename add_reference<U>::type>()), Ret>::value> {};
template <class T, class U, class = boost::void_t<> >
template <class T, class U, class = void >
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _void_imp) : public boost::false_type {};
template <class T, class U>
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _void_imp)<T, U, boost::void_t<decltype(std::declval<typename add_reference<T>::type>() BOOST_TT_TRAIT_OP std::declval<typename add_reference<U>::type>())> >
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _void_imp)<T, U, typename boost::make_void<decltype(std::declval<typename add_reference<T>::type>() BOOST_TT_TRAIT_OP std::declval<typename add_reference<U>::type>())>::type>
: public boost::integral_constant<bool, ::boost::is_void<decltype(std::declval<typename add_reference<T>::type>() BOOST_TT_TRAIT_OP std::declval<typename add_reference<U>::type>())>::value> {};
template <class T, class U, class = boost::void_t<>>
template <class T, class U, class = void>
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _dc_imp) : public boost::false_type {};
template <class T, class U>
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _dc_imp)<T, U, boost::void_t<decltype(std::declval<typename add_reference<T>::type>() BOOST_TT_TRAIT_OP std::declval<typename add_reference<U>::type>())> >
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _dc_imp)<T, U, typename boost::make_void<decltype(std::declval<typename add_reference<T>::type>() BOOST_TT_TRAIT_OP std::declval<typename add_reference<U>::type>())>::type>
: public boost::true_type {};
}

View File

@ -25,25 +25,25 @@ namespace boost
struct dont_care;
template <class T, class Ret, class = boost::void_t<>>
template <class T, class Ret, class = void>
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _ret_imp) : public boost::false_type {};
template <class T, class Ret>
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _ret_imp)<T, Ret, boost::void_t<decltype(std::declval<typename add_reference<T>::type>() BOOST_TT_TRAIT_OP) > >
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _ret_imp)<T, Ret, typename boost::make_void<decltype(std::declval<typename add_reference<T>::type>() BOOST_TT_TRAIT_OP) >::type>
: public boost::integral_constant<bool, ::boost::is_convertible<decltype(std::declval<typename add_reference<T>::type>() BOOST_TT_TRAIT_OP), Ret>::value> {};
template <class T, class = boost::void_t<> >
template <class T, class = void >
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _void_imp) : public boost::false_type {};
template <class T>
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _void_imp)<T, boost::void_t<decltype(std::declval<typename add_reference<T>::type>()BOOST_TT_TRAIT_OP)> >
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _void_imp)<T, typename boost::make_void<decltype(std::declval<typename add_reference<T>::type>()BOOST_TT_TRAIT_OP)>::type>
: public boost::integral_constant<bool, ::boost::is_void<decltype(std::declval<typename add_reference<T>::type>() BOOST_TT_TRAIT_OP)>::value> {};
template <class T, class = boost::void_t<>>
template <class T, class = void>
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _dc_imp) : public boost::false_type {};
template <class T>
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _dc_imp)<T, boost::void_t<decltype(std::declval<typename add_reference<T>::type>() BOOST_TT_TRAIT_OP)> >
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _dc_imp)<T, typename boost::make_void<decltype(std::declval<typename add_reference<T>::type>() BOOST_TT_TRAIT_OP)>::type>
: public boost::true_type {};
}

View File

@ -34,25 +34,25 @@ namespace boost
struct dont_care;
template <class T, class Ret, class = boost::void_t<>>
template <class T, class Ret, class = void>
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _ret_imp) : public boost::false_type {};
template <class T, class Ret>
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _ret_imp)<T, Ret, boost::void_t<decltype(BOOST_TT_TRAIT_OP std::declval<typename add_reference<T>::type>()) > >
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _ret_imp)<T, Ret, typename boost::make_void<decltype(BOOST_TT_TRAIT_OP std::declval<typename add_reference<T>::type>()) >::type>
: public boost::integral_constant<bool, ::boost::is_convertible<decltype(BOOST_TT_TRAIT_OP std::declval<typename add_reference<T>::type>() ), Ret>::value> {};
template <class T, class = boost::void_t<> >
template <class T, class = void >
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _void_imp) : public boost::false_type {};
template <class T>
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _void_imp)<T, boost::void_t<decltype(BOOST_TT_TRAIT_OP std::declval<typename add_reference<T>::type>())> >
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _void_imp)<T, typename boost::make_void<decltype(BOOST_TT_TRAIT_OP std::declval<typename add_reference<T>::type>())>::type>
: public boost::integral_constant<bool, ::boost::is_void<decltype(BOOST_TT_TRAIT_OP std::declval<typename add_reference<T>::type>())>::value> {};
template <class T, class = boost::void_t<>>
template <class T, class = void>
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _dc_imp) : public boost::false_type {};
template <class T>
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _dc_imp)<T, boost::void_t<decltype(BOOST_TT_TRAIT_OP std::declval<typename add_reference<T>::type>() )> >
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _dc_imp)<T, typename boost::make_void<decltype(BOOST_TT_TRAIT_OP std::declval<typename add_reference<T>::type>() )>::type>
: public boost::true_type {};
}

View File

@ -52,25 +52,25 @@ namespace boost
struct dont_care;
template <class T, class U, class Ret, class = boost::void_t<>>
template <class T, class U, class Ret, class = void>
struct has_minus_ret_imp : public boost::false_type {};
template <class T, class U, class Ret>
struct has_minus_ret_imp<T, U, Ret, boost::void_t<decltype(std::declval<typename add_reference<T>::type>() - std::declval<typename add_reference<U>::type>())> >
struct has_minus_ret_imp<T, U, Ret, typename boost::make_void<decltype(std::declval<typename add_reference<T>::type>() - std::declval<typename add_reference<U>::type>())>::type>
: public boost::integral_constant<bool, ::boost::is_convertible<decltype(std::declval<typename add_reference<T>::type>() - std::declval<typename add_reference<U>::type>()), Ret>::value> {};
template <class T, class U, class = boost::void_t<> >
template <class T, class U, class = void >
struct has_minus_void_imp : public boost::false_type {};
template <class T, class U>
struct has_minus_void_imp<T, U, boost::void_t<decltype(std::declval<typename add_reference<T>::type>() - std::declval<typename add_reference<U>::type>())> >
struct has_minus_void_imp<T, U, typename boost::make_void<decltype(std::declval<typename add_reference<T>::type>() - std::declval<typename add_reference<U>::type>())>::type>
: public boost::integral_constant<bool, ::boost::is_void<decltype(std::declval<typename add_reference<T>::type>() - std::declval<typename add_reference<U>::type>())>::value> {};
template <class T, class U, class = boost::void_t<>>
template <class T, class U, class = void>
struct has_minus_dc_imp : public boost::false_type {};
template <class T, class U>
struct has_minus_dc_imp<T, U, boost::void_t<decltype(std::declval<typename add_reference<T>::type>() - std::declval<typename add_reference<U>::type>())> >
struct has_minus_dc_imp<T, U, typename boost::make_void<decltype(std::declval<typename add_reference<T>::type>() - std::declval<typename add_reference<U>::type>())>::type>
: public boost::true_type {};
template <class T, class U, class Ret>

View File

@ -53,25 +53,25 @@ namespace boost
struct dont_care;
template <class T, class U, class Ret, class = boost::void_t<>>
template <class T, class U, class Ret, class = void>
struct has_minus_assign_ret_imp : public boost::false_type {};
template <class T, class U, class Ret>
struct has_minus_assign_ret_imp<T, U, Ret, boost::void_t<decltype(std::declval<typename add_reference<T>::type>() -= std::declval<typename add_reference<U>::type>())> >
struct has_minus_assign_ret_imp<T, U, Ret, typename boost::make_void<decltype(std::declval<typename add_reference<T>::type>() -= std::declval<typename add_reference<U>::type>())>::type>
: public boost::integral_constant<bool, ::boost::is_convertible<decltype(std::declval<typename add_reference<T>::type>() -= std::declval<typename add_reference<U>::type>()), Ret>::value> {};
template <class T, class U, class = boost::void_t<> >
template <class T, class U, class = void >
struct has_minus_assign_void_imp : public boost::false_type {};
template <class T, class U>
struct has_minus_assign_void_imp<T, U, boost::void_t<decltype(std::declval<typename add_reference<T>::type>() -= std::declval<typename add_reference<U>::type>())> >
struct has_minus_assign_void_imp<T, U, typename boost::make_void<decltype(std::declval<typename add_reference<T>::type>() -= std::declval<typename add_reference<U>::type>())>::type>
: public boost::integral_constant<bool, ::boost::is_void<decltype(std::declval<typename add_reference<T>::type>() -= std::declval<typename add_reference<U>::type>())>::value> {};
template <class T, class U, class = boost::void_t<>>
template <class T, class U, class = void>
struct has_minus_assign_dc_imp : public boost::false_type {};
template <class T, class U>
struct has_minus_assign_dc_imp<T, U, boost::void_t<decltype(std::declval<typename add_reference<T>::type>() -= std::declval<typename add_reference<U>::type>())> >
struct has_minus_assign_dc_imp<T, U, typename boost::make_void<decltype(std::declval<typename add_reference<T>::type>() -= std::declval<typename add_reference<U>::type>())>::type>
: public boost::true_type {};
template <class T, class U, class Ret>

View File

@ -56,25 +56,25 @@ namespace boost
struct dont_care;
template <class T, class U, class Ret, class = boost::void_t<>>
template <class T, class U, class Ret, class = void>
struct has_plus_assign_ret_imp : public boost::false_type {};
template <class T, class U, class Ret>
struct has_plus_assign_ret_imp<T, U, Ret, boost::void_t<decltype(std::declval<typename add_reference<T>::type>() += std::declval<typename add_reference<U>::type>())> >
struct has_plus_assign_ret_imp<T, U, Ret, typename boost::make_void<decltype(std::declval<typename add_reference<T>::type>() += std::declval<typename add_reference<U>::type>())>::type>
: public boost::integral_constant<bool, ::boost::is_convertible<decltype(std::declval<typename add_reference<T>::type>() += std::declval<typename add_reference<U>::type>()), Ret>::value> {};
template <class T, class U, class = boost::void_t<> >
template <class T, class U, class = void >
struct has_plus_assign_void_imp : public boost::false_type {};
template <class T, class U>
struct has_plus_assign_void_imp<T, U, boost::void_t<decltype(std::declval<typename add_reference<T>::type>() += std::declval<typename add_reference<U>::type>())> >
struct has_plus_assign_void_imp<T, U, typename boost::make_void<decltype(std::declval<typename add_reference<T>::type>() += std::declval<typename add_reference<U>::type>())>::type>
: public boost::integral_constant<bool, ::boost::is_void<decltype(std::declval<typename add_reference<T>::type>() += std::declval<typename add_reference<U>::type>())>::value> {};
template <class T, class U, class = boost::void_t<>>
template <class T, class U, class = void>
struct has_plus_assign_dc_imp : public boost::false_type {};
template <class T, class U>
struct has_plus_assign_dc_imp<T, U, boost::void_t<decltype(std::declval<typename add_reference<T>::type>() += std::declval<typename add_reference<U>::type>())> >
struct has_plus_assign_dc_imp<T, U, typename boost::make_void<decltype(std::declval<typename add_reference<T>::type>() += std::declval<typename add_reference<U>::type>())>::type>
: public boost::true_type {};
template <class T, class U, class Ret>

View File

@ -44,7 +44,7 @@ namespace boost {
// They can also fall back to the behaviour of reinterpret_cast, which allows is_virtual_base_of to work on non-class types too.
// Note that because we are casting pointers there can be no user-defined operators to interfere.
template<class T, class U,
boost::void_t<decltype((U*)(std::declval<T*>()))>* =
typename boost::make_void<decltype((U*)(std::declval<T*>()))>::type* =
nullptr>
constexpr bool is_virtual_base_impl(int) { return false; }

186
test/copy_cv_ref_test.cpp Normal file
View File

@ -0,0 +1,186 @@
/*
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)
*/
#ifdef TEST_STD
#include <type_traits>
#else
#include <boost/type_traits/copy_cv_ref.hpp>
#endif
#include "test.hpp"
#include "check_type.hpp"
TT_TEST_BEGIN(copy_cv_ref)
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int, char>::type, int);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int, const char>::type, const int);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int, volatile char>::type, volatile int);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int, const volatile char>::type, const volatile int);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int, char&>::type, int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int, const char&>::type, const int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int, volatile char&>::type, volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int, const volatile char&>::type, const volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int, char>::type, const int);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int, const char>::type, const int);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int, volatile char>::type, const volatile int);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int, const volatile char>::type, const volatile int);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int, char&>::type, const int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int, const char&>::type, const int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int, volatile char&>::type, const volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int, const volatile char&>::type, const volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int, char>::type, volatile int);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int, const char>::type, const volatile int);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int, volatile char>::type, volatile int);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int, const volatile char>::type, const volatile int);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int, char&>::type, volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int, const char&>::type, const volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int, volatile char&>::type, volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int, const volatile char&>::type, const volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int, char>::type, const volatile int);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int, const char>::type, const volatile int);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int, volatile char>::type, const volatile int);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int, const volatile char>::type, const volatile int);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int, char&>::type, const volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int, const char&>::type, const volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int, volatile char&>::type, const volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int, const volatile char&>::type, const volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&, char>::type, int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&, const char>::type, int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&, volatile char>::type, int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&, const volatile char>::type, int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&, char&>::type, int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&, const char&>::type, int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&, volatile char&>::type, int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&, const volatile char&>::type, int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&, char>::type, const int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&, const char>::type, const int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&, volatile char>::type, const int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&, const volatile char>::type, const int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&, char&>::type, const int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&, const char&>::type, const int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&, volatile char&>::type, const int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&, const volatile char&>::type, const int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&, char>::type, volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&, const char>::type, volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&, volatile char>::type, volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&, const volatile char>::type, volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&, char&>::type, volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&, const char&>::type, volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&, volatile char&>::type, volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&, const volatile char&>::type, volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&, char>::type, const volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&, const char>::type, const volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&, volatile char>::type, const volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&, const volatile char>::type, const volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&, char&>::type, const volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&, const char&>::type, const volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&, volatile char&>::type, const volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&, const volatile char&>::type, const volatile int&);
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int, char&&>::type, int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int, const char&&>::type, const int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int, volatile char&&>::type, volatile int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int, const volatile char&&>::type, const volatile int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int, char&&>::type, const int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int, const char&&>::type, const int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int, volatile char&&>::type, const volatile int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int, const volatile char&&>::type, const volatile int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int, char&&>::type, volatile int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int, const char&&>::type, const volatile int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int, volatile char&&>::type, volatile int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int, const volatile char&&>::type, const volatile int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int, char&&>::type, const volatile int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int, const char&&>::type, const volatile int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int, volatile char&&>::type, const volatile int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int, const volatile char&&>::type, const volatile int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&, char&&>::type, int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&, const char&&>::type, int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&, volatile char&&>::type, int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&, const volatile char&&>::type, int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&, char&&>::type, const int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&, const char&&>::type, const int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&, volatile char&&>::type, const int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&, const volatile char&&>::type, const int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&, char&&>::type, volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&, const char&&>::type, volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&, volatile char&&>::type, volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&, const volatile char&&>::type, volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&, char&&>::type, const volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&, const char&&>::type, const volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&, volatile char&&>::type, const volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&, const volatile char&&>::type, const volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&&, char>::type, int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&&, const char>::type, int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&&, volatile char>::type, int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&&, const volatile char>::type, int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&&, char&>::type, int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&&, const char&>::type, int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&&, volatile char&>::type, int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&&, const volatile char&>::type, int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&&, char&&>::type, int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&&, const char&&>::type, int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&&, volatile char&&>::type, int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<int&&, const volatile char&&>::type, int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&&, char>::type, const int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&&, const char>::type, const int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&&, volatile char>::type, const int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&&, const volatile char>::type, const int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&&, char&>::type, const int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&&, const char&>::type, const int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&&, volatile char&>::type, const int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&&, const volatile char&>::type, const int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&&, char&&>::type, const int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&&, const char&&>::type, const int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&&, volatile char&&>::type, const int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const int&&, const volatile char&&>::type, const int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&&, char>::type, volatile int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&&, const char>::type, volatile int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&&, volatile char>::type, volatile int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&&, const volatile char>::type, volatile int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&&, char&>::type, volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&&, const char&>::type, volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&&, volatile char&>::type, volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&&, const volatile char&>::type, volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&&, char&&>::type, volatile int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&&, const char&&>::type, volatile int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&&, volatile char&&>::type, volatile int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<volatile int&&, const volatile char&&>::type, volatile int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&&, char>::type, const volatile int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&&, const char>::type, const volatile int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&&, volatile char>::type, const volatile int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&&, const volatile char>::type, const volatile int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&&, char&>::type, const volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&&, const char&>::type, const volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&&, volatile char&>::type, const volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&&, const volatile char&>::type, const volatile int&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&&, char&&>::type, const volatile int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&&, const char&&>::type, const volatile int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&&, volatile char&&>::type, const volatile int&&);
BOOST_CHECK_TYPE3(::tt::copy_cv_ref<const volatile int&&, const volatile char&&>::type, const volatile int&&);
#endif
TT_TEST_END

View File

@ -0,0 +1,33 @@
/*
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)
*/
#ifdef TEST_STD
#include <type_traits>
#else
#include <boost/type_traits/copy_reference.hpp>
#endif
#include "test.hpp"
#include "check_type.hpp"
TT_TEST_BEGIN(copy_reference)
BOOST_CHECK_TYPE3(::tt::copy_reference<int, char>::type, int);
BOOST_CHECK_TYPE3(::tt::copy_reference<int, char&>::type, int&);
BOOST_CHECK_TYPE3(::tt::copy_reference<int&, char>::type, int&);
BOOST_CHECK_TYPE3(::tt::copy_reference<int&, char&>::type, int&);
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
BOOST_CHECK_TYPE3(::tt::copy_reference<int, char&&>::type, int&&);
BOOST_CHECK_TYPE3(::tt::copy_reference<int&, char&&>::type, int&);
BOOST_CHECK_TYPE3(::tt::copy_reference<int&&, char>::type, int&&);
BOOST_CHECK_TYPE3(::tt::copy_reference<int&&, char&>::type, int&);
BOOST_CHECK_TYPE3(::tt::copy_reference<int&&, char&&>::type, int&&);
#endif
TT_TEST_END

View File

@ -27,7 +27,7 @@ struct non_assignable
struct noexcept_assignable
{
noexcept_assignable();
noexcept_assignable& operator=(const non_assignable&)noexcept;
noexcept_assignable& operator=(const noexcept_assignable&)noexcept;
};
#endif