From 17a4b17bc5ef6e3bdafa7278c34f86400dd4f309 Mon Sep 17 00:00:00 2001 From: Sven Göthel Date: Sun, 19 May 2024 17:12:32 +0200 Subject: darray: C++20 cleanup; Add resize(); Fix reallocStore()==0 and allocStore()==0 only failure if size > 0 as a zero size (null memory) shrink_to_fit() is legal; Fix erase() arg types Cleanup C++20 - Add constexpr.. - Use std::numbers::phi_v for golden ratio - Use _v and _t type trait macros --- test/test_datatype01.hpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'test/test_datatype01.hpp') diff --git a/test/test_datatype01.hpp b/test/test_datatype01.hpp index a972b3d..64daf93 100644 --- a/test/test_datatype01.hpp +++ b/test/test_datatype01.hpp @@ -25,7 +25,6 @@ #define TEST_DATATYPE01_HPP_ #include -#include #include #include #include @@ -154,8 +153,8 @@ class DataType01 { constexpr DataType01() noexcept : address(), type{0} { } DataType01(const DataType01 &o) noexcept : address(o.address), type(o.type) { } DataType01(DataType01 &&o) noexcept { - address = std::move(o.address); - type = std::move(o.type); + address = o.address; + type = o.type; } constexpr DataType01& operator=(const DataType01 &o) noexcept { address = o.address; @@ -163,8 +162,8 @@ class DataType01 { return *this; } DataType01& operator=(DataType01 &&o) noexcept { - address = std::move(o.address); - type = std::move(o.type); + address = o.address; + type = o.type; return *this; } @@ -234,8 +233,8 @@ class DataType02_Memmove_Secmem { constexpr DataType02_Memmove_Secmem() noexcept : address(), type{0} { } DataType02_Memmove_Secmem(const DataType02_Memmove_Secmem &o) noexcept : address(o.address), type(o.type) { } DataType02_Memmove_Secmem(DataType02_Memmove_Secmem &&o) noexcept { - address = std::move(o.address); - type = std::move(o.type); + address = o.address; + type = o.type; } constexpr DataType02_Memmove_Secmem& operator=(const DataType02_Memmove_Secmem &o) noexcept { address = o.address; @@ -243,8 +242,8 @@ class DataType02_Memmove_Secmem { return *this; } DataType02_Memmove_Secmem& operator=(DataType02_Memmove_Secmem &&o) noexcept { - address = std::move(o.address); - type = std::move(o.type); + address = o.address; + type = o.type; return *this; } -- cgit v1.2.3