libstdc++
__gnu_cxx::_Pointer_adapter< _Storage_policy > Class Template Reference

#include <pointer.h>

Inherits _Storage_policy.

Public Types

typedef std::ptrdiff_t difference_type
 
typedef _Storage_policy::element_type element_type
 
typedef std::random_access_iterator_tag iterator_category
 
typedef _Pointer_adapter pointer
 
typedef _Reference_type< element_type >::reference reference
 
typedef _Unqualified_type< element_type >::type value_type
 

Public Member Functions

template<typename _Up >
 _Pointer_adapter (_Up *__arg)
 
 _Pointer_adapter (const _Pointer_adapter &__arg)
 
template<typename _Up >
 _Pointer_adapter (const _Pointer_adapter< _Up > &__arg)
 
 _Pointer_adapter (element_type *__arg=0)
 
 operator bool () const
 
reference operator* () const
 
_Pointer_adapteroperator++ ()
 
_Pointer_adapter operator++ (int)
 
_Pointer_adapteroperator+= (int __offset)
 
_Pointer_adapteroperator+= (long __offset)
 
_Pointer_adapteroperator+= (long long __offset)
 
_Pointer_adapteroperator+= (short __offset)
 
_Pointer_adapteroperator+= (unsigned int __offset)
 
_Pointer_adapteroperator+= (unsigned long __offset)
 
_Pointer_adapteroperator+= (unsigned long long __offset)
 
_Pointer_adapteroperator+= (unsigned short __offset)
 
template<typename _Up >
std::ptrdiff_t operator- (const _Pointer_adapter< _Up > &__rhs) const
 
_Pointer_adapteroperator-- ()
 
_Pointer_adapter operator-- (int)
 
_Pointer_adapteroperator-= (int __offset)
 
_Pointer_adapteroperator-= (long __offset)
 
_Pointer_adapteroperator-= (long long __offset)
 
_Pointer_adapteroperator-= (short __offset)
 
_Pointer_adapteroperator-= (unsigned int __offset)
 
_Pointer_adapteroperator-= (unsigned long __offset)
 
_Pointer_adapteroperator-= (unsigned long long __offset)
 
_Pointer_adapteroperator-= (unsigned short __offset)
 
element_type * operator-> () const
 
template<typename _Up >
_Pointer_adapteroperator= (_Up *__arg)
 
_Pointer_adapteroperator= (const _Pointer_adapter &__arg)
 
template<typename _Up >
_Pointer_adapteroperator= (const _Pointer_adapter< _Up > &__arg)
 
reference operator[] (std::ptrdiff_t __index) const
 

Friends

_Pointer_adapter operator+ (const _Pointer_adapter &__lhs, int __offset)
 
_Pointer_adapter operator+ (const _Pointer_adapter &__lhs, long __offset)
 
_Pointer_adapter operator+ (const _Pointer_adapter &__lhs, long long __offset)
 
_Pointer_adapter operator+ (const _Pointer_adapter &__lhs, short __offset)
 
_Pointer_adapter operator+ (const _Pointer_adapter &__lhs, unsigned int __offset)
 
_Pointer_adapter operator+ (const _Pointer_adapter &__lhs, unsigned long __offset)
 
_Pointer_adapter operator+ (const _Pointer_adapter &__lhs, unsigned long long __offset)
 
_Pointer_adapter operator+ (const _Pointer_adapter &__lhs, unsigned short __offset)
 
_Pointer_adapter operator+ (int __offset, const _Pointer_adapter &__rhs)
 
_Pointer_adapter operator+ (long __offset, const _Pointer_adapter &__rhs)
 
_Pointer_adapter operator+ (long long __offset, const _Pointer_adapter &__rhs)
 
_Pointer_adapter operator+ (short __offset, const _Pointer_adapter &__rhs)
 
_Pointer_adapter operator+ (unsigned int __offset, const _Pointer_adapter &__rhs)
 
_Pointer_adapter operator+ (unsigned long __offset, const _Pointer_adapter &__rhs)
 
_Pointer_adapter operator+ (unsigned long long __offset, const _Pointer_adapter &__rhs)
 
_Pointer_adapter operator+ (unsigned short __offset, const _Pointer_adapter &__rhs)
 
template<typename _Up >
std::ptrdiff_t operator- (_Up *__lhs, const _Pointer_adapter &__rhs)
 
template<typename _Up >
std::ptrdiff_t operator- (const _Pointer_adapter &__lhs, _Up *__rhs)
 
