GNU g++  v5.2.1
GNU Standard C++
macros.h File Reference

This file is a GNU debug extension to the Standard C++ Library. More...

This graph shows which files directly or indirectly include this file:

Macros

#define __glibcxx_check_bucket_index(_N)
 
#define __glibcxx_check_equal_allocs(_This, _Other)
 
#define __glibcxx_check_erase(_Position)
 Verify that we can erase the element referenced by the iterator _Position. More...
 
#define __glibcxx_check_erase_after(_Position)
 Verify that we can erase the element after the iterator _Position. More...
 
#define __glibcxx_check_erase_range(_First, _Last)
 Verify that we can erase the elements in the iterator range [_First, _Last). More...
 
#define __glibcxx_check_erase_range_after(_First, _Last)
 Verify that we can erase the elements in the iterator range (_First, _Last). More...
 
#define __glibcxx_check_heap(_First, _Last)
 
#define __glibcxx_check_heap_pred(_First, _Last, _Pred)
 Verify that the iterator range [_First, _Last) is a heap w.r.t. More...
 
#define __glibcxx_check_insert(_Position)
 Verify that we can insert into *this with the iterator _Position. More...
 
#define __glibcxx_check_insert_after(_Position)
 Verify that we can insert into *this after the iterator _Position. More...
 
#define __glibcxx_check_insert_range(_Position, _First, _Last)
 Verify that we can insert the values in the iterator range [_First, _Last) into *this with the iterator _Position. More...
 
#define __glibcxx_check_insert_range_after(_Position, _First, _Last)
 Verify that we can insert the values in the iterator range [_First, _Last) into *this after the iterator _Position. More...
 
#define __glibcxx_check_max_load_factor(_F)
 
#define __glibcxx_check_non_empty_range(_First, _Last)
 
#define __glibcxx_check_nonempty()
 
#define __glibcxx_check_partitioned_lower(_First, _Last, _Value)
 Verify that the iterator range [_First, _Last) is partitioned w.r.t. More...
 
#define __glibcxx_check_partitioned_lower_pred(_First, _Last, _Value, _Pred)
 Verify that the iterator range [_First, _Last) is partitioned w.r.t. More...
 
#define __glibcxx_check_partitioned_upper(_First, _Last, _Value)
 
#define __glibcxx_check_partitioned_upper_pred(_First, _Last, _Value, _Pred)
 Verify that the iterator range [_First, _Last) is partitioned w.r.t. More...
 
#define __glibcxx_check_self_move_assign(_Other)
 
#define __glibcxx_check_sorted(_First, _Last)
 
#define __glibcxx_check_sorted_pred(_First, _Last, _Pred)
 Verify that the iterator range [_First, _Last) is sorted by the predicate _Pred. More...
 
#define __glibcxx_check_sorted_set(_First1, _Last1, _First2)
 
#define __glibcxx_check_sorted_set_pred(_First1, _Last1, _First2, _Pred)
 
#define __glibcxx_check_string(_String)
 
#define __glibcxx_check_string_len(_String, _Len)
 
#define __glibcxx_check_subscript(_N)
 
#define __glibcxx_check_valid_range(_First, _Last)
 
#define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)   _GLIBCXX_DEBUG_VERIFY_AT(_Condition,_ErrorMessage,__FILE__,__LINE__)
 
#define _GLIBCXX_DEBUG_VERIFY_AT(_Condition, _ErrorMessage, _File, _Line)
 Macros used by the implementation to verify certain properties. More...
 

Detailed Description

This file is a GNU debug extension to the Standard C++ Library.

Macro Definition Documentation

