From d4e234f8932674afafe337e977b3bf726a72f755 Mon Sep 17 00:00:00 2001 From: q66 Date: Mon, 8 Jun 2015 01:38:44 +0100 Subject: [PATCH] type renames --- octa/functional.h | 14 +++++++------- octa/memory.h | 14 +++++++------- octa/type_traits.h | 6 +++--- octa/types.h | 6 +++--- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/octa/functional.h b/octa/functional.h index 7b50023..211283f 100644 --- a/octa/functional.h +++ b/octa/functional.h @@ -591,8 +591,8 @@ namespace detail { template struct Function: octa::detail::FunctionBase { - Function( ) { init_empty(); } - Function(nullptr_t) { init_empty(); } + Function( ) { init_empty(); } + Function(Nullptr) { init_empty(); } Function(Function &&f) { init_empty(); @@ -619,7 +619,7 @@ struct Function: octa::detail::FunctionBase { Function(octa::AllocatorArg, const A &) { init_empty(); } template - Function(octa::AllocatorArg, const A &, nullptr_t) { init_empty(); } + Function(octa::AllocatorArg, const A &, Nullptr) { init_empty(); } template Function(octa::AllocatorArg, const A &, Function &&f) { @@ -739,16 +739,16 @@ private: }; template -bool operator==(nullptr_t, const Function &rhs) { return !rhs; } +bool operator==(Nullptr, const Function &rhs) { return !rhs; } template -bool operator==(const Function &lhs, nullptr_t) { return !lhs; } +bool operator==(const Function &lhs, Nullptr) { return !lhs; } template -bool operator!=(nullptr_t, const Function &rhs) { return rhs; } +bool operator!=(Nullptr, const Function &rhs) { return rhs; } template -bool operator!=(const Function &lhs, nullptr_t) { return lhs; } +bool operator!=(const Function &lhs, Nullptr) { return lhs; } namespace detail { template diff --git a/octa/memory.h b/octa/memory.h index 4539f45..da8e9a4 100644 --- a/octa/memory.h +++ b/octa/memory.h @@ -284,7 +284,7 @@ public: static_assert(!octa::IsPointer::value, "Box constructed with null fptr deleter"); } - constexpr Box(nullptr_t): p_stor(nullptr, D()) { + constexpr Box(Nullptr): p_stor(nullptr, D()) { static_assert(!octa::IsPointer::value, "Box constructed with null fptr deleter"); } @@ -330,7 +330,7 @@ public: return *this; } - Box &operator=(nullptr_t) { + Box &operator=(Nullptr) { reset(); return *this; } @@ -403,7 +403,7 @@ public: static_assert(!octa::IsPointer::value, "Box constructed with null fptr deleter"); } - constexpr Box(nullptr_t): p_stor(nullptr, D()) { + constexpr Box(Nullptr): p_stor(nullptr, D()) { static_assert(!octa::IsPointer::value, "Box constructed with null fptr deleter"); } @@ -421,7 +421,7 @@ public: > d, octa::EnableIf::value, Nat> = Nat()): p_stor(p, d) {} - Box(nullptr_t, octa::Conditional::value, + Box(Nullptr, octa::Conditional::value, D, AddLvalueReference > d): p_stor(nullptr, d) {} @@ -433,7 +433,7 @@ public: "rvalue deleter cannot be a ref"); } - Box(nullptr_t, octa::RemoveReference &&d): + Box(Nullptr, octa::RemoveReference &&d): p_stor(nullptr, octa::move(d)) { static_assert(!octa::IsReference::value, "rvalue deleter cannot be a ref"); @@ -468,7 +468,7 @@ public: return *this; } - Box &operator=(nullptr_t) { + Box &operator=(Nullptr) { reset(); return *this; } @@ -502,7 +502,7 @@ public: if (tmp) p_stor.get_deleter()(tmp); } - void reset(nullptr_t) { + void reset(Nullptr) { Pointer tmp = p_stor.p_ptr; p_stor.p_ptr = nullptr; if (tmp) p_stor.get_deleter()(tmp); diff --git a/octa/type_traits.h b/octa/type_traits.h index 180a9da..eec8ca8 100644 --- a/octa/type_traits.h +++ b/octa/type_traits.h @@ -80,8 +80,8 @@ namespace detail { /* is null pointer */ namespace detail { - template struct IsNullPointerBase : False {}; - template< > struct IsNullPointerBase: True {}; + template struct IsNullPointerBase : False {}; + template< > struct IsNullPointerBase: True {}; } template struct IsNullPointer: @@ -1114,7 +1114,7 @@ namespace detail { template struct AlignedTest { union type { uchar data[N]; - octa::max_align_t align; + octa::MaxAlign align; }; }; diff --git a/octa/types.h b/octa/types.h index 68eb942..2623300 100644 --- a/octa/types.h +++ b/octa/types.h @@ -21,12 +21,12 @@ using llong = long long; using ldouble = long double; -using nullptr_t = decltype(nullptr); +using Nullptr = decltype(nullptr); #if defined(__CLANG_MAX_ALIGN_T_DEFINED) || defined(_GCC_MAX_ALIGN_T) -using ::max_align_t; +using MaxAlign = ::max_align_t; #else -using max_align_t = long double; +using MaxAlign = long double; #endif }