From 1a7f42dbbba18dab28d454aa97b1bbf061eeb994 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Sun, 19 Aug 2018 22:56:05 +0200 Subject: [PATCH] [DEV] coorect constness --- ememory/WeakPtr.hpp | 18 +++++++++--------- ememory/details/WeakPtr.hxx | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ememory/WeakPtr.hpp b/ememory/WeakPtr.hpp index 69bd48f..0492c3f 100644 --- a/ememory/WeakPtr.hpp +++ b/ememory/WeakPtr.hpp @@ -123,28 +123,28 @@ namespace ememory { * @return created SharedPtr */ ememory::SharedPtr lock(); - /** - * @brief Check if two WeakPtr are the same data - * @param[in] _obj Object to compare - * @return true The Object have the same pointer reference, false otherwise - */ - bool operator==(const WeakPtr& _obj); /** * @brief Check if the WeakPtr have an internal data (not null) * @return true The pointer is not asigned, false otherwise */ bool operator==(etk::NullPtr) const; /** - * @brief Check if two WeakPtr are different data + * @brief Check if two WeakPtr are the same data * @param[in] _obj Object to compare - * @return true The Object have NOT the same pointer reference, false otherwise + * @return true The Object have the same pointer reference, false otherwise */ - bool operator!=(const WeakPtr& _obj); + bool operator==(const WeakPtr& _obj) const; /** * @brief Check if the SharedPtr have NOT an internal data (null) * @return true The pointer is asigned, false otherwise */ bool operator!=(etk::NullPtr) const; + /** + * @brief Check if two WeakPtr are different data + * @param[in] _obj Object to compare + * @return true The Object have NOT the same pointer reference, false otherwise + */ + bool operator!=(const WeakPtr& _obj) const; /** * @brief Swap 2 Object inside the WeakPtr * @param[in] _obj Object to swap with diff --git a/ememory/details/WeakPtr.hxx b/ememory/details/WeakPtr.hxx index cb23ca5..2859fc4 100644 --- a/ememory/details/WeakPtr.hxx +++ b/ememory/details/WeakPtr.hxx @@ -262,7 +262,7 @@ ememory::SharedPtr ememory::WeakPtr::lock() { } template -bool ememory::WeakPtr::operator==(const ememory::WeakPtr& _obj) { +bool ememory::WeakPtr::operator==(const ememory::WeakPtr& _obj) const { return m_counter == _obj.m_counter; } @@ -272,7 +272,7 @@ bool ememory::WeakPtr::operator==(etk::NullPtr) const { } template -bool ememory::WeakPtr::operator!=(const ememory::WeakPtr& _obj) { +bool ememory::WeakPtr::operator!=(const ememory::WeakPtr& _obj) const { return m_counter != _obj.m_counter; }