# macros.h File Reference

## Detailed Description

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

Definition in file macros.h.

Go to the source code of this file.

## Defines

- #define __glibcxx_check_erase(_Position)
- #define __glibcxx_check_erase_range(_First, _Last)
- #define __glibcxx_check_heap(_First, _Last)
- #define __glibcxx_check_heap_pred(_First, _Last, _Pred)
- #define __glibcxx_check_insert(_Position)
- #define __glibcxx_check_insert_range(_Position, _First, _Last)
- #define __glibcxx_check_nonempty()
- #define __glibcxx_check_partitioned(_First, _Last, _Value)
- #define __glibcxx_check_partitioned_pred(_First, _Last, _Value, _Pred)
- #define __glibcxx_check_sorted(_First, _Last)
- #define __glibcxx_check_sorted_pred(_First, _Last, _Pred)
- #define __glibcxx_check_strict_weak_ordering(_First, _Last)
- #define __glibcxx_check_strict_weak_ordering_pred(_First, _Last, _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_MACROS_H
- #define _GLIBCXX_DEBUG_VERIFY(_Condition, _ErrorMessage)

## Define Documentation

#define __glibcxx_check_erase | ( | _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 107 of file macros.h.

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

#define __glibcxx_check_erase_range | ( | _First,
|  | _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 121 of file macros.h.

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

#define __glibcxx_check_heap_pred | ( | _First,
|  | _Last,
|  | _Pred |  | ) |

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

Definition at line 207 of file macros.h.

#define __glibcxx_check_insert | ( | _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 69 of file macros.h.

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

#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. 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 92 of file macros.h.

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

#define __glibcxx_check_partitioned | ( | _First,
|  | _Last,
|  | _Value |  | ) |

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

Definition at line 176 of file macros.h.

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

Verify that the iterator range [_First, _Last) is partitioned w.r.t. the value _Value and predicate _Pred.

Definition at line 187 of file macros.h.

#define __glibcxx_check_sorted_pred | ( | _First,
|  | _Last,
|  | _Pred |  | ) |

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

Definition at line 165 of file macros.h.

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

#define _GLIBCXX_DEBUG_VERIFY | ( | _Condition,
|  | _ErrorMessage |  | ) |

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 47 of file macros.h.

Referenced by __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::_Safe_iterator(), std::__debug::bitset< _Nb >::reference::flip(), __gnu_debug::_Safe_iterator< _Iterator, _Sequence >::operator *(), std::__debug::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=(), std::__debug::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[](), std::__debug::bitset< _Nb >::reference::operator~(), and std::__debug::list< _Tp, _Allocator >::splice().