return _S_nothrow_relocate(__is_move_insertable<_Tp_alloc_type>{});
}
- static pointer
- _S_do_relocate(pointer __first, pointer __last, pointer __result,
- _Tp_alloc_type& __alloc, true_type) noexcept
- {
- return std::__relocate_a(__first, __last, __result, __alloc);
- }
-
- static pointer
- _S_do_relocate(pointer, pointer, pointer __result,
- _Tp_alloc_type&, false_type) noexcept
- { return __result; }
-
static _GLIBCXX20_CONSTEXPR pointer
_S_relocate(pointer __first, pointer __last, pointer __result,
_Tp_alloc_type& __alloc) noexcept
{
-#if __cpp_if_constexpr
- // All callers have already checked _S_use_relocate() so just do it.
- return std::__relocate_a(__first, __last, __result, __alloc);
-#else
- using __do_it = __bool_constant<_S_use_relocate()>;
- return _S_do_relocate(__first, __last, __result, __alloc, __do_it{});
-#endif
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wc++17-extensions" // if constexpr
+ if constexpr (_S_use_relocate())
+ return std::__relocate_a(__first, __last, __result, __alloc);
+ else
+ return __result;
+#pragma GCC diagnostic pop
}
#endif // C++11
_GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wc++17-extensions" // if constexpr
+
template<typename _Tp, typename _Alloc>
_GLIBCXX20_CONSTEXPR
void
const size_type __old_size = size();
pointer __tmp;
#if __cplusplus >= 201103L
- if _GLIBCXX17_CONSTEXPR (_S_use_relocate())
+ if constexpr (_S_use_relocate())
{
__tmp = this->_M_allocate(__n);
- _S_relocate(this->_M_impl._M_start, this->_M_impl._M_finish,
- __tmp, _M_get_Tp_allocator());
+ std::__relocate_a(this->_M_impl._M_start, this->_M_impl._M_finish,
+ __tmp, _M_get_Tp_allocator());
}
else
#endif
this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
}
}
+#pragma GCC diagnostic pop
#if __cplusplus >= 201103L
template<typename _Tp, typename _Alloc>
#endif
}
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wc++17-extensions" // if constexpr
#if __cplusplus >= 201103L
template<typename _Tp, typename _Alloc>
template<typename... _Args>
#endif
#if __cplusplus >= 201103L
- if _GLIBCXX17_CONSTEXPR (_S_use_relocate())
+ if constexpr (_S_use_relocate())
{
// Relocation cannot throw.
- __new_finish = _S_relocate(__old_start, __position.base(),
- __new_start, _M_get_Tp_allocator());
+ __new_finish = std::__relocate_a(__old_start, __position.base(),
+ __new_start,
+ _M_get_Tp_allocator());
++__new_finish;
- __new_finish = _S_relocate(__position.base(), __old_finish,
- __new_finish, _M_get_Tp_allocator());
+ __new_finish = std::__relocate_a(__position.base(), __old_finish,
+ __new_finish,
+ _M_get_Tp_allocator());
}
else
#endif
#endif
#if __cplusplus >= 201103L
- if _GLIBCXX17_CONSTEXPR (_S_use_relocate())
+ if constexpr (_S_use_relocate())
{
// Relocation cannot throw.
- __new_finish = _S_relocate(__old_start, __old_finish,
- __new_start, _M_get_Tp_allocator());
+ __new_finish = std::__relocate_a(__old_start, __old_finish,
+ __new_start,
+ _M_get_Tp_allocator());
++__new_finish;
}
else
this->_M_impl._M_finish = __new_finish;
this->_M_impl._M_end_of_storage = __new_start + __len;
}
+#pragma GCC diagnostic pop
template<typename _Tp, typename _Alloc>
_GLIBCXX20_CONSTEXPR
}
#if __cplusplus >= 201103L
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wc++17-extensions" // if constexpr
template<typename _Tp, typename _Alloc>
_GLIBCXX20_CONSTEXPR
void
std::__uninitialized_default_n_a(__new_start + __size, __n,
_M_get_Tp_allocator());
- if _GLIBCXX17_CONSTEXPR (_S_use_relocate())
+ if constexpr (_S_use_relocate())
{
- _S_relocate(__old_start, __old_finish,
- __new_start, _M_get_Tp_allocator());
+ std::__relocate_a(__old_start, __old_finish,
+ __new_start, _M_get_Tp_allocator());
}
else
{
}
}
}
+#pragma GCC diagnostic pop
template<typename _Tp, typename _Alloc>
_GLIBCXX20_CONSTEXPR