())), True>
- > {};
+ constexpr bool DestroyTest
+ = IsSame(), declval())), True>;
template
inline void destroy(True, A &a, T *p) {
@@ -982,7 +963,7 @@ namespace detail {
template
inline void allocator_destroy(A &a, T *p) {
- detail::destroy(detail::DestroyTest(), a, p);
+ detail::destroy(BoolConstant>(), a, p);
}
/* allocator max size */
@@ -995,9 +976,8 @@ namespace detail {
auto alloc_max_size_test(const A &) -> False;
template
- struct AllocMaxSizeTest: Constant())), True>
- > {};
+ constexpr bool AllocMaxSizeTest
+ = IsSame())), True>;
template
inline AllocatorSize alloc_max_size(True, const A &a) {
@@ -1012,7 +992,9 @@ namespace detail {
template
inline AllocatorSize allocator_max_size(const A &a) {
- return detail::alloc_max_size(detail::AllocMaxSizeTest(), a);
+ return detail::alloc_max_size(BoolConstant<
+ detail::AllocMaxSizeTest
+ >(), a);
}
/* allocator container copy */
@@ -1025,9 +1007,8 @@ namespace detail {
auto alloc_copy_test(const A &) -> False;
template
- struct AllocCopyTest: Constant())), True>
- > {};
+ constexpr bool AllocCopyTest
+ = IsSame())), True>;
template
inline AllocatorType alloc_container_copy(True, const A &a) {
@@ -1042,8 +1023,8 @@ namespace detail {
template
inline AllocatorType allocator_container_copy(const A &a) {
- return detail::alloc_container_copy(detail::AllocCopyTest<
- const A
+ return detail::alloc_container_copy(BoolConstant<
+ detail::AllocCopyTest
>(), a);
}
diff --git a/ostd/string.hh b/ostd/string.hh
index 440f688..34ae138 100644
--- a/ostd/string.hh
+++ b/ostd/string.hh
@@ -340,7 +340,7 @@ public:
StringBase &operator=(const StringBase &v) {
if (this == &v) return *this;
clear();
- if (AllocatorPropagateOnContainerCopyAssignment::value) {
+ if (AllocatorPropagateOnContainerCopyAssignment) {
if ((p_buf.second() != v.p_buf.second()) && p_cap) {
allocator_deallocate(p_buf.second(), p_buf.first(), p_cap);
p_cap = 0;
@@ -360,7 +360,7 @@ public:
StringBase &operator=(StringBase &&v) {
clear();
if (p_cap) allocator_deallocate(p_buf.second(), p_buf.first(), p_cap);
- if (AllocatorPropagateOnContainerMoveAssignment::value)
+ if (AllocatorPropagateOnContainerMoveAssignment)
p_buf.second() = v.p_buf.second();
p_len = v.p_len;
p_cap = v.p_cap;
@@ -542,7 +542,7 @@ public:
detail::swap_adl(p_len, v.p_len);
detail::swap_adl(p_cap, v.p_cap);
detail::swap_adl(p_buf.first(), v.p_buf.first());
- if (AllocatorPropagateOnContainerSwap::value)
+ if (AllocatorPropagateOnContainerSwap)
detail::swap_adl(p_buf.second(), v.p_buf.second());
}
diff --git a/ostd/vector.hh b/ostd/vector.hh
index edf30da..2bdda21 100644
--- a/ostd/vector.hh
+++ b/ostd/vector.hh
@@ -173,7 +173,7 @@ public:
Vector &operator=(const Vector &v) {
if (this == &v) return *this;
clear();
- if (AllocatorPropagateOnContainerCopyAssignment::value) {
+ if (AllocatorPropagateOnContainerCopyAssignment) {
if (p_buf.second() != v.p_buf.second() && p_cap) {
allocator_deallocate(p_buf.second(), p_buf.first(), p_cap);
p_cap = 0;
@@ -190,7 +190,7 @@ public:
clear();
if (p_buf.first())
allocator_deallocate(p_buf.second(), p_buf.first(), p_cap);
- if (AllocatorPropagateOnContainerMoveAssignment::value)
+ if (AllocatorPropagateOnContainerMoveAssignment)
p_buf.second() = v.p_buf.second();
p_len = v.p_len;
p_cap = v.p_cap;
@@ -414,7 +414,7 @@ public:
detail::swap_adl(p_len, v.p_len);
detail::swap_adl(p_cap, v.p_cap);
detail::swap_adl(p_buf.first(), v.p_buf.first());
- if (AllocatorPropagateOnContainerSwap::value)
+ if (AllocatorPropagateOnContainerSwap)
detail::swap_adl(p_buf.second(), v.p_buf.second());
}