std::ptrdiff_t operator- (const _Pointer_adapter &__lhs, element_type *__rhs)
 
_Pointer_adapter operator- (const _Pointer_adapter &__lhs, int __offset)
 
_Pointer_adapter operator- (const _Pointer_adapter &__lhs, long __offset)
 
_Pointer_adapter operator- (const _Pointer_adapter &__lhs, long long __offset)
 
_Pointer_adapter operator- (const _Pointer_adapter &__lhs, short __offset)
 
_Pointer_adapter operator- (const _Pointer_adapter &__lhs, unsigned int __offset)
 
_Pointer_adapter operator- (const _Pointer_adapter &__lhs, unsigned long __offset)
 
_Pointer_adapter operator- (const _Pointer_adapter &__lhs, unsigned long long __offset)
 
_Pointer_adapter operator- (const _Pointer_adapter &__lhs, unsigned short __offset)
 
std::ptrdiff_t operator- (element_type *__lhs, const _Pointer_adapter &__rhs)
 

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' Allocator::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 as 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 272 of file pointer.h.

Member Typedef Documentation

◆ difference_type

template<typename _Storage_policy >
typedef std::ptrdiff_t __gnu_cxx::_Pointer_adapter< _Storage_policy >::difference_type

Definition at line 280 of file pointer.h.

◆ element_type

template<typename _Storage_policy >
typedef _Storage_policy::element_type __gnu_cxx::_Pointer_adapter< _Storage_policy >::element_type

Definition at line 275 of file pointer.h.

◆ iterator_category

template<typename _Storage_policy >
typedef std::random_access_iterator_tag __gnu_cxx::_Pointer_adapter< _Storage_policy >::iterator_category

Definition at line 278 of file pointer.h.

◆ pointer

template<typename _Storage_policy >
typedef _Pointer_adapter __gnu_cxx::_Pointer_adapter< _Storage_policy >::pointer

Definition at line 281 of file pointer.h.

◆ reference

template<typename _Storage_policy >
typedef _Reference_type<element_type>::reference __gnu_cxx::_Pointer_adapter< _Storage_policy >::reference

Definition at line 282 of file pointer.h.

◆ value_type

template<typename _Storage_policy >
typedef _Unqualified_type<element_type>::type __gnu_cxx::_Pointer_adapter< _Storage_policy >::value_type

Definition at line 279 of file pointer.h.

Constructor & Destructor Documentation

◆ _Pointer_adapter() [1/4]

template<typename _Storage_policy >
__gnu_cxx::_Pointer_adapter< _Storage_policy >::_Pointer_adapter ( element_type *  __arg = 0)
inline

Definition at line 289 of file pointer.h.

◆ _Pointer_adapter() [2/4]

template<typename _Storage_policy >
__gnu_cxx::_Pointer_adapter< _Storage_policy >::_Pointer_adapter ( const _Pointer_adapter< _Storage_policy > &  __arg)
inline

Definition at line 293 of file pointer.h.

◆ _Pointer_adapter() [3/4]

template<typename _Storage_policy >
template<typename _Up >
__gnu_cxx::_Pointer_adapter< _Storage_policy >::_Pointer_adapter ( _Up *  __arg)
inline

Definition at line 298 of file pointer.h.

◆ _Pointer_adapter() [4/4]

template<typename _Storage_policy >
template<typename _Up >
__gnu_cxx::_Pointer_adapter< _Storage_policy >::_Pointer_adapter ( const _Pointer_adapter< _Up > &  __arg)
inline

Definition at line 304 of file pointer.h.

◆ ~_Pointer_adapter()

template<typename _Storage_policy >
__gnu_cxx::_Pointer_adapter< _Storage_policy >::~_Pointer_adapter ( )
inline

Definition at line 308 of file pointer.h.

Member Function Documentation

◆ operator bool()

template<typename _Storage_policy >
__gnu_cxx::_Pointer_adapter< _Storage_policy >::operator bool ( ) const
inlineexplicit

Definition at line 351 of file pointer.h.

◆ operator*()

template<typename _Storage_policy >
reference __gnu_cxx::_Pointer_adapter< _Storage_policy >::operator* ( ) const
inline

Definition at line 336 of file pointer.h.

◆ operator++() [1/2]

template<typename _Storage_policy >
_Pointer_adapter & __gnu_cxx::_Pointer_adapter< _Storage_policy >::operator++ ( )
inline

Definition at line 442 of file pointer.h.

◆ operator++() [2/2]

