STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | List of all members
_Vb_reference< _Alloc > Class Template Reference
Inheritance diagram for _Vb_reference< _Alloc >:
_Vb_iter_base< _Alloc > _Iterator012< random_access_iterator_tag, bool, _Alloc::difference_type, bool *, bool, _Iterator_base > _Iterator_base0

Public Member Functions

 _Vb_reference (const _Mybase &_Right)
 
_Mytypeoperator= (const _Mytype &_Right) _NOEXCEPT
 
_Mytypeoperator= (bool _Val) _NOEXCEPT
 
void flip () _NOEXCEPT
 
 operator bool () const _NOEXCEPT
 
const _Vbase_Getptr () const
 
- Public Member Functions inherited from _Vb_iter_base< _Alloc >
 _Vb_iter_base ()
 
 _Vb_iter_base (const _Vbase *_Ptr, _Sizet _Off, const _Container_base *_Mypvbool)
 
void _Advance (_Sizet _Off)
 
int _Valid (_Sizet _Inc) const
 
- Public Member Functions inherited from _Iterator_base0
void _Adopt (const void *)
 
const _Container_base0_Getcont () const
 

Protected Member Functions

_Vbase _Mask () const
 

Private Types

typedef _Vb_iter_base< _Alloc > _Mybase
 
typedef _Vb_reference< _Alloc > _Mytype
 

Private Member Functions

 _Vb_reference () _NOEXCEPT
 

Additional Inherited Members

- Public Types inherited from _Vb_iter_base< _Alloc >
typedef _Alloc::size_type _Sizet
 
typedef vector< bool, _Alloc > _Mycont
 
- Public Types inherited from _Iterator012< random_access_iterator_tag, bool, _Alloc::difference_type, bool *, bool, _Iterator_base >
typedef random_access_iterator_tag iterator_category
 
typedef bool value_type
 
typedef _Alloc::difference_type difference_type
 
typedef boolpointer
 
typedef bool reference
 
- Public Attributes inherited from _Vb_iter_base< _Alloc >
const _Vbase_Myptr
 
_Sizet _Myoff
 

Member Typedef Documentation

template<class _Alloc>
typedef _Vb_iter_base<_Alloc> _Vb_reference< _Alloc >::_Mybase
private
template<class _Alloc>
typedef _Vb_reference<_Alloc> _Vb_reference< _Alloc >::_Mytype
private

Constructor & Destructor Documentation

template<class _Alloc>
_Vb_reference< _Alloc >::_Vb_reference ( )
inlineprivate
2127  { // construct with null pointer (private)
2128  }
template<class _Alloc>
_Vb_reference< _Alloc >::_Vb_reference ( const _Mybase _Right)
inline
2132  : _Mybase(_Right._Myptr, _Right._Myoff, _Right._Getcont())
2133  { // construct with base
2134  }
_Vb_iter_base< _Alloc > _Mybase
Definition: vector:2123
constexpr const _Ty &() _Right
Definition: algorithm:3723

Member Function Documentation

template<class _Alloc>
const _Vbase* _Vb_reference< _Alloc >::_Getptr ( ) const
inline
2161  { // get pointer to base word
2162  #if _ITERATOR_DEBUG_LEVEL == 2
2163  if (this->_Getcont() == 0
2164  || this->_Myptr == 0
2165  || 0 <= this->_Valid(0))
2166  { // report error
2167  _DEBUG_ERROR("vector<bool> iterator not dereferencable");
2168  }
2169 
2170  #elif _ITERATOR_DEBUG_LEVEL == 1
2171  _SCL_SECURE_VALIDATE(this->_Getcont() != 0 && this->_Myptr != 0);
2172  _SCL_SECURE_VALIDATE_RANGE(this->_Valid(0) < 0);
2173  #endif /* _ITERATOR_DEBUG_LEVEL */
2174 
2175  return (this->_Myptr);
2176  }
const _Container_base0 * _Getcont() const
Definition: xutility:77
const _Vbase * _Myptr
Definition: vector:2114
int _Valid(_Sizet _Inc) const
Definition: vector:2098
#define _SCL_SECURE_VALIDATE_RANGE(cond)
Definition: yvals.h:432
#define _DEBUG_ERROR(mesg)
Definition: xutility:33
#define _SCL_SECURE_VALIDATE(cond)
Definition: yvals.h:431
template<class _Alloc>
_Vbase _Vb_reference< _Alloc >::_Mask ( ) const
inlineprotected
2180  { // convert offset to mask
2181  return ((_Vbase)(1) << this->_Myoff);
2182  }
unsigned int _Vbase
Definition: vector:2062
_Sizet _Myoff
Definition: vector:2115
template<class _Alloc>
void _Vb_reference< _Alloc >::flip ( )
inline
2151  { // toggle the bit
2152  *(_Vbase *)_Getptr() ^= _Mask();
2153  }
const _Vbase * _Getptr() const
Definition: vector:2160
unsigned int _Vbase
Definition: vector:2062
_Vbase _Mask() const
Definition: vector:2179
template<class _Alloc>
_Vb_reference< _Alloc >::operator bool ( ) const
inline
2156  { // test if bit is set
2157  return ((*_Getptr() & _Mask()) != 0);
2158  }
const _Vbase * _Getptr() const
Definition: vector:2160
_Vbase _Mask() const
Definition: vector:2179
template<class _Alloc>
_Mytype& _Vb_reference< _Alloc >::operator= ( const _Mytype _Right)
inline
2137  { // assign _Vb_reference _Right to bit
2138  return (*this = bool(_Right));
2139  }
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Alloc>
_Mytype& _Vb_reference< _Alloc >::operator= ( bool  _Val)
inline
2142  { // assign _Val to bit
2143  if (_Val)
2144  *(_Vbase *)_Getptr() |= _Mask();
2145  else
2146  *(_Vbase *)_Getptr() &= (~_Mask()); // STET
2147  return (*this);
2148  }
const _Vbase * _Getptr() const
Definition: vector:2160
unsigned int _Vbase
Definition: vector:2062
_Vbase _Mask() const
Definition: vector:2179
_FwdIt const _Ty _Val
Definition: algorithm:1938

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