Includes utility functions for weak and shared pointers.
More...
Go to the source code of this file.
|
| template<typename T > |
| bool | DtValidAndEqual (const std::weak_ptr< T > &wp1, const std::weak_ptr< T > &wp2) |
| | Compare if two weak pointers are both valid and equal. More...
|
| |
|
| template<typename T > |
| bool | DtValidAndEqual (const std::shared_ptr< T > &sp1, const std::weak_ptr< T > &wp1) |
| | Compare if a weak pointer is valid and equal to a shared pointer. More...
|
| |
| template<typename T > |
| bool | DtValidAndEqual (const std::weak_ptr< T > &wp1, const std::shared_ptr< T > &sp1) |
| | Compare if a weak pointer is valid and equal to a shared pointer. More...
|
| |
Includes utility functions for weak and shared pointers.
Using std::weak_ptr and std::shared_ptr
| #define BOOST_HAS_THREADS |
Required so that shared pointers are thread safe.
Since shared pointers can be used, across library and thread boundaries safely. NOTE: This does not make the objects that they point reentrant or thread safe. For a detailed discussion of the thread safety of shared_ptr please see the Thread Safety section of the Boost, smart_ptr documentation on http://www.boost.org
template<typename T >
| bool DtValidAndEqual |
( |
const std::weak_ptr< T > & |
wp1, |
|
|
const std::weak_ptr< T > & |
wp2 |
|
) |
| |
Compare if two weak pointers are both valid and equal.
- Parameters
-
| wp1 | A weak pointer to type T. |
| wp2 | A weak pointer to type T. |
- Returns
- Whether both weak pointers are valid and point to the same memory.
- Return values
-
| true | Both weak pointers point to the same value. |
| false | Both weak pointers point do not point to the same value or both may be invalid. |
template<typename T >
| bool DtValidAndEqual |
( |
const std::shared_ptr< T > & |
sp1, |
|
|
const std::weak_ptr< T > & |
wp1 |
|
) |
| |
Compare if a weak pointer is valid and equal to a shared pointer.
- Parameters
-
| sp1 | A shared pointer to type T. |
| wp1 | A weak pointer to type T. |
- Returns
- Whether the weak pointer is valid and points to the same memory as the shared pointer.
- Return values
-
| true | The weak pointer is valid and points to the same memory as the shared pointer. |
| false | Either the weak pointer is invalid or it points to different memory than the shared pointer. |
template<typename T >
| bool DtValidAndEqual |
( |
const std::weak_ptr< T > & |
wp1, |
|
|
const std::shared_ptr< T > & |
sp1 |
|
) |
| |
Compare if a weak pointer is valid and equal to a shared pointer.
- Parameters
-
| sp1 | A shared pointer to type T. |
| wp1 | A weak pointer to type T. |
- Returns
- Whether the weak pointer is valid and points to the same memory as the shared pointer.
- Return values
-
| true | The weak pointer is valid and points to the same memory as the shared pointer. |
| false | Either the weak pointer is invalid or it points to different memory than the shared pointer. |