]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: port bitwise relocatable away from is_trivial
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Mon, 9 Dec 2024 01:11:19 +0000 (02:11 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 10 Dec 2024 00:50:25 +0000 (00:50 +0000)
In preparation for the deprecation of is_trivial (P3247R2).
"bitwise relocation" (or "trivial relocation" à la P1144/P2786)
doesn't need the full-fledged notion of triviality, just checking for a
trivial move constructor and a trivial destructor is sufficient.

libstdc++-v3/ChangeLog:

* include/bits/stl_uninitialized.h: Amended the
__is_bitwise_relocatable type trait.

Signed-off-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
libstdc++-v3/include/bits/stl_uninitialized.h

index 2190261134e0a37a34f315c13822ec64db3fe7de..916288352d705e3a8f188e371a5d25092e5fec4f 100644 (file)
@@ -1248,7 +1248,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   // Also known as is_trivially_relocatable.
   template<typename _Tp, typename = void>
     struct __is_bitwise_relocatable
-    : is_trivial<_Tp> { };
+    : __and_<is_trivially_move_constructible<_Tp>, is_trivially_destructible<_Tp>> { };
 
   template <typename _InputIterator, typename _ForwardIterator,
            typename _Allocator>