#define __glibcxx_check_bucket_index (   _N)
Value:
_GLIBCXX_DEBUG_VERIFY(_N < this->bucket_count(), \
._M_sequence(*this, "this") \
._M_integer(_N, #_N) \
._M_integer(this->bucket_count(), "size"))
Definition: formatter.h:115
#define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)
Definition: macros.h:49
#define __glibcxx_check_equal_allocs (   _This,
  _Other 
)
Value:
_GLIBCXX_DEBUG_VERIFY(_This.get_allocator() == _Other.get_allocator(), \
._M_sequence(_This, "this"))
Definition: formatter.h:118
#define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)
Definition: macros.h:49
#define __glibcxx_check_erase (   _Position)
Value:
_GLIBCXX_DEBUG_VERIFY(_Position._M_dereferenceable(), \
._M_sequence(*this, "this") \
._M_iterator(_Position, #_Position)); \
_GLIBCXX_DEBUG_VERIFY(_Position._M_attached_to(this), \
._M_sequence(*this, "this") \
._M_iterator(_Position, #_Position))
Definition: formatter.h:60
#define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)
Definition: macros.h:49
Definition: formatter.h:61

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.

Referenced by _GLIBCXX_VISIBILITY().

#define __glibcxx_check_erase_after (   _Position)
Value:
_GLIBCXX_DEBUG_VERIFY(_Position._M_before_dereferenceable(), \
._M_sequence(*this, "this") \
._M_iterator(_Position, #_Position)); \
_GLIBCXX_DEBUG_VERIFY(_Position._M_attached_to(this), \
._M_sequence(*this, "this") \
._M_iterator(_Position, #_Position))
Definition: formatter.h:107
#define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)
Definition: macros.h:49
Definition: formatter.h:61

Verify that we can erase the element after the iterator _Position.

We can erase the element if the _Position iterator is before a dereferenceable one and references this sequence.

#define __glibcxx_check_erase_range (   _First,
  _Last 
)
Value:
_GLIBCXX_DEBUG_VERIFY(_First._M_attached_to(this), \
._M_sequence(*this, "this") \
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last))
#define __glibcxx_check_valid_range(_First, _Last)
Definition: macros.h:53
#define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)
Definition: macros.h:49
Definition: formatter.h:61

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.

Referenced by _GLIBCXX_VISIBILITY().

#define __glibcxx_check_erase_range_after (   _First,
  _Last 
)
Value:
_GLIBCXX_DEBUG_VERIFY(_First._M_can_compare(_Last), \
._M_sequence(*this, "this") \
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last)); \
_GLIBCXX_DEBUG_VERIFY(_First._M_attached_to(this), \
._M_sequence(*this, "this") \
._M_iterator(_First, #_First)); \
_GLIBCXX_DEBUG_VERIFY(_First != _Last, \
._M_sequence(*this, "this") \
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last)); \
_GLIBCXX_DEBUG_VERIFY(_First._M_incrementable(), \
._M_sequence(*this, "this") \
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last)); \
_GLIBCXX_DEBUG_VERIFY(!_Last._M_is_before_begin(), \
._M_sequence(*this, "this") \
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last)) \
#define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)
Definition: macros.h:49
Definition: formatter.h:61
Definition: formatter.h:108

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.

#define __glibcxx_check_heap (   _First,
  _Last 
)
Value:
_GLIBCXX_DEBUG_VERIFY(std::__is_heap(__gnu_debug::__base(_First), \
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last))
_Siter_base< _Iterator >::iterator_type __base(_Iterator __it)
Helper function to extract base iterator of random access safe iterator in order to reduce performanc...
Definition: functions.h:558
Definition: formatter.h:68
#define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)
Definition: macros.h:49
#define __glibcxx_check_heap_pred (   _First,
  _Last,
  _Pred 
)
Value:
_GLIBCXX_DEBUG_VERIFY(std::__is_heap(__gnu_debug::__base(_First), \
_Pred), \
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last) \
._M_string(#_Pred))
_Siter_base< _Iterator >::iterator_type __base(_Iterator __it)
Helper function to extract base iterator of random access safe iterator in order to reduce performanc...
Definition: functions.h:558
Definition: formatter.h:69
#define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)
Definition: macros.h:49

Verify that the iterator range [_First, _Last) is a heap w.r.t.

the predicate _Pred.

#define __glibcxx_check_insert (   _Position)
Value:
_GLIBCXX_DEBUG_VERIFY(!_Position._M_singular(), \
._M_sequence(*this, "this") \
._M_iterator(_Position, #_Position)); \
_GLIBCXX_DEBUG_VERIFY(_Position._M_attached_to(this), \
._M_sequence(*this, "this") \
._M_iterator(_Position, #_Position))
Definition: formatter.h:59
Definition: formatter.h:58
#define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)
Definition: macros.h:49

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, 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.

Referenced by _GLIBCXX_VISIBILITY().

#define __glibcxx_check_insert_after (   _Position)
Value:
_GLIBCXX_DEBUG_VERIFY(!_Position._M_is_end(), \
._M_sequence(*this, "this") \
._M_iterator(_Position, #_Position))
Definition: formatter.h:106
#define __glibcxx_check_insert(_Position)
Verify that we can insert into *this with the iterator _Position.
Definition: macros.h:73
#define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)
Definition: macros.h:49

Verify that we can insert into *this after the iterator _Position.

Insertion into a container after a specific position requires that the iterator be nonsingular, either dereferenceable or before-begin, 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.

#define __glibcxx_check_insert_range (   _Position,
  _First,
  _Last 
)
Value:
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last) \
._M_sequence(*this, "this"))
#define __glibcxx_check_insert(_Position)
Verify that we can insert into *this with the iterator _Position.
Definition: macros.h:73
#define __glibcxx_check_valid_range(_First, _Last)
Definition: macros.h:53
#define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)
Definition: macros.h:49
bool __foreign_iterator(const _Safe_iterator< _Iterator, _Sequence > &__it, _InputIterator __other, _InputIterator __other_end)
Definition: functions.h:290

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 which does not reference the sequence we are inserting into. Note that this macro is only valid when the container is a _Safe_sequence and the _Position iterator is a _Safe_iterator.

#define __glibcxx_check_insert_range_after (   _Position,
  _First,
  _Last 
)
Value:
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last) \
._M_sequence(*this, "this"))
#define __glibcxx_check_insert_after(_Position)
Verify that we can insert into *this after the iterator _Position.
Definition: macros.h:90
#define __glibcxx_check_valid_range(_First, _Last)
Definition: macros.h:53
#define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)
Definition: macros.h:49
bool __foreign_iterator(const _Safe_iterator< _Iterator, _Sequence > &__it, _InputIterator __other, _InputIterator __other_end)
Definition: functions.h:290

Verify that we can insert the values in the iterator range [_First, _Last) into *this after the iterator _Position.

Insertion into a container after 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 which does not reference the sequence we are inserting into. Note that this macro is only valid when the container is a _Safe_sequence and the _Position iterator is a _Safe_iterator.

#define __glibcxx_check_max_load_factor (   _F)
Value:
._M_sequence(*this, "this"))
#define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)
Definition: macros.h:49
Definition: formatter.h:116
#define __glibcxx_check_non_empty_range (   _First,
  _Last 
)
Value:
_GLIBCXX_DEBUG_VERIFY(_First != _Last, \
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last))
#define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)
Definition: macros.h:49
Definition: formatter.h:111
#define __glibcxx_check_nonempty ( )
Value:
_GLIBCXX_DEBUG_VERIFY(! this->empty(), \
._M_sequence(*this, "this"))
Definition: formatter.h:63
#define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)
Definition: macros.h:49
#define __glibcxx_check_partitioned_lower (   _First,
  _Last,
  _Value 
)
Value:
__gnu_debug::__base(_Last), _Value), \
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last) \
._M_string(#_Value))
Definition: formatter.h:64
_Siter_base< _Iterator >::iterator_type __base(_Iterator __it)
Helper function to extract base iterator of random access safe iterator in order to reduce performanc...
Definition: functions.h:558
bool __check_partitioned_lower(_ForwardIterator __first, _ForwardIterator __last, const _Tp &__value)
Definition: functions.h:465
#define __glibcxx_check_valid_range(_First, _Last)
Definition: macros.h:53
#define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)
Definition: macros.h:49

Verify that the iterator range [_First, _Last) is partitioned w.r.t.

the value _Value.

#define __glibcxx_check_partitioned_lower_pred (   _First,
  _Last,
  _Value,
  _Pred 
)
Value:
__gnu_debug::__base(_Last), _Value, _Pred), \
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last) \
._M_string(#_Pred) \
._M_string(#_Value))
_Siter_base< _Iterator >::iterator_type __base(_Iterator __it)
Helper function to extract base iterator of random access safe iterator in order to reduce performanc...
Definition: functions.h:558
bool __check_partitioned_lower(_ForwardIterator __first, _ForwardIterator __last, const _Tp &__value)
Definition: functions.h:465
#define __glibcxx_check_valid_range(_First, _Last)
Definition: macros.h:53
#define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)
Definition: macros.h:49
Definition: formatter.h:65

Verify that the iterator range [_First, _Last) is partitioned w.r.t.

the value _Value and predicate _Pred.

#define __glibcxx_check_partitioned_upper (   _First,
  _Last,
  _Value 
)
Value:
__gnu_debug::__base(_Last), _Value), \
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last) \
._M_string(#_Value))
Definition: formatter.h:64
_Siter_base< _Iterator >::iterator_type __base(_Iterator __it)
Helper function to extract base iterator of random access safe iterator in order to reduce performanc...
Definition: functions.h:558
bool __check_partitioned_upper(_ForwardIterator __first, _ForwardIterator __last, const _Tp &__value)
Definition: functions.h:481
#define __glibcxx_check_valid_range(_First, _Last)
Definition: macros.h:53
#define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)
Definition: macros.h:49
#define __glibcxx_check_partitioned_upper_pred (   _First,
  _Last,
  _Value,
  _Pred 
)
Value:
__gnu_debug::__base(_Last), _Value, _Pred), \
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last) \
._M_string(#_Pred) \
._M_string(#_Value))
_Siter_base< _Iterator >::iterator_type __base(_Iterator __it)
Helper function to extract base iterator of random access safe iterator in order to reduce performanc...
Definition: functions.h:558
bool __check_partitioned_upper(_ForwardIterator __first, _ForwardIterator __last, const _Tp &__value)
Definition: functions.h:481
#define __glibcxx_check_valid_range(_First, _Last)
Definition: macros.h:53
#define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)
Definition: macros.h:49
Definition: formatter.h:65

Verify that the iterator range [_First, _Last) is partitioned w.r.t.

the value _Value and predicate _Pred.

#define __glibcxx_check_self_move_assign (   _Other)
Value:
_GLIBCXX_DEBUG_VERIFY(this != &_Other, \
._M_sequence(*this, "this"))
#define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)
Definition: macros.h:49
Definition: formatter.h:113
#define __glibcxx_check_sorted (   _First,
  _Last 
)
Value:
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last))
bool __check_sorted(const _InputIterator &__first, const _InputIterator &__last)
Definition: functions.h:375
Definition: formatter.h:66
_Siter_base< _Iterator >::iterator_type __base(_Iterator __it)
Helper function to extract base iterator of random access safe iterator in order to reduce performanc...
Definition: functions.h:558
#define __glibcxx_check_valid_range(_First, _Last)
Definition: macros.h:53
#define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)
Definition: macros.h:49
#define __glibcxx_check_sorted_pred (   _First,
  _Last,
  _Pred 
)
Value:
__gnu_debug::__base(_Last), _Pred), \
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last) \
._M_string(#_Pred))
bool __check_sorted(const _InputIterator &__first, const _InputIterator &__last)
Definition: functions.h:375
_Siter_base< _Iterator >::iterator_type __base(_Iterator __it)
Helper function to extract base iterator of random access safe iterator in order to reduce performanc...
Definition: functions.h:558
Definition: formatter.h:67
#define __glibcxx_check_valid_range(_First, _Last)
Definition: macros.h:53
#define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)
Definition: macros.h:49

Verify that the iterator range [_First, _Last) is sorted by the predicate _Pred.

#define __glibcxx_check_sorted_set (   _First1,
  _Last1,
  _First2 
)
Value:
__gnu_debug::__base(_Last1), _First2),\
._M_iterator(_First1, #_First1) \
._M_iterator(_Last1, #_Last1))
Definition: formatter.h:66
_Siter_base< _Iterator >::iterator_type __base(_Iterator __it)
Helper function to extract base iterator of random access safe iterator in order to reduce performanc...
Definition: functions.h:558
#define __glibcxx_check_valid_range(_First, _Last)
Definition: macros.h:53
#define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)
Definition: macros.h:49
bool __check_sorted_set(const _InputIterator1 &__first, const _InputIterator1 &__last, const _InputIterator2 &)
Definition: functions.h:429
#define __glibcxx_check_sorted_set_pred (   _First1,
  _Last1,
  _First2,
  _Pred 
)
Value:
_First2, _Pred), \
._M_iterator(_First1, #_First1) \
._M_iterator(_Last1, #_Last1) \
._M_string(#_Pred))
_Siter_base< _Iterator >::iterator_type __base(_Iterator __it)
Helper function to extract base iterator of random access safe iterator in order to reduce performanc...
Definition: functions.h:558
Definition: formatter.h:67
#define __glibcxx_check_valid_range(_First, _Last)
Definition: macros.h:53
#define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)
Definition: macros.h:49
bool __check_sorted_set(const _InputIterator1 &__first, const _InputIterator1 &__last, const _InputIterator2 &)
Definition: functions.h:429
#define __glibcxx_check_string (   _String)
#define __glibcxx_check_string_len (   _String,
  _Len 
)
#define __glibcxx_check_subscript (   _N)
Value:
_GLIBCXX_DEBUG_VERIFY(_N < this->size(), \
._M_sequence(*this, "this") \
._M_integer(_N, #_N) \
._M_integer(this->size(), "size"))
#define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)
Definition: macros.h:49
Definition: formatter.h:62
#define __glibcxx_check_valid_range (   _First,
  _Last 
)
Value:
._M_iterator(_First, #_First) \
._M_iterator(_Last, #_Last))
bool __valid_range(const _InputIterator &__first, const _InputIterator &__last)
Don't know what these iterators are, or if they are even iterators (we may get an integral type for I...
Definition: functions.h:147
Definition: formatter.h:57
#define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)
Definition: macros.h:49

Referenced by __gnu_debug::__check_valid_range(), and _GLIBCXX_VISIBILITY().

#define _GLIBCXX_DEBUG_VERIFY_AT (   _Condition,
  _ErrorMessage,
  _File,
  _Line 
)
Value:
do \
{ \
if (! (_Condition)) \
._ErrorMessage._M_error(); \
} while (false)
_GLIBCXX_NORETURN void _M_error() const
static _Error_formatter _M_at(const char *__file, std::size_t __line)
Definition: formatter.h:459

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.