macros.h File Reference

Go to the source code of this file.

Defines

#define _GLIBCXX_DEBUG_MACROS_H   1
#define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)
#define __glibcxx_check_valid_range(_First, _Last)
#define __glibcxx_check_insert(_Position)
#define __glibcxx_check_insert_range(_Position, _First, _Last)
#define __glibcxx_check_erase(_Position)
#define __glibcxx_check_erase_range(_First, _Last)
#define __glibcxx_check_subscript(_N)
#define __glibcxx_check_nonempty()
#define __glibcxx_check_strict_weak_ordering(_First, _Last)   _GLIBCXX_DEBUG_ASSERT(_First == _Last || !(*_First < *_First))
#define __glibcxx_check_strict_weak_ordering_pred(_First, _Last, _Pred)   _GLIBCXX_DEBUG_ASSERT(_First == _Last || !_Pred(*_First, *_First))
#define __glibcxx_check_sorted(_First, _Last)
#define __glibcxx_check_sorted_pred(_First, _Last, _Pred)
#define __glibcxx_check_partitioned(_First, _Last, _Value)
#define __glibcxx_check_partitioned_pred(_First, _Last, _Value, _Pred)
#define __glibcxx_check_heap(_First, _Last)
#define __glibcxx_check_heap_pred(_First, _Last, _Pred)
#define __glibcxx_check_string(_String)
#define __glibcxx_check_string_len(_String, _Len)


Define Documentation

#define __glibcxx_check_erase ( _Position   ) 

Value:

