include/Cnx/smart_ptrs/SmartPtrDef.h file

This module provides the macro definitions for working with smart pointer templates.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Defines

#define ptr(self)
Returns a pointer to the managed object of a Cnx smart pointer.
#define __ptr(self)
implementation of ptr
#define ptr_const(self)
Returns a pointer-to-const to the managed object of a Cnx smart pointer.
#define ptr_mut(self)
Returns a pointer-to-non-const to the managed object of a Cnx smart pointer.
#define ptr_move(self)
Moves self into the assigned-to or bound-to variable/parameter/etc.
#define CnxDeleter(T, ...)
The function type (with optional name, for use in typedefs) of a deleter function used in smart pointer templates.
#define __SMART_PTR_CHECK_INSTANCE_IS_ARRAY(self)
checks if the given smart pointer instance manages an array type
#define __SMART_PTR_IS_ARRAY(T)
checks if the given type is an array type
#define __SMART_PTR_ELEMENT_PTR_BASE(T)
gets the element pointer type for the given array type. e.g if T evaluates to int[], returns int*.
#define __SMART_PTR_CONST_ELEMENT_PTR_BASE(T)
gets the const element pointer type for the given array type. e.g if T evaluates to int[], returns const int*.
#define __SMART_PTR_ELEMENT_PTR(T)
gets the pointer type/element pointer type for the given type used in a smart pointer template. e.g. if T evalutes to int, returns int* as the pointer-to-int type is int*, but if T evaluates to int[], also returns int*, as the pointer-to-element type of an array of ints is int*.
#define __SMART_PTR_CONST_ELEMENT_PTR(T)
gets the pointer to const type/const element pointer type for the given type used in a smart pointer template. e.g. if T evalutes to int, returns const int* as the pointer-to-const-int type is const int*, but if T evaluates to int[], also returns const int*, as the pointer-to-const-element type of an array of ints is const int*.
#define __SMART_PTR_ELEMENT(T)
gets the element type for the given type T used in a smart pointer template. e.g. it T evaluates to int returns int, as a smart pointer managing an int only contains one int. But if T evaluates to int[], also returns int because a smart pointer managing ints contains several int elements