This commit is contained in:
Timur A. Fatkhullin
2024-05-06 00:05:05 +03:00
parent ba60fadb79
commit 070922e5d5
2 changed files with 111 additions and 7 deletions

View File

@@ -47,7 +47,7 @@ namespace adc
struct AdcValueHolderErrorCategory : public std::error_category {
AdcValueHolderErrorCategory() : std::error_category() {}
const char* name() const noexcept { return "ADC_VALUEHOLDER_CATEGORY"; }
const char* name() const noexcept { return "ADC_VALUE_HOLDER_CATEGORY"; }
std::string message(int ec) const
{
@@ -273,7 +273,7 @@ public:
template <typename UT>
operator UT()
operator UT() const
{
// using v_t = std::remove_reference_t<UT>;
// using val_t = std::conditional_t<std::is_array_v<v_t>, std::add_pointer_t<std::remove_extent_t<v_t>>, v_t>;
@@ -422,6 +422,8 @@ public:
AdcValueHolder::setupTrivialConvertFunc<VALT, std::decay_t<decltype(tpl)>>();
}
AdcSerializingValueHolder(const AdcSerializingValueHolder&) = default;
AdcSerializingValueHolder(AdcSerializingValueHolder&&) = default;
virtual ~AdcSerializingValueHolder() = default;
@@ -474,7 +476,24 @@ public:
void deserialize(const SerializedT& sval) { _deserializerWrapper(sval); }
using AdcValueHolder::operator=;
AdcSerializingValueHolder& operator=(const AdcSerializingValueHolder&) = default;
AdcSerializingValueHolder& operator=(AdcSerializingValueHolder&&) = default;
template <typename UT>
AdcSerializingValueHolder& operator=(UT&& value)
{
AdcValueHolder::operator=(std::forward<UT>(value));
return *this;
}
// using AdcValueHolder::operator=;
// template <typename UT>
// operator UT()
// {
// return AdcValueHolder::operator UT();
// }
};