#include <weak_pointer.hpp>
Public Member Functions | |
weak_ptr (gc_ptr< T > &p_item) | |
Constructor. | |
operator gc_ptr< T > () const | |
Cast operator. |
Allows accessing managed instances without being recognized by the collectors. A weak pointer validates against the block of memory it points to, not the strong pointer it's been created from. Be careful to either stop the collector or having at least one strong (gc_ptr) pointer referencing the same object(s) while working with weak pointers.
Definition at line 29 of file weak_pointer.hpp.
GCpp::weak_ptr< T >::weak_ptr | ( | gc_ptr< T > & | p_item | ) | [inline, explicit] |
Constructor.
This instance references the same object as the given gc_ptr after construction.
p_item | strong pointer, should not point to 0 |
Definition at line 42 of file weak_pointer.hpp.
GCpp::weak_ptr< T >::operator gc_ptr< T > | ( | ) | const [inline] |
Cast operator.
Creates a strong pointer from this, but only if this is valid.
bad_weak_pointer | if this is invalid |
Definition at line 52 of file weak_pointer.hpp.