40#ifndef GEOGRAM_BASIC_SMART_POINTER
41#define GEOGRAM_BASIC_SMART_POINTER
125 if(ptr != pointer_) {
141 T* rhs_p = rhs.
get();
142 if(rhs_p != pointer_) {
190 operator T* ()
const {
207 return pointer_ ==
nullptr;
222 template <
class T1,
class T2>
226 return lhs.
get() == rhs.
get();
237 template <
class T1,
class T2>
241 return lhs.
get() != rhs.
get();
252 template <
class T1,
class T2>
256 return lhs.
get() < rhs.
get();
267 template <
class T1,
class T2>
271 return lhs.
get() <= rhs.
get();
282 template <
class T1,
class T2>
286 return lhs.
get() > rhs.
get();
297 template <
class T1,
class T2>
301 return lhs.
get() >= rhs.
get();
Assertion checking mechanism.
#define geo_assert(x)
Verifies that a condition is met.
void reset()
Resets pointer.
bool is_null() const
Check if stored pointer is null.
SmartPointer()
Creates an empty smart pointer.
T * operator->() const
Dereferences object member.
~SmartPointer()
Deletes a smart pointer.
bool operator<=(const SmartPointer< T1 > &lhs, const SmartPointer< T2 > &rhs)
Less or equal operator.
T & operator*() const
Dereferences object.
bool operator>=(const SmartPointer< T1 > &lhs, const SmartPointer< T2 > &rhs)
Greater or equal operator.
SmartPointer< T > & operator=(T *ptr)
Assignment from a pointer.
SmartPointer(const SmartPointer< T > &rhs)
Create a copy of a smart pointer.
T * get() const
Get pointer.
SmartPointer(T *ptr)
Creates a smart pointer that owns a pointer.
bool operator>(const SmartPointer< T1 > &lhs, const SmartPointer< T2 > &rhs)
Greater than operator.
bool operator<(const SmartPointer< T1 > &lhs, const SmartPointer< T2 > &rhs)
Less than operator.
bool operator==(const rationalg< T > &a, const rationalg< T > &b)
Tests equality between two rationalgs.
bool operator!=(const rationalg< T > &a, const rationalg< T > &b)
Tests whether two rationalgs differ.
Common include file, providing basic definitions. Should be included before anything else by all head...
Types and functions for memory manipulation.
Global Vorpaline namespace.