Skip to content

Commit 263055e

Browse files
Romain-Geissler-1Asbiscigl
authored andcommitted
Stop using the now deprecated std::is_trivial.
std::is_trivial is deprecated in C++26. Using gcc 15 and C++26 yields this warning: /data/mwrep/res/mdw/SIOTF/internal/osp/aws_sdk/25-0-0-1/include/aws/core/utils/memory/AWSMemory.h: In function 'Aws::UniquePtr<T> Aws::MakeUnique(const char*, ArgTypes&& ...)': /data/mwrep/res/mdw/SIOTF/internal/osp/aws_sdk/25-0-0-1/include/aws/core/utils/memory/AWSMemory.h:307:56: error: 'template<class _Tp> struct std::is_trivial' is deprecated: use 'is_trivially_default_constructible && is_triviall y_copyable' instead [-Werror=deprecated-declarations] 307 | static_assert(!std::is_array<T>::value || std::is_trivial<T>::value, | ^~~~~~~~~~ So do as gcc suggests, and replace it by a combination of is_trivially_default_constructible and is_trivially_copyable.
1 parent d2f1cf3 commit 263055e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • src/aws-cpp-sdk-core/include/aws/core/utils/memory

src/aws-cpp-sdk-core/include/aws/core/utils/memory/AWSMemory.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,15 +304,15 @@ namespace Aws
304304
template<typename T, typename ...ArgTypes>
305305
UniquePtr<T> MakeUnique(const char* allocationTag, ArgTypes&&... args)
306306
{
307-
static_assert(!std::is_array<T>::value || std::is_trivial<T>::value,
307+
static_assert(!std::is_array<T>::value || (std::is_trivially_default_constructible<T>::value && std::is_trivially_copyable<T>::value),
308308
"This wrapper/function is not designed to support non-trivial arrays.");
309309
return UniquePtr<T>(Aws::New<T>(allocationTag, std::forward<ArgTypes>(args)...));
310310
}
311311

312312
template<typename T, typename D = Deleter<T>, typename ...ArgTypes>
313313
UniquePtrSafeDeleted<T, D> MakeUniqueSafeDeleted(const char* allocationTag, ArgTypes&&... args)
314314
{
315-
static_assert(!std::is_array<T>::value || std::is_trivial<T>::value,
315+
static_assert(!std::is_array<T>::value || (std::is_trivially_default_constructible<T>::value && std::is_trivially_copyable<T>::value),
316316
"This wrapper/function is not designed to support non-trivial arrays.");
317317

318318
return UniquePtrSafeDeleted<T, D>(Aws::New<T>(allocationTag, std::forward<ArgTypes>(args)...), D());

0 commit comments

Comments
 (0)