default-clear all converted_endian parrays to zero

This commit is contained in:
Martin Michelsen
2023-09-21 17:07:58 -07:00
parent 931258e8ac
commit 93906f8ff3
4 changed files with 32 additions and 105 deletions
+6 -3
View File
@@ -190,15 +190,18 @@ struct parray {
parray(ItemT v) {
this->clear(v);
}
template <typename ArgT = ItemT, std::enable_if_t<std::is_arithmetic<ArgT>::value, bool> = true>
template <typename ArgT = ItemT>
requires(std::is_arithmetic_v<ArgT> || is_converted_endian_sc_v<ArgT>)
parray() {
this->clear(0);
}
template <typename ArgT = ItemT, std::enable_if_t<std::is_pointer<ArgT>::value, bool> = true>
template <typename ArgT = ItemT>
requires std::is_pointer_v<ArgT>
parray() {
this->clear(nullptr);
}
template <typename ArgT = ItemT, std::enable_if_t<!std::is_arithmetic<ArgT>::value && !std::is_pointer<ArgT>::value, bool> = true>
template <typename ArgT = ItemT>
requires(!std::is_arithmetic_v<ArgT> && !std::is_pointer_v<ArgT> && !is_converted_endian_sc_v<ArgT>)
parray() {}
parray(const parray& other) {