_GLIBCXX_DEBUG_VERIFY(_Position._M_dereferenceable(),           \
              _M_message(::__gnu_debug::__msg_erase_bad)    \
                      ._M_sequence(*this, "this")           \
              ._M_iterator(_Position, #_Position));     \
_GLIBCXX_DEBUG_VERIFY(_Position._M_attached_to(this),           \
              _M_message(::__gnu_debug::__msg_erase_different) \
              ._M_sequence(*this, "this")           \
              ._M_iterator(_Position, #_Position))
Verify that we can erase the element referenced by the iterator _Position. We can erase the element if the _Position iterator is dereferenceable and references this sequence.

Definition at line 102 of file macros.h.

Referenced by __gnu_debug_def::vector< _Tp, _Allocator >::erase(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::erase(), __gnu_debug_def::set< _Key, _Compare, _Allocator >::erase(), __gnu_debug_def::multiset< _Key, _Compare, _Allocator >::erase(), __gnu_debug_def::multimap< _Key, _Tp, _Compare, _Allocator >::erase(), __gnu_debug_def::map< _Key, _Tp, _Compare, _Allocator >::erase(), __gnu_debug_def::list< _Tp, _Allocator >::erase(), __gnu_debug_def::hash_set< _Value, _HashFcn, _EqualKey, _Alloc >::erase(), __gnu_debug_def::hash_multiset< _Value, _HashFcn, _EqualKey, _Alloc >::erase(), __gnu_debug_def::hash_multimap< _Value, _Tp, _HashFcn, _EqualKey, _Alloc >::erase(), __gnu_debug_def::hash_map< _Value, _Tp, _HashFcn, _EqualKey, _Alloc >::erase(), and __gnu_debug_def::deque< _Tp, _Allocator >::erase().

#define __glibcxx_check_erase_range ( _First,
_Last   ) 

Value:

__glibcxx_check_valid_range(_First,_Last);              \
_GLIBCXX_DEBUG_VERIFY(_First._M_attached_to(this),          \
              _M_message(::__gnu_debug::__msg_erase_different) \
                      ._M_sequence(*this, "this")           \
              ._M_iterator(_First, #_First)         \
              ._M_iterator(_Last, #_Last))
Verify that we can erase the elements in the iterator range [_First, _Last). We can erase the elements if [_First, _Last) is a valid iterator range within this sequence.

Definition at line 116 of file macros.h.

Referenced by __gnu_debug_def::vector< _Tp, _Allocator >::erase(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::erase(), __gnu_debug_def::set< _Key, _Compare, _Allocator >::erase(), __gnu_debug_def::multiset< _Key, _Compare, _Allocator >::erase(), __gnu_debug_def::multimap< _Key, _Tp, _Compare, _Allocator >::erase(), __gnu_debug_def::map< _Key, _Tp, _Compare, _Allocator >::erase(), __gnu_debug_def::list< _Tp, _Allocator >::erase(), __gnu_debug_def::hash_set< _Value, _HashFcn, _EqualKey, _Alloc >::erase(), __gnu_debug_def::hash_multiset< _Value, _HashFcn, _EqualKey, _Alloc >::erase(), __gnu_debug_def::hash_multimap< _Value, _Tp, _HashFcn, _EqualKey, _Alloc >::erase(), __gnu_debug_def::hash_map< _Value, _Tp, _HashFcn, _EqualKey, _Alloc >::erase(), __gnu_debug_def::deque< _Tp, _Allocator >::erase(), and __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::replace().

#define __glibcxx_check_heap ( _First,
_Last   ) 

Value:

__glibcxx_check_valid_range(_First,_Last);              \
_GLIBCXX_DEBUG_VERIFY(::std::__is_heap(_First, _Last),      \
              _M_message(::__gnu_debug::__msg_not_heap) \
              ._M_iterator(_First, #_First)         \
              ._M_iterator(_Last, #_Last))

Definition at line 193 of file macros.h.

#define __glibcxx_check_heap_pred ( _First,
_Last,
_Pred   ) 

Value:

__glibcxx_check_valid_range(_First,_Last);              \
_GLIBCXX_DEBUG_VERIFY(::std::__is_heap(_First, _Last, _Pred),       \
              _M_message(::__gnu_debug::__msg_not_heap_pred) \
                      ._M_iterator(_First, #_First)         \
              ._M_iterator(_Last, #_Last)           \
              ._M_string(#_Pred))
Verify that the iterator range [_First, _Last) is a heap w.r.t. the predicate _Pred.

Definition at line 202 of file macros.h.

#define __glibcxx_check_insert ( _Position   ) 

Value:

_GLIBCXX_DEBUG_VERIFY(!_Position._M_singular(),             \
              _M_message(::__gnu_debug::__msg_insert_singular) \
              ._M_sequence(*this, "this")           \
              ._M_iterator(_Position, #_Position));     \
_GLIBCXX_DEBUG_VERIFY(_Position._M_attached_to(this),           \
              _M_message(::__gnu_debug::__msg_insert_different) \
              ._M_sequence(*this, "this")           \
              ._M_iterator(_Position, #_Position))
Verify that we can insert into *this with the iterator _Position. Insertion into a container at a specific position requires that the iterator be nonsingular (i.e., either dereferenceable or past-the-end) and that it reference the sequence we are inserting into. Note that this macro is only valid when the container is a _Safe_sequence and the iterator is a _Safe_iterator.

Definition at line 64 of file macros.h.

Referenced by __gnu_debug_def::vector< _Tp, _Allocator >::insert(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::insert(), __gnu_debug_def::set< _Key, _Compare, _Allocator >::insert(), __gnu_debug_def::multiset< _Key, _Compare, _Allocator >::insert(), __gnu_debug_def::multimap< _Key, _Tp, _Compare, _Allocator >::insert(), __gnu_debug_def::map< _Key, _Tp, _Compare, _Allocator >::insert(), __gnu_debug_def::list< _Tp, _Allocator >::insert(), __gnu_debug_def::deque< _Tp, _Allocator >::insert(), and __gnu_debug_def::list< _Tp, _Allocator >::splice().

#define __glibcxx_check_insert_range ( _Position,
_First,
_Last   ) 

Value:

__glibcxx_check_valid_range(_First,_Last);              \
_GLIBCXX_DEBUG_VERIFY(!_Position._M_singular(),             \
              _M_message(::__gnu_debug::__msg_insert_singular) \
                      ._M_sequence(*this, "this")           \
              ._M_iterator(_Position, #_Position));     \
_GLIBCXX_DEBUG_VERIFY(_Position._M_attached_to(this),           \
              _M_message(::__gnu_debug::__msg_insert_different) \
              ._M_sequence(*this, "this")           \
              ._M_iterator(_Position, #_Position))
Verify that we can insert the values in the iterator range [_First, _Last) into *this with the iterator _Position. Insertion into a container at a specific position requires that the iterator be nonsingular (i.e., either dereferenceable or past-the-end), that it reference the sequence we are inserting into, and that the iterator range [_First, Last) is a valid (possibly empty) range. Note that this macro is only valid when the container is a _Safe_sequence and the iterator is a _Safe_iterator.

We would like to be able to check for noninterference of _Position and the range [_First, _Last), but that can't (in general) be done.

Definition at line 87 of file macros.h.

Referenced by __gnu_debug_def::vector< _Tp, _Allocator >::insert(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::insert(), __gnu_debug_def::list< _Tp, _Allocator >::insert(), and __gnu_debug_def::deque< _Tp, _Allocator >::insert().

 
#define __glibcxx_check_nonempty (  ) 

Value:

_GLIBCXX_DEBUG_VERIFY(! this->empty(),                  \
              _M_message(::__gnu_debug::__msg_empty)    \
                      ._M_sequence(*this, "this"))

Definition at line 133 of file macros.h.

Referenced by __gnu_debug_def::vector< _Tp, _Allocator >::back(), __gnu_debug_def::list< _Tp, _Allocator >::back(), __gnu_debug_def::deque< _Tp, _Allocator >::back(), __gnu_debug_def::vector< _Tp, _Allocator >::front(), __gnu_debug_def::list< _Tp, _Allocator >::front(), __gnu_debug_def::deque< _Tp, _Allocator >::front(), __gnu_debug_def::vector< _Tp, _Allocator >::pop_back(), __gnu_debug_def::list< _Tp, _Allocator >::pop_back(), __gnu_debug_def::deque< _Tp, _Allocator >::pop_back(), __gnu_debug_def::list< _Tp, _Allocator >::pop_front(), and __gnu_debug_def::deque< _Tp, _Allocator >::pop_front().

#define __glibcxx_check_partitioned ( _First,
_Last,
_Value   ) 

Value:

__glibcxx_check_valid_range(_First,_Last);              \
_GLIBCXX_DEBUG_VERIFY(::__gnu_debug::__check_partitioned(_First, _Last, \
                             _Value),   \
              _M_message(::__gnu_debug::__msg_unpartitioned) \
              ._M_iterator(_First, #_First)         \
              ._M_iterator(_Last, #_Last)           \
              ._M_string(#_Value))
Verify that the iterator range [_First, _Last) is partitioned w.r.t. the value _Value.

Definition at line 171 of file macros.h.

#define __glibcxx_check_partitioned_pred ( _First,
_Last,
_Value,
_Pred   ) 

Value:

__glibcxx_check_valid_range(_First,_Last);              \
_GLIBCXX_DEBUG_VERIFY(::__gnu_debug::__check_partitioned(_First, _Last, \
                             _Value, _Pred), \
              _M_message(::__gnu_debug::__msg_unpartitioned_pred) \
              ._M_iterator(_First, #_First)         \
              ._M_iterator(_Last, #_Last)           \
              ._M_string(#_Pred)                \
                      ._M_string(#_Value))
Verify that the iterator range [_First, _Last) is partitioned w.r.t. the value _Value and predicate _Pred.

Definition at line 182 of file macros.h.

#define __glibcxx_check_sorted ( _First,
_Last   ) 

Value:

__glibcxx_check_valid_range(_First,_Last);              \
__glibcxx_check_strict_weak_ordering(_First,_Last);         \
_GLIBCXX_DEBUG_VERIFY(::__gnu_debug::__check_sorted(_First, _Last), \
              _M_message(::__gnu_debug::__msg_unsorted) \
                      ._M_iterator(_First, #_First)         \
              ._M_iterator(_Last, #_Last))

Definition at line 150 of file macros.h.

Referenced by __gnu_debug_def::list< _Tp, _Allocator >::merge().

#define __glibcxx_check_sorted_pred ( _First,
_Last,
_Pred   ) 

Value:

__glibcxx_check_valid_range(_First,_Last);              \
__glibcxx_check_strict_weak_ordering_pred(_First,_Last,_Pred);          \
_GLIBCXX_DEBUG_VERIFY(::__gnu_debug::__check_sorted(_First, _Last, _Pred), \
              _M_message(::__gnu_debug::__msg_unsorted_pred) \
                      ._M_iterator(_First, #_First)         \
              ._M_iterator(_Last, #_Last)           \
              ._M_string(#_Pred))
Verify that the iterator range [_First, _Last) is sorted by the predicate _Pred.

Definition at line 160 of file macros.h.

Referenced by __gnu_debug_def::list< _Tp, _Allocator >::merge().

#define __glibcxx_check_strict_weak_ordering ( _First,
_Last   )     _GLIBCXX_DEBUG_ASSERT(_First == _Last || !(*_First < *_First))

Definition at line 140 of file macros.h.

#define __glibcxx_check_strict_weak_ordering_pred ( _First,
_Last,
_Pred   )     _GLIBCXX_DEBUG_ASSERT(_First == _Last || !_Pred(*_First, *_First))

Definition at line 145 of file macros.h.

#define __glibcxx_check_string ( _String   ) 

Definition at line 215 of file macros.h.

Referenced by __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::append(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::assign(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::compare(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::find(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::find_first_not_of(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::find_first_of(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::find_last_not_of(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::find_last_of(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::insert(), __gnu_debug::operator!=(), __gnu_debug::operator+(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::operator+=(), __gnu_debug::operator<(), __gnu_debug::operator<=(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::operator=(), __gnu_debug::operator==(), __gnu_debug::operator>(), __gnu_debug::operator>=(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::replace(), and __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::rfind().

#define __glibcxx_check_string_len ( _String,
_Len   ) 

Definition at line 216 of file macros.h.

Referenced by __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::append(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::assign(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::compare(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::copy(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::find_first_not_of(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::replace(), and __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::rfind().

#define __glibcxx_check_subscript ( _N   ) 

Value:

_GLIBCXX_DEBUG_VERIFY(_N < this->size(),                \
              _M_message(::__gnu_debug::__msg_subscript_oob) \
                      ._M_sequence(*this, "this")           \
              ._M_integer(_N, #_N)              \
              ._M_integer(this->size(), "size"))

Definition at line 125 of file macros.h.

Referenced by __gnu_debug_def::vector< _Tp, _Allocator >::operator[](), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::operator[](), __gnu_debug_def::deque< _Tp, _Allocator >::operator[](), and __gnu_debug_def::bitset< _Nb >::operator[]().

#define __glibcxx_check_valid_range ( _First,
_Last   ) 

Value:

_GLIBCXX_DEBUG_VERIFY(::__gnu_debug::__valid_range(_First, _Last),  \
              _M_message(::__gnu_debug::__msg_valid_range)  \
              ._M_iterator(_First, #_First)         \
              ._M_iterator(_Last, #_Last))

Definition at line 51 of file macros.h.

Referenced by __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::append(), __gnu_debug_def::vector< _Tp, _Allocator >::assign(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::assign(), __gnu_debug_def::list< _Tp, _Allocator >::assign(), __gnu_debug_def::deque< _Tp, _Allocator >::assign(), __gnu_debug_def::set< _Key, _Compare, _Allocator >::insert(), __gnu_debug_def::multiset< _Key, _Compare, _Allocator >::insert(), __gnu_debug_def::multimap< _Key, _Tp, _Compare, _Allocator >::insert(), __gnu_debug_def::map< _Key, _Tp, _Compare, _Allocator >::insert(), __gnu_debug_def::hash_set< _Value, _HashFcn, _EqualKey, _Alloc >::insert(), __gnu_debug_def::hash_multiset< _Value, _HashFcn, _EqualKey, _Alloc >::insert(), __gnu_debug_def::hash_multimap< _Value, _Tp, _HashFcn, _EqualKey, _Alloc >::insert(), __gnu_debug_def::hash_map< _Value, _Tp, _HashFcn, _EqualKey, _Alloc >::insert(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::replace(), and __gnu_debug_def::list< _Tp, _Allocator >::splice().

#define _GLIBCXX_DEBUG_MACROS_H   1

Definition at line 32 of file macros.h.

#define _GLIBCXX_DEBUG_VERIFY ( _Condition,
_ErrorMessage   ) 

Value:

do {                                    \
    if (! (_Condition))                         \
      ::__gnu_debug::_Error_formatter::_M_at(__FILE__, __LINE__)    \
      ._ErrorMessage._M_error();                    \
  } while (false)
Macros used by the implementation to verify certain properties. These macros may only be used directly by the debug wrappers. Note that these are macros (instead of the more obviously "correct" choice of making them functions) because we need line and file information at the call site, to minimize the distance between the user error and where the error is reported.

Definition at line 43 of file macros.h.

Referenced by __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::_Safe_iterator(), __gnu_debug_def::bitset< _Nb >::reference::flip(), __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::operator *(), __gnu_debug_def::bitset< _Nb >::reference::operator bool(), __gnu_debug::operator!=(), __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::operator++(), __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::operator+=(), __gnu_debug::operator-(), __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::operator--(), __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::operator-=(), __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::operator->(), __gnu_debug::operator<(), __gnu_debug::operator<=(), __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::operator=(), __gnu_debug_def::bitset< _Nb >::reference::operator=(), __gnu_debug::operator==(), __gnu_debug::operator>(), __gnu_debug::operator>=(), __gnu_debug::basic_string< _CharT, _Traits, _Allocator >::operator[](), __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::operator[](), __gnu_debug_def::bitset< _Nb >::reference::operator~(), and __gnu_debug_def::list< _Tp, _Allocator >::splice().


Generated on Tue Feb 2 16:57:22 2010 for GNU C++ STL by  doxygen 1.4.7