type renames
parent
6eae6487c4
commit
d4e234f893
|
@ -591,8 +591,8 @@ namespace detail {
|
||||||
|
|
||||||
template<typename R, typename ...Args>
|
template<typename R, typename ...Args>
|
||||||
struct Function<R(Args...)>: octa::detail::FunctionBase<R, Args...> {
|
struct Function<R(Args...)>: octa::detail::FunctionBase<R, Args...> {
|
||||||
Function( ) { init_empty(); }
|
Function( ) { init_empty(); }
|
||||||
Function(nullptr_t) { init_empty(); }
|
Function(Nullptr) { init_empty(); }
|
||||||
|
|
||||||
Function(Function &&f) {
|
Function(Function &&f) {
|
||||||
init_empty();
|
init_empty();
|
||||||
|
@ -619,7 +619,7 @@ struct Function<R(Args...)>: octa::detail::FunctionBase<R, Args...> {
|
||||||
Function(octa::AllocatorArg, const A &) { init_empty(); }
|
Function(octa::AllocatorArg, const A &) { init_empty(); }
|
||||||
|
|
||||||
template<typename A>
|
template<typename A>
|
||||||
Function(octa::AllocatorArg, const A &, nullptr_t) { init_empty(); }
|
Function(octa::AllocatorArg, const A &, Nullptr) { init_empty(); }
|
||||||
|
|
||||||
template<typename A>
|
template<typename A>
|
||||||
Function(octa::AllocatorArg, const A &, Function &&f) {
|
Function(octa::AllocatorArg, const A &, Function &&f) {
|
||||||
|
@ -739,16 +739,16 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool operator==(nullptr_t, const Function<T> &rhs) { return !rhs; }
|
bool operator==(Nullptr, const Function<T> &rhs) { return !rhs; }
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool operator==(const Function<T> &lhs, nullptr_t) { return !lhs; }
|
bool operator==(const Function<T> &lhs, Nullptr) { return !lhs; }
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool operator!=(nullptr_t, const Function<T> &rhs) { return rhs; }
|
bool operator!=(Nullptr, const Function<T> &rhs) { return rhs; }
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
bool operator!=(const Function<T> &lhs, nullptr_t) { return lhs; }
|
bool operator!=(const Function<T> &lhs, Nullptr) { return lhs; }
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
template<typename F>
|
template<typename F>
|
||||||
|
|
|
@ -284,7 +284,7 @@ public:
|
||||||
static_assert(!octa::IsPointer<D>::value,
|
static_assert(!octa::IsPointer<D>::value,
|
||||||
"Box constructed with null fptr deleter");
|
"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<D>::value,
|
static_assert(!octa::IsPointer<D>::value,
|
||||||
"Box constructed with null fptr deleter");
|
"Box constructed with null fptr deleter");
|
||||||
}
|
}
|
||||||
|
@ -330,7 +330,7 @@ public:
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
Box &operator=(nullptr_t) {
|
Box &operator=(Nullptr) {
|
||||||
reset();
|
reset();
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
@ -403,7 +403,7 @@ public:
|
||||||
static_assert(!octa::IsPointer<D>::value,
|
static_assert(!octa::IsPointer<D>::value,
|
||||||
"Box constructed with null fptr deleter");
|
"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<D>::value,
|
static_assert(!octa::IsPointer<D>::value,
|
||||||
"Box constructed with null fptr deleter");
|
"Box constructed with null fptr deleter");
|
||||||
}
|
}
|
||||||
|
@ -421,7 +421,7 @@ public:
|
||||||
> d, octa::EnableIf<octa::detail::SameOrLessCvQualified<U, Pointer>::value,
|
> d, octa::EnableIf<octa::detail::SameOrLessCvQualified<U, Pointer>::value,
|
||||||
Nat> = Nat()): p_stor(p, d) {}
|
Nat> = Nat()): p_stor(p, d) {}
|
||||||
|
|
||||||
Box(nullptr_t, octa::Conditional<octa::IsReference<D>::value,
|
Box(Nullptr, octa::Conditional<octa::IsReference<D>::value,
|
||||||
D, AddLvalueReference<const D>
|
D, AddLvalueReference<const D>
|
||||||
> d): p_stor(nullptr, d) {}
|
> d): p_stor(nullptr, d) {}
|
||||||
|
|
||||||
|
@ -433,7 +433,7 @@ public:
|
||||||
"rvalue deleter cannot be a ref");
|
"rvalue deleter cannot be a ref");
|
||||||
}
|
}
|
||||||
|
|
||||||
Box(nullptr_t, octa::RemoveReference<D> &&d):
|
Box(Nullptr, octa::RemoveReference<D> &&d):
|
||||||
p_stor(nullptr, octa::move(d)) {
|
p_stor(nullptr, octa::move(d)) {
|
||||||
static_assert(!octa::IsReference<D>::value,
|
static_assert(!octa::IsReference<D>::value,
|
||||||
"rvalue deleter cannot be a ref");
|
"rvalue deleter cannot be a ref");
|
||||||
|
@ -468,7 +468,7 @@ public:
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
Box &operator=(nullptr_t) {
|
Box &operator=(Nullptr) {
|
||||||
reset();
|
reset();
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
@ -502,7 +502,7 @@ public:
|
||||||
if (tmp) p_stor.get_deleter()(tmp);
|
if (tmp) p_stor.get_deleter()(tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void reset(nullptr_t) {
|
void reset(Nullptr) {
|
||||||
Pointer tmp = p_stor.p_ptr;
|
Pointer tmp = p_stor.p_ptr;
|
||||||
p_stor.p_ptr = nullptr;
|
p_stor.p_ptr = nullptr;
|
||||||
if (tmp) p_stor.get_deleter()(tmp);
|
if (tmp) p_stor.get_deleter()(tmp);
|
||||||
|
|
|
@ -80,8 +80,8 @@ namespace detail {
|
||||||
/* is null pointer */
|
/* is null pointer */
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
template<typename> struct IsNullPointerBase : False {};
|
template<typename> struct IsNullPointerBase : False {};
|
||||||
template< > struct IsNullPointerBase<nullptr_t>: True {};
|
template< > struct IsNullPointerBase<Nullptr>: True {};
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T> struct IsNullPointer:
|
template<typename T> struct IsNullPointer:
|
||||||
|
@ -1114,7 +1114,7 @@ namespace detail {
|
||||||
template<size_t N> struct AlignedTest {
|
template<size_t N> struct AlignedTest {
|
||||||
union type {
|
union type {
|
||||||
uchar data[N];
|
uchar data[N];
|
||||||
octa::max_align_t align;
|
octa::MaxAlign align;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -21,12 +21,12 @@ using llong = long long;
|
||||||
|
|
||||||
using ldouble = long double;
|
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)
|
#if defined(__CLANG_MAX_ALIGN_T_DEFINED) || defined(_GCC_MAX_ALIGN_T)
|
||||||
using ::max_align_t;
|
using MaxAlign = ::max_align_t;
|
||||||
#else
|
#else
|
||||||
using max_align_t = long double;
|
using MaxAlign = long double;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue