forked from boostorg/type_traits
Add _t aliases
This commit is contained in:
+3
-1
@@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using add_const_t = typename add_const<T>::type; // C++11 and above
|
||||
|
||||
__type The same type as `T const` for all `T`.
|
||||
|
||||
__std_ref 3.9.3.
|
||||
|
||||
+3
-1
@@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using add_cv_t = typename add_cv<T>::type; // C++11 and above
|
||||
|
||||
__type The same type as `T const volatile` for all `T`.
|
||||
|
||||
__std_ref 3.9.3.
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using add_lvalue_reference_t = typename add_lvalue_reference<T>::type; // C++11 and above
|
||||
|
||||
__type If `T` names an object or function type then the member typedef `type`
|
||||
shall name `T&`; otherwise, if `T` names a type ['rvalue reference to U] then
|
||||
the member typedef type shall name `U&`; otherwise, type shall name `T`.
|
||||
|
||||
+3
-1
@@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using add_pointer_t = typename add_pointer<T>::type; // C++11 and above
|
||||
|
||||
__type The same type as `remove_reference<T>::type*`.
|
||||
|
||||
The rationale for this template
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using add_rvalue_reference_t = typename add_rvalue_reference<T>::type; // C++11 and above
|
||||
|
||||
__type If `T` names an object or function type then the member typedef type
|
||||
shall name `T&&`; otherwise, type shall name `T`. ['\[Note: This rule reflects
|
||||
the semantics of reference collapsing. For example, when a type `T` names
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using add_volatile_t = typename add_volatile<T>::type; // C++11 and above
|
||||
|
||||
__type The same type as `T volatile` for all `T`.
|
||||
|
||||
__std_ref 3.9.3.
|
||||
|
||||
@@ -15,6 +15,7 @@ __header ` #include <boost/type_traits/common_type.hpp>` or ` #include <boost/ty
|
||||
|
||||
namespace boost {
|
||||
template <class... T> struct common_type;
|
||||
template<class... T> using common_type_t = typename common_type<T...>::type; // C++11 and above
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ __header ` #include <boost/type_traits/conditional.hpp>` or ` #include <boost/ty
|
||||
|
||||
namespace boost {
|
||||
template <bool B, class T, class U> struct __conditional;
|
||||
template <bool B, class T, class U> using conditional_t = typename conditional<B, T, U>::type; // C++11 and above
|
||||
}
|
||||
|
||||
If B is true, the member typedef type shall equal T. If B is false, the member typedef type shall equal U.
|
||||
|
||||
+3
-1
@@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T, class U> using copy_cv_t = typename copy_cv<T, U>::type; // C++11 and above
|
||||
|
||||
__type [^T /cv/], where /cv/ are the cv-qualifiers of `U`.
|
||||
|
||||
__header ` #include <boost/type_traits/copy_cv.hpp>` or ` #include <boost/type_traits.hpp>`
|
||||
|
||||
+3
-1
@@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using decay_t = typename decay<T>::type; // C++11 and above
|
||||
|
||||
__type Let `U` be the result of `remove_reference<T>::type`, then if `U` is
|
||||
an array type, the result is `remove_extent<U>::type*`, otherwise if `U` is a
|
||||
function type then the result is `U*`, otherwise the result is `U`.
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using floating_point_promotion_t = typename floating_point_promotion<T>::type; // C++11 and above
|
||||
|
||||
__type If floating point promotion can be applied to an rvalue of type `T`,
|
||||
then applies floating point promotion to `T` and keeps cv-qualifiers of `T`,
|
||||
otherwise leaves `T` unchanged.
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using integral_promotion_t = typename integral_promotion<T>::type; // C++11 and above
|
||||
|
||||
__type If integral promotion can be applied to an rvalue of type `T`, then
|
||||
applies integral promotion to `T` and keeps cv-qualifiers of `T`,
|
||||
otherwise leaves `T` unchanged.
|
||||
|
||||
+3
-1
@@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using make_signed_t = typename make_signed<T>::type; // C++11 and above
|
||||
|
||||
__type If T is a signed integer type then the same type as T, if T is an
|
||||
unsigned integer type then the corresponding signed type.
|
||||
Otherwise if T is an enumerated or
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using make_unsigned_t = typename make_unsigned<T>::type; // C++11 and above
|
||||
|
||||
__type If T is a unsigned integer type then the same type as T, if T is an
|
||||
signed integer type then the corresponding unsigned type.
|
||||
Otherwise if T is an enumerated or
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
template <class T> using promote_t = typename promote<T>::type; // C++11 and above
|
||||
|
||||
__type If integral or floating point promotion can be applied to an rvalue
|
||||
of type `T`, then applies integral and floating point promotions to `T` and
|
||||
keeps cv-qualifiers of `T`, otherwise leaves `T` unchanged. See also
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using remove_all_extents_t = typename remove_all_extents<T>::type; // C++11 and above
|
||||
|
||||
__type If `T` is an array type, then removes all of the array bounds on `T`, otherwise
|
||||
leaves `T` unchanged.
|
||||
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using remove_const_t = typename remove_const<T>::type; // C++11 and above
|
||||
|
||||
__type The same type as `T`, but with any /top level/ const-qualifier removed.
|
||||
|
||||
__std_ref 3.9.3.
|
||||
|
||||
+3
-1
@@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using remove_cv_t = typename remove_cv<T>::type; // C++11 and above
|
||||
|
||||
__type The same type as `T`, but with any /top level/ cv-qualifiers removed.
|
||||
|
||||
__std_ref 3.9.3.
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using remove_extent_t = typename remove_extent<T>::type; // C++11 and above
|
||||
|
||||
__type If `T` is an array type, then removes the topmost array bound,
|
||||
otherwise leaves `T` unchanged.
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
template <class T> using remove_pointer_t = typename remove_pointer<T>::type; // C++11 and above
|
||||
|
||||
__type The same type as `T`, but with any pointer modifier removed. Note that pointers to members are left unchanged:
|
||||
removing the pointer decoration would result in an invalid type.
|
||||
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using remove_reference_t = typename remove_reference<T>::type; // C++11 and above
|
||||
|
||||
__type The same type as `T`, but with any reference modifier removed.
|
||||
|
||||
__std_ref 8.3.2.
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
{
|
||||
typedef __below type;
|
||||
};
|
||||
|
||||
|
||||
template <class T> using remove_volatile_t = typename remove_volatile<T>::type; // C++11 and above
|
||||
|
||||
__type The same type as `T`, but with any /top level/ volatile-qualifier removed.
|
||||
|
||||
__std_ref 3.9.3.
|
||||
|
||||
Reference in New Issue
Block a user