template<typename _Storage_policy >
_Pointer_adapter __gnu_cxx::_Pointer_adapter< _Storage_policy >::operator++ ( int  )
inline

Definition at line 449 of file pointer.h.

◆ operator+=() [1/8]

template<typename _Storage_policy >
_Pointer_adapter & __gnu_cxx::_Pointer_adapter< _Storage_policy >::operator+= ( int  __offset)
inline

Definition at line 431 of file pointer.h.

◆ operator+=() [2/8]

template<typename _Storage_policy >
_Pointer_adapter & __gnu_cxx::_Pointer_adapter< _Storage_policy >::operator+= ( long  __offset)
inline

Definition at line 433 of file pointer.h.

◆ operator+=() [3/8]

template<typename _Storage_policy >
_Pointer_adapter & __gnu_cxx::_Pointer_adapter< _Storage_policy >::operator+= ( long long  __offset)
inline

Definition at line 436 of file pointer.h.

◆ operator+=() [4/8]

template<typename _Storage_policy >
_Pointer_adapter & __gnu_cxx::_Pointer_adapter< _Storage_policy >::operator+= ( short  __offset)
inline

Definition at line 429 of file pointer.h.

◆ operator+=() [5/8]

template<typename _Storage_policy >
_Pointer_adapter & __gnu_cxx::_Pointer_adapter< _Storage_policy >::operator+= ( unsigned int  __offset)
inline

Definition at line 432 of file pointer.h.

◆ operator+=() [6/8]

template<typename _Storage_policy >
_Pointer_adapter & __gnu_cxx::_Pointer_adapter< _Storage_policy >::operator+= ( unsigned long  __offset)
inline

Definition at line 434 of file pointer.h.

◆ operator+=() [7/8]

template<typename _Storage_policy >
_Pointer_adapter & __gnu_cxx::_Pointer_adapter< _Storage_policy >::operator+= ( unsigned long long  __offset)
inline

Definition at line 437 of file pointer.h.

◆ operator+=() [8/8]

template<typename _Storage_policy >
_Pointer_adapter & __gnu_cxx::_Pointer_adapter< _Storage_policy >::operator+= ( unsigned short  __offset)
inline

Definition at line 430 of file pointer.h.

◆ operator-()

template<typename _Storage_policy >
template<typename _Up >
std::ptrdiff_t __gnu_cxx::_Pointer_adapter< _Storage_policy >::operator- ( const _Pointer_adapter< _Up > &  __rhs) const
inline

Definition at line 390 of file pointer.h.

◆ operator--() [1/2]

template<typename _Storage_policy >
_Pointer_adapter & __gnu_cxx::_Pointer_adapter< _Storage_policy >::operator-- ( )
inline

Definition at line 457 of file pointer.h.

◆ operator--() [2/2]

template<typename _Storage_policy >
_Pointer_adapter __gnu_cxx::_Pointer_adapter< _Storage_policy >::operator-- ( int  )
inline

Definition at line 464 of file pointer.h.

◆ operator-=() [1/8]

template<typename _Storage_policy >
_Pointer_adapter & __gnu_cxx::_Pointer_adapter< _Storage_policy >::operator-= ( int  __offset)
inline

Definition at line 431 of file pointer.h.

◆ operator-=() [2/8]

template<typename _Storage_policy >
_Pointer_adapter & __gnu_cxx::_Pointer_adapter< _Storage_policy >::operator-= ( long  __offset)
inline

Definition at line 433 of file pointer.h.

◆ operator-=() [3/8]

template<typename _Storage_policy >
_Pointer_adapter & __gnu_cxx::_Pointer_adapter< _Storage_policy >::operator-= ( long long  __offset)
inline

Definition at line 436 of file pointer.h.

◆ operator-=() [4/8]

template<typename _Storage_policy >
_Pointer_adapter & __gnu_cxx::_Pointer_adapter< _Storage_policy >::operator-= ( short  __offset)
inline

Definition at line 429 of file pointer.h.

◆ operator-=() [5/8]

template<typename _Storage_policy >
_Pointer_adapter & __gnu_cxx::_Pointer_adapter< _Storage_policy >::operator-= ( unsigned int  __offset)
inline

Definition at line 432 of file pointer.h.

◆ operator-=() [6/8]

template<typename _Storage_policy >
_Pointer_adapter & __gnu_cxx::_Pointer_adapter< _Storage_policy >::operator-= ( unsigned long  __offset)
inline

