1
mirror of https://code.videolan.org/videolan/vlc synced 2024-09-24 20:48:52 +02:00

cxx helpers: shared_data: Add nullptr comparison operators

Signed-off-by: Thomas Guillem <thomas@gllm.fr>
This commit is contained in:
Hugo Beauzée-Luyssen 2019-04-02 13:57:37 +02:00 committed by Thomas Guillem
parent 3475e434cd
commit 741eca07fc

View File

@ -202,11 +202,21 @@ public:
return ptr == other.ptr;
}
bool operator==(std::nullptr_t) const noexcept
{
return ptr == nullptr;
}
bool operator!=(const vlc_shared_data_ptr &other) const
{
return !(*this == other);
}
bool operator!=(std::nullptr_t) const noexcept
{
return ptr != nullptr;
}
explicit operator bool() const
{
return ptr;