move operations are 'noexcept'. implement copy_out() for stringpair and message.

master
roker 1 year ago
parent bd7a9b4e93
commit f1179d91da

@ -48,6 +48,12 @@ namespace pEp
free_message(m);
}
template<>
::message* Wrapper<::message*>::copy_out() const
{
return ::message_dup(value);
}
////////////////
template<>
@ -85,6 +91,11 @@ namespace pEp
free_stringpair(sp);
}
template<>
::stringpair_t* Wrapper<::stringpair_t*>::copy_out() const
{
return ::stringpair_dup(value);
}
template<>
void Wrapper<::stringpair_list_t*>::_free(::stringpair_list_t* spl)

@ -63,13 +63,13 @@ public:
Wrapper(Args... args) : value{ this->_new(args...) } {}
// move is easy, efficient and generic:
Wrapper(Wrapper<T*>&& victim)
Wrapper(Wrapper<T*>&& victim) noexcept
: value{ victim.value}
{
victim.value = nullptr;
}
Wrapper<T*>& operator=(Wrapper<T*>&& victim)
Wrapper<T*>& operator=(Wrapper<T*>&& victim) noexcept
{
_free(value);
value = victim.value;

Loading…
Cancel
Save