[DEV] coorect constness

This commit is contained in:
Edouard DUPIN 2018-08-19 22:56:05 +02:00
parent 934356875e
commit 1a7f42dbbb
2 changed files with 11 additions and 11 deletions

View File

@ -123,28 +123,28 @@ namespace ememory {
* @return created SharedPtr
*/
ememory::SharedPtr<EMEMORY_TYPE> 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

View File

@ -262,7 +262,7 @@ ememory::SharedPtr<EMEMORY_TYPE> ememory::WeakPtr<EMEMORY_TYPE>::lock() {
}
template<typename EMEMORY_TYPE>
bool ememory::WeakPtr<EMEMORY_TYPE>::operator==(const ememory::WeakPtr<EMEMORY_TYPE>& _obj) {
bool ememory::WeakPtr<EMEMORY_TYPE>::operator==(const ememory::WeakPtr<EMEMORY_TYPE>& _obj) const {
return m_counter == _obj.m_counter;
}
@ -272,7 +272,7 @@ bool ememory::WeakPtr<EMEMORY_TYPE>::operator==(etk::NullPtr) const {
}
template<typename EMEMORY_TYPE>
bool ememory::WeakPtr<EMEMORY_TYPE>::operator!=(const ememory::WeakPtr<EMEMORY_TYPE>& _obj) {
bool ememory::WeakPtr<EMEMORY_TYPE>::operator!=(const ememory::WeakPtr<EMEMORY_TYPE>& _obj) const {
return m_counter != _obj.m_counter;
}