Definition at line 434 of file pointer.h.

◆ operator-=() [7/8]

template<typename _Storage_policy >
_Pointer_adapter & __gnu_cxx::_Pointer_adapter< _Storage_policy >::operator-= ( unsigned long long  __offset)
inline

Definition at line 437 of file pointer.h.

◆ operator-=() [8/8]

template<typename _Storage_policy >
_Pointer_adapter & __gnu_cxx::_Pointer_adapter< _Storage_policy >::operator-= ( unsigned short  __offset)
inline

Definition at line 430 of file pointer.h.

◆ operator->()

template<typename _Storage_policy >
element_type * __gnu_cxx::_Pointer_adapter< _Storage_policy >::operator-> ( ) const
inline

Definition at line 341 of file pointer.h.

◆ operator=() [1/3]

template<typename _Storage_policy >
template<typename _Up >
_Pointer_adapter & __gnu_cxx::_Pointer_adapter< _Storage_policy >::operator= ( _Up *  __arg)
inline

Definition at line 328 of file pointer.h.

◆ operator=() [2/3]

template<typename _Storage_policy >
_Pointer_adapter & __gnu_cxx::_Pointer_adapter< _Storage_policy >::operator= ( const _Pointer_adapter< _Storage_policy > &  __arg)
inline

Definition at line 312 of file pointer.h.

◆ operator=() [3/3]

template<typename _Storage_policy >
template<typename _Up >
_Pointer_adapter & __gnu_cxx::_Pointer_adapter< _Storage_policy >::operator= ( const _Pointer_adapter< _Up > &  __arg)
inline

Definition at line 320 of file pointer.h.

◆ operator[]()

template<typename _Storage_policy >
reference __gnu_cxx::_Pointer_adapter< _Storage_policy >::operator[] ( std::ptrdiff_t  __index) const
inline

Definition at line 346 of file pointer.h.

Friends And Related Symbol Documentation

◆ operator+ [1/16]

template<typename _Storage_policy >
_Pointer_adapter operator+ ( const _Pointer_adapter< _Storage_policy > &  __lhs,
int  __offset 
)
friend

Definition at line 431 of file pointer.h.

◆ operator+ [2/16]

template<typename _Storage_policy >
_Pointer_adapter operator+ ( const _Pointer_adapter< _Storage_policy > &  __lhs,
long  __offset 
)
friend

Definition at line 433 of file pointer.h.

◆ operator+ [3/16]

template<typename _Storage_policy >
_Pointer_adapter operator+ ( const _Pointer_adapter< _Storage_policy > &  __lhs,
long long  __offset 
)
friend

Definition at line 436 of file pointer.h.

◆ operator+ [4/16]

template<typename _Storage_policy >
_Pointer_adapter operator+ ( const _Pointer_adapter< _Storage_policy > &  __lhs,
short  __offset 
)
friend

Definition at line 429 of file pointer.h.

◆ operator+ [5/16]

template<typename _Storage_policy >
_Pointer_adapter operator+ ( const _Pointer_adapter< _Storage_policy > &  __lhs,
unsigned int  __offset 
)
friend

Definition at line 432 of file pointer.h.

◆ operator+ [6/16]

template<typename _Storage_policy >
_Pointer_adapter operator+ ( const _Pointer_adapter< _Storage_policy > &  __lhs,
unsigned long  __offset 
)
friend

Definition at line 434 of file pointer.h.

◆ operator+ [7/16]

template<typename _Storage_policy >
_Pointer_adapter operator+ ( const _Pointer_adapter< _Storage_policy > &  __lhs,
unsigned long long  __offset 
)
friend

Definition at line 437 of file pointer.h.

◆ operator+ [8/16]

template<typename _Storage_policy >
_Pointer_adapter operator+ ( const _Pointer_adapter< _Storage_policy > &  __lhs,
unsigned short  __offset 
)
friend

Definition at line 430 of file pointer.h.

◆ operator+ [9/16]

template<typename _Storage_policy >
_Pointer_adapter operator+ ( int  __offset,
const _Pointer_adapter< _Storage_policy > &  __rhs 
)
friend

Definition at line 431 of file pointer.h.

◆ operator+ [10/16]

template<typename _Storage_policy >
_Pointer_adapter operator+ ( long  __offset,
const _Pointer_adapter< _Storage_policy > &  __rhs 
)
friend

Definition at line 433 of file pointer.h.

◆ operator+ [11/16]

