libcamera: base: shared_fd: Add comparison operators
Add == and != comparison operators between two SharedFD instances, and use them to replace manuel get() calls. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
@@ -46,4 +46,14 @@ private:
|
||||
std::shared_ptr<Descriptor> fd_;
|
||||
};
|
||||
|
||||
static inline bool operator==(const SharedFD &lhs, const SharedFD &rhs)
|
||||
{
|
||||
return lhs.get() == rhs.get();
|
||||
}
|
||||
|
||||
static inline bool operator!=(const SharedFD &lhs, const SharedFD &rhs)
|
||||
{
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
|
||||
} /* namespace libcamera */
|
||||
|
||||
Reference in New Issue
Block a user