mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-24 12:02:36 +08:00
[libcxx] [test] Rename _Tp to T. NFCI.
This improves readability and (theoretically) improves portability, as _Ugly names are reserved. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@310758 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -20,7 +20,7 @@ struct not_an_iterator
|
|||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class T>
|
||||||
struct has_value_type
|
struct has_value_type
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
@@ -28,7 +28,7 @@ private:
|
|||||||
template <class _Up> static two test(...);
|
template <class _Up> static two test(...);
|
||||||
template <class _Up> static char test(typename _Up::value_type* = 0);
|
template <class _Up> static char test(typename _Up::value_type* = 0);
|
||||||
public:
|
public:
|
||||||
static const bool value = sizeof(test<_Tp>(0)) == 1;
|
static const bool value = sizeof(test<T>(0)) == 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
|
|||||||
@@ -37,8 +37,8 @@
|
|||||||
round_style
|
round_style
|
||||||
*/
|
*/
|
||||||
|
|
||||||
template <class _Tp>
|
template <class T>
|
||||||
void test(const _Tp &) {}
|
void test(const T &) {}
|
||||||
|
|
||||||
#define TEST_NUMERIC_LIMITS(type) \
|
#define TEST_NUMERIC_LIMITS(type) \
|
||||||
test(std::numeric_limits<type>::is_specialized); \
|
test(std::numeric_limits<type>::is_specialized); \
|
||||||
|
|||||||
@@ -36,8 +36,8 @@
|
|||||||
#include <locale>
|
#include <locale>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
template <class _Tp>
|
template <class T>
|
||||||
void test(const _Tp &) {}
|
void test(const T &) {}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -27,8 +27,8 @@
|
|||||||
#include <locale>
|
#include <locale>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
template <class _Tp>
|
template <class T>
|
||||||
void test(const _Tp &) {}
|
void test(const T &) {}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -20,8 +20,8 @@
|
|||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
template <class _Tp>
|
template <class T>
|
||||||
void test(const _Tp &) {}
|
void test(const T &) {}
|
||||||
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
|
|||||||
@@ -25,20 +25,20 @@
|
|||||||
|
|
||||||
#include "test_iterators.h"
|
#include "test_iterators.h"
|
||||||
|
|
||||||
template <class _Tp = void>
|
template <class T = void>
|
||||||
struct identity : std::unary_function<_Tp, _Tp>
|
struct identity : std::unary_function<T, T>
|
||||||
{
|
{
|
||||||
constexpr const _Tp& operator()(const _Tp& __x) const { return __x;}
|
constexpr const T& operator()(const T& __x) const { return __x;}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct identity<void>
|
struct identity<void>
|
||||||
{
|
{
|
||||||
template <class _Tp>
|
template <class T>
|
||||||
constexpr auto operator()(_Tp&& __x) const
|
constexpr auto operator()(T&& __x) const
|
||||||
_NOEXCEPT_(noexcept(_VSTD::forward<_Tp>(__x)))
|
_NOEXCEPT_(noexcept(_VSTD::forward<T>(__x)))
|
||||||
-> decltype (_VSTD::forward<_Tp>(__x))
|
-> decltype (_VSTD::forward<T>(__x))
|
||||||
{ return _VSTD::forward<_Tp>(__x); }
|
{ return _VSTD::forward<T>(__x); }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class Iter1, class BOp, class UOp, class T, class Iter2>
|
template <class Iter1, class BOp, class UOp, class T, class Iter2>
|
||||||
|
|||||||
@@ -25,20 +25,20 @@
|
|||||||
|
|
||||||
#include "test_iterators.h"
|
#include "test_iterators.h"
|
||||||
|
|
||||||
template <class _Tp = void>
|
template <class T = void>
|
||||||
struct identity : std::unary_function<_Tp, _Tp>
|
struct identity : std::unary_function<T, T>
|
||||||
{
|
{
|
||||||
constexpr const _Tp& operator()(const _Tp& __x) const { return __x;}
|
constexpr const T& operator()(const T& __x) const { return __x;}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct identity<void>
|
struct identity<void>
|
||||||
{
|
{
|
||||||
template <class _Tp>
|
template <class T>
|
||||||
constexpr auto operator()(_Tp&& __x) const
|
constexpr auto operator()(T&& __x) const
|
||||||
_NOEXCEPT_(noexcept(_VSTD::forward<_Tp>(__x)))
|
_NOEXCEPT_(noexcept(_VSTD::forward<T>(__x)))
|
||||||
-> decltype (_VSTD::forward<_Tp>(__x))
|
-> decltype (_VSTD::forward<T>(__x))
|
||||||
{ return _VSTD::forward<_Tp>(__x); }
|
{ return _VSTD::forward<T>(__x); }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class Iter1, class BOp, class UOp, class Iter2>
|
template <class Iter1, class BOp, class UOp, class Iter2>
|
||||||
|
|||||||
@@ -25,20 +25,20 @@
|
|||||||
|
|
||||||
#include "test_iterators.h"
|
#include "test_iterators.h"
|
||||||
|
|
||||||
template <class _Tp = void>
|
template <class T = void>
|
||||||
struct identity : std::unary_function<_Tp, _Tp>
|
struct identity : std::unary_function<T, T>
|
||||||
{
|
{
|
||||||
constexpr const _Tp& operator()(const _Tp& __x) const { return __x;}
|
constexpr const T& operator()(const T& __x) const { return __x;}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct identity<void>
|
struct identity<void>
|
||||||
{
|
{
|
||||||
template <class _Tp>
|
template <class T>
|
||||||
constexpr auto operator()(_Tp&& __x) const
|
constexpr auto operator()(T&& __x) const
|
||||||
_NOEXCEPT_(noexcept(_VSTD::forward<_Tp>(__x)))
|
_NOEXCEPT_(noexcept(_VSTD::forward<T>(__x)))
|
||||||
-> decltype (_VSTD::forward<_Tp>(__x))
|
-> decltype (_VSTD::forward<T>(__x))
|
||||||
{ return _VSTD::forward<_Tp>(__x); }
|
{ return _VSTD::forward<T>(__x); }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class Iter1, class BOp, class UOp, class T, class Iter2>
|
template <class Iter1, class BOp, class UOp, class T, class Iter2>
|
||||||
|
|||||||
@@ -21,34 +21,34 @@
|
|||||||
|
|
||||||
#include "test_iterators.h"
|
#include "test_iterators.h"
|
||||||
|
|
||||||
template <class _Tp = void>
|
template <class T = void>
|
||||||
struct identity : std::unary_function<_Tp, _Tp>
|
struct identity : std::unary_function<T, T>
|
||||||
{
|
{
|
||||||
constexpr const _Tp& operator()(const _Tp& __x) const { return __x;}
|
constexpr const T& operator()(const T& __x) const { return __x;}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct identity<void>
|
struct identity<void>
|
||||||
{
|
{
|
||||||
template <class _Tp>
|
template <class T>
|
||||||
constexpr auto operator()(_Tp&& __x) const
|
constexpr auto operator()(T&& __x) const
|
||||||
_NOEXCEPT_(noexcept(_VSTD::forward<_Tp>(__x)))
|
_NOEXCEPT_(noexcept(_VSTD::forward<T>(__x)))
|
||||||
-> decltype (_VSTD::forward<_Tp>(__x))
|
-> decltype (_VSTD::forward<T>(__x))
|
||||||
{ return _VSTD::forward<_Tp>(__x); }
|
{ return _VSTD::forward<T>(__x); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
template <class _Tp = void>
|
template <class T = void>
|
||||||
struct twice
|
struct twice
|
||||||
{
|
{
|
||||||
constexpr const _Tp operator()(const _Tp& __x) const noexcept { return 2 * __x; }
|
constexpr const T operator()(const T& __x) const noexcept { return 2 * __x; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct twice<void>
|
struct twice<void>
|
||||||
{
|
{
|
||||||
template <class _Tp>
|
template <class T>
|
||||||
constexpr auto operator()(const _Tp& __x) const
|
constexpr auto operator()(const T& __x) const
|
||||||
_NOEXCEPT_(noexcept(2 * __x))
|
_NOEXCEPT_(noexcept(2 * __x))
|
||||||
-> decltype (2 * __x)
|
-> decltype (2 * __x)
|
||||||
{ return 2 * __x; }
|
{ return 2 * __x; }
|
||||||
|
|||||||
@@ -28,8 +28,8 @@
|
|||||||
|
|
||||||
#include "test_macros.h"
|
#include "test_macros.h"
|
||||||
|
|
||||||
template <class _Tp>
|
template <class T>
|
||||||
void where(const _Tp &) {}
|
void where(const T &) {}
|
||||||
|
|
||||||
void
|
void
|
||||||
test1()
|
test1()
|
||||||
|
|||||||
@@ -27,8 +27,8 @@
|
|||||||
|
|
||||||
#include "test_macros.h"
|
#include "test_macros.h"
|
||||||
|
|
||||||
template <class _Tp>
|
template <class T>
|
||||||
void where(const _Tp &) {}
|
void where(const T &) {}
|
||||||
|
|
||||||
void
|
void
|
||||||
test1()
|
test1()
|
||||||
|
|||||||
@@ -27,8 +27,8 @@
|
|||||||
|
|
||||||
#include "test_macros.h"
|
#include "test_macros.h"
|
||||||
|
|
||||||
template <class _Tp>
|
template <class T>
|
||||||
void where(const _Tp &) {}
|
void where(const T &) {}
|
||||||
|
|
||||||
template <class T, T a, T c, T m>
|
template <class T, T a, T c, T m>
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -42,8 +42,8 @@
|
|||||||
|
|
||||||
#include "test_macros.h"
|
#include "test_macros.h"
|
||||||
|
|
||||||
template <class _Tp>
|
template <class T>
|
||||||
void where(const _Tp &) {}
|
void where(const T &) {}
|
||||||
|
|
||||||
void
|
void
|
||||||
test1()
|
test1()
|
||||||
|
|||||||
@@ -30,8 +30,8 @@
|
|||||||
|
|
||||||
#include "test_macros.h"
|
#include "test_macros.h"
|
||||||
|
|
||||||
template <class _Tp>
|
template <class T>
|
||||||
void where(const _Tp &) {}
|
void where(const T &) {}
|
||||||
|
|
||||||
void
|
void
|
||||||
test1()
|
test1()
|
||||||
|
|||||||
@@ -29,8 +29,8 @@
|
|||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include "test_macros.h"
|
#include "test_macros.h"
|
||||||
|
|
||||||
template <class _Tp>
|
template <class T>
|
||||||
void where(const _Tp &) {}
|
void where(const T &) {}
|
||||||
|
|
||||||
template <class CharT>
|
template <class CharT>
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#include <functional>
|
#include <functional>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
template <class _Tp>
|
template <class T>
|
||||||
struct is_transparent
|
struct is_transparent
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
@@ -19,7 +19,7 @@ private:
|
|||||||
template <class _Up> static __two __test(...);
|
template <class _Up> static __two __test(...);
|
||||||
template <class _Up> static char __test(typename _Up::is_transparent* = 0);
|
template <class _Up> static char __test(typename _Up::is_transparent* = 0);
|
||||||
public:
|
public:
|
||||||
static const bool value = sizeof(__test<_Tp>(0)) == 1;
|
static const bool value = sizeof(__test<T>(0)) == 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#include <functional>
|
#include <functional>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
template <class _Tp>
|
template <class T>
|
||||||
struct is_transparent
|
struct is_transparent
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
@@ -19,7 +19,7 @@ private:
|
|||||||
template <class _Up> static __two __test(...);
|
template <class _Up> static __two __test(...);
|
||||||
template <class _Up> static char __test(typename _Up::is_transparent* = 0);
|
template <class _Up> static char __test(typename _Up::is_transparent* = 0);
|
||||||
public:
|
public:
|
||||||
static const bool value = sizeof(__test<_Tp>(0)) == 1;
|
static const bool value = sizeof(__test<T>(0)) == 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#include <functional>
|
#include <functional>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
template <class _Tp>
|
template <class T>
|
||||||
struct is_transparent
|
struct is_transparent
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
@@ -19,7 +19,7 @@ private:
|
|||||||
template <class _Up> static __two __test(...);
|
template <class _Up> static __two __test(...);
|
||||||
template <class _Up> static char __test(typename _Up::is_transparent* = 0);
|
template <class _Up> static char __test(typename _Up::is_transparent* = 0);
|
||||||
public:
|
public:
|
||||||
static const bool value = sizeof(__test<_Tp>(0)) == 1;
|
static const bool value = sizeof(__test<T>(0)) == 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#include <functional>
|
#include <functional>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
template <class _Tp>
|
template <class T>
|
||||||
struct is_transparent
|
struct is_transparent
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
@@ -19,7 +19,7 @@ private:
|
|||||||
template <class _Up> static __two __test(...);
|
template <class _Up> static __two __test(...);
|
||||||
template <class _Up> static char __test(typename _Up::is_transparent* = 0);
|
template <class _Up> static char __test(typename _Up::is_transparent* = 0);
|
||||||
public:
|
public:
|
||||||
static const bool value = sizeof(__test<_Tp>(0)) == 1;
|
static const bool value = sizeof(__test<T>(0)) == 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -24,8 +24,8 @@
|
|||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
|
||||||
template <class _Tp>
|
template <class T>
|
||||||
void test(const _Tp &) {}
|
void test(const T &) {}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,8 +26,8 @@
|
|||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
|
||||||
template <class _Tp>
|
template <class T>
|
||||||
void test(const _Tp &) {}
|
void test(const T &) {}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,8 +24,8 @@
|
|||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
|
||||||
template <class _Tp>
|
template <class T>
|
||||||
void test(const _Tp &) {}
|
void test(const T &) {}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,13 +24,13 @@ namespace std { namespace experimental {} }
|
|||||||
#define RTTI_ASSERT(X)
|
#define RTTI_ASSERT(X)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
template <class _Tp>
|
template <class T>
|
||||||
struct IsSmallObject
|
struct IsSmallObject
|
||||||
: public std::integral_constant<bool
|
: public std::integral_constant<bool
|
||||||
, sizeof(_Tp) <= (sizeof(void*)*3)
|
, sizeof(T) <= (sizeof(void*)*3)
|
||||||
&& std::alignment_of<void*>::value
|
&& std::alignment_of<void*>::value
|
||||||
% std::alignment_of<_Tp>::value == 0
|
% std::alignment_of<T>::value == 0
|
||||||
&& std::is_nothrow_move_constructible<_Tp>::value
|
&& std::is_nothrow_move_constructible<T>::value
|
||||||
>
|
>
|
||||||
{};
|
{};
|
||||||
|
|
||||||
|
|||||||
@@ -22,13 +22,13 @@
|
|||||||
#define RTTI_ASSERT(X)
|
#define RTTI_ASSERT(X)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
template <class _Tp>
|
template <class T>
|
||||||
struct IsSmallObject
|
struct IsSmallObject
|
||||||
: public std::integral_constant<bool
|
: public std::integral_constant<bool
|
||||||
, sizeof(_Tp) <= (sizeof(void*)*3)
|
, sizeof(T) <= (sizeof(void*)*3)
|
||||||
&& std::alignment_of<void*>::value
|
&& std::alignment_of<void*>::value
|
||||||
% std::alignment_of<_Tp>::value == 0
|
% std::alignment_of<T>::value == 0
|
||||||
&& std::is_nothrow_move_constructible<_Tp>::value
|
&& std::is_nothrow_move_constructible<T>::value
|
||||||
>
|
>
|
||||||
{};
|
{};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user