template<typename _Storage_policy >
_Pointer_adapter operator+ ( long long  __offset,
const _Pointer_adapter< _Storage_policy > &  __rhs 
)
friend

Definition at line 436 of file pointer.h.

◆ operator+ [12/16]

template<typename _Storage_policy >
_Pointer_adapter operator+ ( short  __offset,
const _Pointer_adapter< _Storage_policy > &  __rhs 
)
friend

Definition at line 429 of file pointer.h.

◆ operator+ [13/16]

template<typename _Storage_policy >
_Pointer_adapter operator+ ( unsigned int  __offset,
const _Pointer_adapter< _Storage_policy > &  __rhs 
)
friend

Definition at line 432 of file pointer.h.

◆ operator+ [14/16]

template<typename _Storage_policy >
_Pointer_adapter operator+ ( unsigned long  __offset,
const _Pointer_adapter< _Storage_policy > &  __rhs 
)
friend

Definition at line 434 of file pointer.h.

◆ operator+ [15/16]

template<typename _Storage_policy >
_Pointer_adapter operator+ ( unsigned long long  __offset,
const _Pointer_adapter< _Storage_policy > &  __rhs 
)
friend

Definition at line 437 of file pointer.h.

◆ operator+ [16/16]

template<typename _Storage_policy >
_Pointer_adapter operator+ ( unsigned short  __offset,
const _Pointer_adapter< _Storage_policy > &  __rhs 
)
friend

Definition at line 430 of file pointer.h.

◆ operator- [1/12]

template<typename _Storage_policy >
template<typename _Up >
std::ptrdiff_t operator- ( _Up *  __lhs,
const _Pointer_adapter< _Storage_policy > &  __rhs 
)
friend

Definition at line 385 of file pointer.h.

◆ operator- [2/12]

template<typename _Storage_policy >
template<typename _Up >
std::ptrdiff_t operator- ( const _Pointer_adapter< _Storage_policy > &  __lhs,
_Up *  __rhs 
)
friend

Definition at line 380 of file pointer.h.

◆ operator- [3/12]

template<typename _Storage_policy >
std::ptrdiff_t operator- ( const _Pointer_adapter< _Storage_policy > &  __lhs,
element_type *  __rhs 
)
friend

Definition at line 371 of file pointer.h.

◆ operator- [4/12]

template<typename _Storage_policy >
_Pointer_adapter operator- ( const _Pointer_adapter< _Storage_policy > &  __lhs,
int  __offset 
)
friend

Definition at line 431 of file pointer.h.

◆ operator- [5/12]

template<typename _Storage_policy >
_Pointer_adapter operator- ( const _Pointer_adapter< _Storage_policy > &  __lhs,
long  __offset 
)
friend

Definition at line 433 of file pointer.h.

◆ operator- [6/12]

template<typename _Storage_policy >
_Pointer_adapter operator- ( const _Pointer_adapter< _Storage_policy > &  __lhs,
long long  __offset 
)
friend

Definition at line 436 of file pointer.h.

◆ operator- [7/12]

template<typename _Storage_policy >
_Pointer_adapter operator- ( const _Pointer_adapter< _Storage_policy > &  __lhs,
short  __offset 
)
friend

Definition at line 429 of file pointer.h.

◆ operator- [8/12]

template<typename _Storage_policy >
_Pointer_adapter operator- ( const _Pointer_adapter< _Storage_policy > &  __lhs,
unsigned int  __offset 
)
friend

Definition at line 432 of file pointer.h.

◆ operator- [9/12]

template<typename _Storage_policy >
_Pointer_adapter operator- ( const _Pointer_adapter< _Storage_policy > &  __lhs,
unsigned long  __offset 
)
friend

Definition at line 434 of file pointer.h.

◆ operator- [10/12]

template<typename _Storage_policy >
_Pointer_adapter operator- ( const _Pointer_adapter< _Storage_policy > &  __lhs,
unsigned long long  __offset 
)
friend

Definition at line 437 of file pointer.h.

◆ operator- [11/12]

template<typename _Storage_policy >
_Pointer_adapter operator- ( const _Pointer_adapter< _Storage_policy > &  __lhs,
unsigned short  __offset 
)
friend

Definition at line 430 of file pointer.h.

◆ operator- [12/12]

template<typename _Storage_policy >
std::ptrdiff_t operator- ( element_type *  __lhs,
const _Pointer_adapter< _Storage_policy > &  __rhs 
)
friend

Definition at line 375 of file pointer.h.


The documentation for this class was generated from the following file: