diff options
author | Sven Göthel <[email protected]> | 2024-05-19 17:12:32 +0200 |
---|---|---|
committer | Sven Göthel <[email protected]> | 2024-05-19 17:12:32 +0200 |
commit | 17a4b17bc5ef6e3bdafa7278c34f86400dd4f309 (patch) | |
tree | e02f83df3744dcc5e2aa0cc5e83264be6c61c65d /test/test_datatype01.hpp | |
parent | 4af73ef5401ff284991ccd7ba590dd49f2704c2b (diff) |
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<float> for golden ratio
- Use _v and _t type trait macros
Diffstat (limited to 'test/test_datatype01.hpp')
-rw-r--r-- | test/test_datatype01.hpp | 17 |
1 files changed, 8 insertions, 9 deletions
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 <cassert> -#include <cinttypes> #include <cstdint> #include <cstring> #include <random> @@ -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; } |