Inherits _Storage_policy.
List of all members.
Public Types
Public Member Functions
Friends
-
_Pointer_adapter operator+ (const _Pointer_adapter &__lhs, short __offset)
-
_Pointer_adapter operator+ (const _Pointer_adapter &__lhs, unsigned short __offset)
-
_Pointer_adapter operator+ (unsigned long __offset, const _Pointer_adapter &__rhs)
-
_Pointer_adapter operator+ (unsigned short __offset, const _Pointer_adapter &__rhs)
-
_Pointer_adapter operator+ (const _Pointer_adapter &__lhs, long __offset)
-
_Pointer_adapter operator+ (long __offset, const _Pointer_adapter &__rhs)
-
_Pointer_adapter operator+ (const _Pointer_adapter &__lhs, int __offset)
-
_Pointer_adapter operator+ (const _Pointer_adapter &__lhs, unsigned long __offset)
-
_Pointer_adapter operator+ (unsigned int __offset, const _Pointer_adapter &__rhs)
-
_Pointer_adapter operator+ (short __offset, const _Pointer_adapter &__rhs)
-
_Pointer_adapter operator+ (int __offset, const _Pointer_adapter &__rhs)
-
_Pointer_adapter operator+ (const _Pointer_adapter &__lhs, unsigned int __offset)
-
std::ptrdiff_t operator- (element_type *__lhs, const _Pointer_adapter &__rhs)
-
std::ptrdiff_t operator- (const _Pointer_adapter &__lhs, element_type *__rhs)
-
_Pointer_adapter operator- (const _Pointer_adapter &__lhs, unsigned short __offset)
-
_Pointer_adapter operator- (const _Pointer_adapter &__lhs, unsigned long __offset)
-
_Pointer_adapter operator- (const _Pointer_adapter &__lhs, int __offset)
-
_Pointer_adapter operator- (const _Pointer_adapter &__lhs, short __offset)
-
template<typename _Up > std::ptrdiff_t operator- (_Up *__lhs, const _Pointer_adapter &__rhs)
-
_Pointer_adapter operator- (const _Pointer_adapter &__lhs, long __offset)
-
template<typename _Up > std::ptrdiff_t operator- (const _Pointer_adapter &__lhs, _Up *__rhs)
-
_Pointer_adapter operator- (const _Pointer_adapter &__lhs, unsigned int __offset)
Detailed Description
template<typename _Storage_policy>
class __gnu_cxx::_Pointer_adapter< _Storage_policy >
The following provides an 'alternative pointer' that works with the containers when specified as the pointer typedef of the allocator.
The pointer type used with the containers doesn't have to be this class, but it must support the implicit conversions, pointer arithmetic, comparison operators, etc. that are supported by this class, and avoid raising compile-time ambiguities. Because creating a working pointer can be challenging, this pointer template was designed to wrapper an easier storage policy type, so that it becomes reusable for creating other pointer types.
A key point of this class is also that it allows container writers to 'assume' Alocator::pointer is a typedef for a normal pointer. This class supports most of the conventions of a true pointer, and can, for instance handle implicit conversion to const and base class pointer types. The only impositions on container writers to support extended pointers are: 1) use the Allocator::pointer typedef appropriately for pointer types. 2) if you need pointer casting, use the __pointer_cast<> functions from ext/cast.h. This allows pointer cast operations to be overloaded is necessary by custom pointers.
Note: The const qualifier works with this pointer adapter as follows:
_Tp* == _Pointer_adapter<_Std_pointer_impl<_Tp> >; const _Tp* == _Pointer_adapter<_Std_pointer_impl<const _Tp> >; _Tp* const == const _Pointer_adapter<_Std_pointer_impl<_Tp> >; const _Tp* const == const _Pointer_adapter<_Std_pointer_impl<const _Tp> >;
Definition at line 281 of file pointer.h.
The documentation for this class was generated from the following file: