libstdc++
macros.h
Go to the documentation of this file.
00001 // Debugging support implementation -*- C++ -*-
00002 
00003 // Copyright (C) 2003-2019 Free Software Foundation, Inc.
00004 //
00005 // This file is part of the GNU ISO C++ Library.  This library is free
00006 // software; you can redistribute it and/or modify it under the
00007 // terms of the GNU General Public License as published by the
00008 // Free Software Foundation; either version 3, or (at your option)
00009 // any later version.
00010 
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 // GNU General Public License for more details.
00015 
00016 // Under Section 7 of GPL version 3, you are granted additional
00017 // permissions described in the GCC Runtime Library Exception, version
00018 // 3.1, as published by the Free Software Foundation.
00019 
00020 // You should have received a copy of the GNU General Public License and
00021 // a copy of the GCC Runtime Library Exception along with this program;
00022 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
00023 // <http://www.gnu.org/licenses/>.
00024 
00025 /** @file debug/macros.h
00026  *  This file is a GNU debug extension to the Standard C++ Library.
00027  */
00028 
00029 #ifndef _GLIBCXX_DEBUG_MACROS_H
00030 #define _GLIBCXX_DEBUG_MACROS_H 1
00031 
00032 /**
00033  * Macros used by the implementation to verify certain
00034  * properties. These macros may only be used directly by the debug
00035  * wrappers. Note that these are macros (instead of the more obviously
00036  * @a correct choice of making them functions) because we need line and
00037  * file information at the call site, to minimize the distance between
00038  * the user error and where the error is reported.
00039  *
00040  */
00041 #define _GLIBCXX_DEBUG_VERIFY_COND_AT(_Cond,_ErrMsg,_File,_Line,_Func)  \
00042   if (! (_Cond))                                                        \
00043     __gnu_debug::_Error_formatter::_S_at(_File, _Line, _Func)           \
00044       ._ErrMsg._M_error()
00045 
00046 #define _GLIBCXX_DEBUG_VERIFY_AT_F(_Cond,_ErrMsg,_File,_Line,_Func)     \
00047   do                                                                    \
00048   {                                                                     \
00049     _GLIBCXX_DEBUG_VERIFY_COND_AT(_Cond,_ErrMsg,_File,_Line,_Func);     \
00050   } while (false)
00051 
00052 #define _GLIBCXX_DEBUG_VERIFY_AT(_Cond,_ErrMsg,_File,_Line)             \
00053   _GLIBCXX_DEBUG_VERIFY_AT_F(_Cond,_ErrMsg,_File,_Line,__PRETTY_FUNCTION__)
00054 
00055 #define _GLIBCXX_DEBUG_VERIFY(_Cond,_ErrMsg)                            \
00056   _GLIBCXX_DEBUG_VERIFY_AT_F(_Cond, _ErrMsg, __FILE__, __LINE__,        \
00057                              __PRETTY_FUNCTION__)
00058 
00059 // Verify that [_First, _Last) forms a valid iterator range.
00060 #define __glibcxx_check_valid_range(_First,_Last)                       \
00061 _GLIBCXX_DEBUG_VERIFY(__gnu_debug::__valid_range(_First, _Last),        \
00062                       _M_message(__gnu_debug::__msg_valid_range)        \
00063                       ._M_iterator(_First, #_First)                     \
00064                       ._M_iterator(_Last, #_Last))
00065 
00066 #define __glibcxx_check_valid_range_at(_First,_Last,_File,_Line,_Func)  \
00067 _GLIBCXX_DEBUG_VERIFY_AT_F(__gnu_debug::__valid_range(_First, _Last),   \
00068                            _M_message(__gnu_debug::__msg_valid_range)   \
00069                            ._M_iterator(_First, #_First)                \
00070                            ._M_iterator(_Last, #_Last),                 \
00071                            _File,_Line,_Func)
00072 
00073 #define __glibcxx_check_valid_range2(_First,_Last,_Dist)                \
00074 _GLIBCXX_DEBUG_VERIFY(__gnu_debug::__valid_range(_First, _Last, _Dist), \
00075                       _M_message(__gnu_debug::__msg_valid_range)        \
00076                       ._M_iterator(_First, #_First)                     \
00077                       ._M_iterator(_Last, #_Last))
00078 
00079 #define __glibcxx_check_valid_constructor_range(_First,_Last)           \
00080   __gnu_debug::__check_valid_range(_First, _Last,                       \
00081                                    __FILE__, __LINE__, __PRETTY_FUNCTION__)
00082 
00083 // Verify that [_First, _Last) forms a non-empty iterator range.
00084 #define __glibcxx_check_non_empty_range(_First,_Last)                   \
00085 _GLIBCXX_DEBUG_VERIFY(_First != _Last,                                  \
00086                       _M_message(__gnu_debug::__msg_non_empty_range)    \
00087                       ._M_iterator(_First, #_First)                     \
00088                       ._M_iterator(_Last, #_Last))
00089 
00090 // Verify that [_First, _First + _Size) forms a valid range.
00091 #define __glibcxx_check_can_increment(_First,_Size)                     \
00092 _GLIBCXX_DEBUG_VERIFY(__gnu_debug::__can_advance(_First, _Size),        \
00093                       _M_message(__gnu_debug::__msg_iter_subscript_oob) \
00094                       ._M_iterator(_First, #_First)                     \
00095                       ._M_integer(_Size, #_Size))
00096 
00097 #define __glibcxx_check_can_increment_range(_First1,_Last1,_First2)     \
00098   do                                                                    \
00099   {                                                                     \
00100     typename __gnu_debug::_Distance_traits<__decltype(_First1)>::__type __dist;\
00101     _GLIBCXX_DEBUG_VERIFY_COND_AT(                                      \
00102                         __gnu_debug::__valid_range(_First1, _Last1, __dist),\
00103                         _M_message(__gnu_debug::__msg_valid_range)      \
00104                         ._M_iterator(_First1, #_First1)                 \
00105                         ._M_iterator(_Last1, #_Last1),                  \
00106                         __FILE__,__LINE__,__PRETTY_FUNCTION__);         \
00107     _GLIBCXX_DEBUG_VERIFY_COND_AT(                                      \
00108                         __gnu_debug::__can_advance(_First2, __dist.first),\
00109                         _M_message(__gnu_debug::__msg_iter_subscript_oob)\
00110                         ._M_iterator(_First2, #_First2)                 \
00111                         ._M_integer(__dist.first),                      \
00112                         __FILE__,__LINE__,__PRETTY_FUNCTION__);         \
00113   } while(false)
00114 
00115 #define __glibcxx_check_can_decrement_range(_First1,_Last1,_First2)     \
00116   do                                                                    \
00117   {                                                                     \
00118     typename __gnu_debug::_Distance_traits<__decltype(_First1)>::__type __dist;\
00119     _GLIBCXX_DEBUG_VERIFY_COND_AT(                                      \
00120                         __gnu_debug::__valid_range(_First1, _Last1, __dist),\
00121                         _M_message(__gnu_debug::__msg_valid_range)      \
00122                         ._M_iterator(_First1, #_First1)                 \
00123                         ._M_iterator(_Last1, #_Last1),                  \
00124                         __FILE__,__LINE__,__PRETTY_FUNCTION__);         \
00125     _GLIBCXX_DEBUG_VERIFY_COND_AT(                                      \
00126                         __gnu_debug::__can_advance(_First2, -__dist.first),\
00127                         _M_message(__gnu_debug::__msg_iter_subscript_oob)\
00128                         ._M_iterator(_First2, #_First2)                 \
00129                         ._M_integer(-__dist.first),                     \
00130                         __FILE__,__LINE__,__PRETTY_FUNCTION__);         \
00131   } while(false)
00132 
00133 /** Verify that we can insert into *this with the iterator _Position.
00134  *  Insertion into a container at a specific position requires that
00135  *  the iterator be nonsingular, either dereferenceable or past-the-end,
00136  *  and that it reference the sequence we are inserting into. Note that
00137  *  this macro is only valid when the container is a_Safe_sequence and
00138  *  the iterator is a _Safe_iterator.
00139 */
00140 #define __glibcxx_check_insert(_Position)                               \
00141 _GLIBCXX_DEBUG_VERIFY(!_Position._M_singular(),                         \
00142                       _M_message(__gnu_debug::__msg_insert_singular)    \
00143                       ._M_sequence(*this, "this")                       \
00144                       ._M_iterator(_Position, #_Position));             \
00145 _GLIBCXX_DEBUG_VERIFY(_Position._M_attached_to(this),                   \
00146                       _M_message(__gnu_debug::__msg_insert_different)   \
00147                       ._M_sequence(*this, "this")                       \
00148                       ._M_iterator(_Position, #_Position))
00149 
00150 /** Verify that we can insert into *this after the iterator _Position.
00151  *  Insertion into a container after a specific position requires that
00152  *  the iterator be nonsingular, either dereferenceable or before-begin,
00153  *  and that it reference the sequence we are inserting into. Note that
00154  *  this macro is only valid when the container is a_Safe_sequence and
00155  *  the iterator is a _Safe_iterator.
00156 */
00157 #define __glibcxx_check_insert_after(_Position)                         \
00158 __glibcxx_check_insert(_Position);                                      \
00159 _GLIBCXX_DEBUG_VERIFY(!_Position._M_is_end(),                           \
00160                       _M_message(__gnu_debug::__msg_insert_after_end)   \
00161                       ._M_sequence(*this, "this")                       \
00162                       ._M_iterator(_Position, #_Position))
00163 
00164 /** Verify that we can insert the values in the iterator range
00165  *  [_First, _Last) into *this with the iterator _Position.  Insertion
00166  *  into a container at a specific position requires that the iterator
00167  *  be nonsingular (i.e., either dereferenceable or past-the-end),
00168  *  that it reference the sequence we are inserting into, and that the
00169  *  iterator range [_First, _Last) is a valid (possibly empty)
00170  *  range which does not reference the sequence we are inserting into.
00171  *  Note that this macro is only valid when the container is a
00172  *  _Safe_sequence and the _Position iterator is a _Safe_iterator.
00173 */
00174 #define __glibcxx_check_insert_range(_Position,_First,_Last,_Dist)      \
00175 __glibcxx_check_valid_range2(_First,_Last,_Dist);                       \
00176 __glibcxx_check_insert(_Position);                                      \
00177 _GLIBCXX_DEBUG_VERIFY(__gnu_debug::__foreign_iterator(_Position,_First,_Last),\
00178                       _M_message(__gnu_debug::__msg_insert_range_from_self)\
00179                       ._M_iterator(_First, #_First)                     \
00180                       ._M_iterator(_Last, #_Last)                       \
00181                       ._M_sequence(*this, "this"))
00182 
00183 /** Verify that we can insert the values in the iterator range
00184  *  [_First, _Last) into *this after the iterator _Position.  Insertion
00185  *  into a container after a specific position requires that the iterator
00186  *  be nonsingular (i.e., either dereferenceable or past-the-end),
00187  *  that it reference the sequence we are inserting into, and that the
00188  *  iterator range [_First, _Last) is a valid (possibly empty)
00189  *  range which does not reference the sequence we are inserting into.
00190  *  Note that this macro is only valid when the container is a
00191  *  _Safe_sequence and the _Position iterator is a _Safe_iterator.
00192 */
00193 #define __glibcxx_check_insert_range_after(_Position,_First,_Last,_Dist)\
00194 __glibcxx_check_valid_range2(_First,_Last,_Dist);                       \
00195 __glibcxx_check_insert_after(_Position);                                \
00196 _GLIBCXX_DEBUG_VERIFY(__gnu_debug::__foreign_iterator(_Position,_First,_Last),\
00197                       _M_message(__gnu_debug::__msg_insert_range_from_self)\
00198                       ._M_iterator(_First, #_First)                     \
00199                       ._M_iterator(_Last, #_Last)                       \
00200                       ._M_sequence(*this, "this"))
00201 
00202 /** Verify that we can erase the element referenced by the iterator
00203  * _Position. We can erase the element if the _Position iterator is
00204  * dereferenceable and references this sequence.
00205 */
00206 #define __glibcxx_check_erase(_Position)                                \
00207 _GLIBCXX_DEBUG_VERIFY(_Position._M_dereferenceable(),                   \
00208                       _M_message(__gnu_debug::__msg_erase_bad)          \
00209                       ._M_sequence(*this, "this")                       \
00210                       ._M_iterator(_Position, #_Position));             \
00211 _GLIBCXX_DEBUG_VERIFY(_Position._M_attached_to(this),                   \
00212                       _M_message(__gnu_debug::__msg_erase_different)    \
00213                       ._M_sequence(*this, "this")                       \
00214                       ._M_iterator(_Position, #_Position))
00215 
00216 /** Verify that we can erase the element after the iterator
00217  * _Position. We can erase the element if the _Position iterator is
00218  * before a dereferenceable one and references this sequence.
00219 */
00220 #define __glibcxx_check_erase_after(_Position)                          \
00221 _GLIBCXX_DEBUG_VERIFY(_Position._M_before_dereferenceable(),            \
00222                       _M_message(__gnu_debug::__msg_erase_after_bad)    \
00223                       ._M_sequence(*this, "this")                       \
00224                       ._M_iterator(_Position, #_Position));             \
00225 _GLIBCXX_DEBUG_VERIFY(_Position._M_attached_to(this),                   \
00226                       _M_message(__gnu_debug::__msg_erase_different)    \
00227                       ._M_sequence(*this, "this")                       \
00228                       ._M_iterator(_Position, #_Position))
00229 
00230 /** Verify that we can erase the elements in the iterator range
00231  *  [_First, _Last). We can erase the elements if [_First, _Last) is a
00232  *  valid iterator range within this sequence.
00233 */
00234 #define __glibcxx_check_erase_range(_First,_Last)                       \
00235 __glibcxx_check_valid_range(_First,_Last);                              \
00236 _GLIBCXX_DEBUG_VERIFY(_First._M_attached_to(this),                      \
00237                       _M_message(__gnu_debug::__msg_erase_different)    \
00238                       ._M_sequence(*this, "this")                       \
00239                       ._M_iterator(_First, #_First)                     \
00240                       ._M_iterator(_Last, #_Last))
00241 
00242 /** Verify that we can erase the elements in the iterator range
00243  *  (_First, _Last). We can erase the elements if (_First, _Last) is a
00244  *  valid iterator range within this sequence.
00245 */
00246 #define __glibcxx_check_erase_range_after(_First,_Last)                 \
00247 _GLIBCXX_DEBUG_VERIFY(_First._M_can_compare(_Last),                     \
00248                       _M_message(__gnu_debug::__msg_erase_different)    \
00249                       ._M_sequence(*this, "this")                       \
00250                       ._M_iterator(_First, #_First)                     \
00251                       ._M_iterator(_Last, #_Last));                     \
00252 _GLIBCXX_DEBUG_VERIFY(_First._M_attached_to(this),                      \
00253                       _M_message(__gnu_debug::__msg_erase_different)    \
00254                       ._M_sequence(*this, "this")                       \
00255                       ._M_iterator(_First, #_First));                   \
00256 _GLIBCXX_DEBUG_VERIFY(_First != _Last,                                  \
00257                       _M_message(__gnu_debug::__msg_valid_range2)       \
00258                       ._M_sequence(*this, "this")                       \
00259                       ._M_iterator(_First, #_First)                     \
00260                       ._M_iterator(_Last, #_Last));                     \
00261 _GLIBCXX_DEBUG_VERIFY(_First._M_incrementable(),                        \
00262                       _M_message(__gnu_debug::__msg_valid_range2)       \
00263                       ._M_sequence(*this, "this")                       \
00264                       ._M_iterator(_First, #_First)                     \
00265                       ._M_iterator(_Last, #_Last));                     \
00266 _GLIBCXX_DEBUG_VERIFY(!_Last._M_is_before_begin(),                      \
00267                       _M_message(__gnu_debug::__msg_valid_range2)       \
00268                       ._M_sequence(*this, "this")                       \
00269                       ._M_iterator(_First, #_First)                     \
00270                       ._M_iterator(_Last, #_Last))                      \
00271 
00272 // Verify that the subscript _N is less than the container's size.
00273 #define __glibcxx_check_subscript(_N)                                   \
00274 _GLIBCXX_DEBUG_VERIFY(_N < this->size(),                                \
00275                       _M_message(__gnu_debug::__msg_subscript_oob)      \
00276                       ._M_sequence(*this, "this")                       \
00277                       ._M_integer(_N, #_N)                              \
00278                       ._M_integer(this->size(), "size"))
00279 
00280 // Verify that the bucket _N is less than the container's buckets count.
00281 #define __glibcxx_check_bucket_index(_N)                                \
00282 _GLIBCXX_DEBUG_VERIFY(_N < this->bucket_count(),                        \
00283                       _M_message(__gnu_debug::__msg_bucket_index_oob)   \
00284                       ._M_sequence(*this, "this")                       \
00285                       ._M_integer(_N, #_N)                              \
00286                       ._M_integer(this->bucket_count(), "size"))
00287 
00288 // Verify that the container is nonempty
00289 #define __glibcxx_check_nonempty()                                      \
00290 _GLIBCXX_DEBUG_VERIFY(! this->empty(),                                  \
00291                       _M_message(__gnu_debug::__msg_empty)              \
00292                       ._M_sequence(*this, "this"))
00293 
00294 // Verify that the iterator range [_First, _Last) is sorted
00295 #define __glibcxx_check_sorted(_First,_Last)                            \
00296 __glibcxx_check_valid_range(_First,_Last);                              \
00297  _GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_sorted(                     \
00298                         __gnu_debug::__base(_First),                    \
00299                         __gnu_debug::__base(_Last)),                    \
00300                       _M_message(__gnu_debug::__msg_unsorted)           \
00301                       ._M_iterator(_First, #_First)                     \
00302                       ._M_iterator(_Last, #_Last))
00303 
00304 /** Verify that the iterator range [_First, _Last) is sorted by the
00305     predicate _Pred. */
00306 #define __glibcxx_check_sorted_pred(_First,_Last,_Pred)                 \
00307 __glibcxx_check_valid_range(_First,_Last);                              \
00308 _GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_sorted(                      \
00309                         __gnu_debug::__base(_First),                    \
00310                         __gnu_debug::__base(_Last), _Pred),             \
00311                       _M_message(__gnu_debug::__msg_unsorted_pred)      \
00312                       ._M_iterator(_First, #_First)                     \
00313                       ._M_iterator(_Last, #_Last)                       \
00314                       ._M_string(#_Pred))
00315 
00316 // Special variant for std::merge, std::includes, std::set_*
00317 #define __glibcxx_check_sorted_set(_First1,_Last1,_First2)              \
00318 __glibcxx_check_valid_range(_First1,_Last1);                            \
00319 _GLIBCXX_DEBUG_VERIFY(                                                  \
00320   __gnu_debug::__check_sorted_set(__gnu_debug::__base(_First1),         \
00321                                   __gnu_debug::__base(_Last1), _First2),\
00322   _M_message(__gnu_debug::__msg_unsorted)                               \
00323   ._M_iterator(_First1, #_First1)                                       \
00324   ._M_iterator(_Last1, #_Last1))
00325 
00326 // Likewise with a _Pred.
00327 #define __glibcxx_check_sorted_set_pred(_First1,_Last1,_First2,_Pred)   \
00328 __glibcxx_check_valid_range(_First1,_Last1);                            \
00329 _GLIBCXX_DEBUG_VERIFY(                                                  \
00330   __gnu_debug::__check_sorted_set(__gnu_debug::__base(_First1),         \
00331                                   __gnu_debug::__base(_Last1),          \
00332                                   _First2, _Pred),                      \
00333   _M_message(__gnu_debug::__msg_unsorted_pred)                          \
00334   ._M_iterator(_First1, #_First1)                                       \
00335   ._M_iterator(_Last1, #_Last1)                                         \
00336   ._M_string(#_Pred))
00337 
00338 /** Verify that the iterator range [_First, _Last) is partitioned
00339     w.r.t. the value _Value. */
00340 #define __glibcxx_check_partitioned_lower(_First,_Last,_Value)          \
00341 __glibcxx_check_valid_range(_First,_Last);                              \
00342 _GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_partitioned_lower(           \
00343                         __gnu_debug::__base(_First),                    \
00344                         __gnu_debug::__base(_Last), _Value),            \
00345                       _M_message(__gnu_debug::__msg_unpartitioned)      \
00346                       ._M_iterator(_First, #_First)                     \
00347                       ._M_iterator(_Last, #_Last)                       \
00348                       ._M_string(#_Value))
00349 
00350 #define __glibcxx_check_partitioned_upper(_First,_Last,_Value)          \
00351 __glibcxx_check_valid_range(_First,_Last);                              \
00352 _GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_partitioned_upper(           \
00353                         __gnu_debug::__base(_First),                    \
00354                         __gnu_debug::__base(_Last), _Value),            \
00355                       _M_message(__gnu_debug::__msg_unpartitioned)      \
00356                       ._M_iterator(_First, #_First)                     \
00357                       ._M_iterator(_Last, #_Last)                       \
00358                       ._M_string(#_Value))
00359 
00360 /** Verify that the iterator range [_First, _Last) is partitioned
00361     w.r.t. the value _Value and predicate _Pred. */
00362 #define __glibcxx_check_partitioned_lower_pred(_First,_Last,_Value,_Pred) \
00363 __glibcxx_check_valid_range(_First,_Last);                              \
00364 _GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_partitioned_lower(           \
00365                         __gnu_debug::__base(_First),                    \
00366                         __gnu_debug::__base(_Last), _Value, _Pred),     \
00367                       _M_message(__gnu_debug::__msg_unpartitioned_pred) \
00368                       ._M_iterator(_First, #_First)                     \
00369                       ._M_iterator(_Last, #_Last)                       \
00370                       ._M_string(#_Pred)                                \
00371                       ._M_string(#_Value))
00372 
00373 /** Verify that the iterator range [_First, _Last) is partitioned
00374     w.r.t. the value _Value and predicate _Pred. */
00375 #define __glibcxx_check_partitioned_upper_pred(_First,_Last,_Value,_Pred) \
00376 __glibcxx_check_valid_range(_First,_Last);                              \
00377 _GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_partitioned_upper(           \
00378                         __gnu_debug::__base(_First),                    \
00379                         __gnu_debug::__base(_Last), _Value, _Pred),     \
00380                       _M_message(__gnu_debug::__msg_unpartitioned_pred) \
00381                       ._M_iterator(_First, #_First)                     \
00382                       ._M_iterator(_Last, #_Last)                       \
00383                       ._M_string(#_Pred)                                \
00384                       ._M_string(#_Value))
00385 
00386 // Verify that the iterator range [_First, _Last) is a heap
00387 #define __glibcxx_check_heap(_First,_Last)                              \
00388   _GLIBCXX_DEBUG_VERIFY(std::__is_heap(__gnu_debug::__base(_First),     \
00389                                        __gnu_debug::__base(_Last)),     \
00390                       _M_message(__gnu_debug::__msg_not_heap)           \
00391                       ._M_iterator(_First, #_First)                     \
00392                       ._M_iterator(_Last, #_Last))
00393 
00394 /** Verify that the iterator range [_First, _Last) is a heap
00395     w.r.t. the predicate _Pred. */
00396 #define __glibcxx_check_heap_pred(_First,_Last,_Pred)                   \
00397   _GLIBCXX_DEBUG_VERIFY(std::__is_heap(__gnu_debug::__base(_First),     \
00398                                        __gnu_debug::__base(_Last),      \
00399                                        _Pred),                          \
00400                       _M_message(__gnu_debug::__msg_not_heap_pred)      \
00401                       ._M_iterator(_First, #_First)                     \
00402                       ._M_iterator(_Last, #_Last)                       \
00403                       ._M_string(#_Pred))
00404 
00405 // Verify that the container is not self move assigned
00406 #define __glibcxx_check_self_move_assign(_Other)                        \
00407 _GLIBCXX_DEBUG_VERIFY(this != &_Other,                                  \
00408                       _M_message(__gnu_debug::__msg_self_move_assign)   \
00409                       ._M_sequence(*this, "this"))
00410 
00411 // Verify that load factor is positive
00412 #define __glibcxx_check_max_load_factor(_F)                             \
00413 _GLIBCXX_DEBUG_VERIFY(_F > 0.0f,                                        \
00414                       _M_message(__gnu_debug::__msg_valid_load_factor)  \
00415                       ._M_sequence(*this, "this"))
00416 
00417 #define __glibcxx_check_equal_allocs(_This, _Other)                     \
00418 _GLIBCXX_DEBUG_VERIFY(_This.get_allocator() == _Other.get_allocator(),  \
00419                       _M_message(__gnu_debug::__msg_equal_allocs)       \
00420                       ._M_sequence(_This, "this"))
00421 
00422 #define __glibcxx_check_string(_String) _GLIBCXX_DEBUG_PEDASSERT(_String != 0)
00423 #define __glibcxx_check_string_len(_String,_Len) \
00424   _GLIBCXX_DEBUG_PEDASSERT(_String != 0 || _Len == 0)
00425 
00426 // Verify that a predicate is irreflexive
00427 #define __glibcxx_check_irreflexive(_First,_Last)                       \
00428   _GLIBCXX_DEBUG_VERIFY(_First == _Last || !(*_First < *_First),        \
00429                         _M_message(__gnu_debug::__msg_irreflexive_ordering) \
00430                         ._M_iterator_value_type(_First, "< operator type"))
00431 
00432 #if __cplusplus >= 201103L
00433 # define __glibcxx_check_irreflexive2(_First,_Last)                     \
00434   _GLIBCXX_DEBUG_VERIFY(_First == _Last                                 \
00435                         || __gnu_debug::__is_irreflexive(_First),       \
00436                         _M_message(__gnu_debug::__msg_irreflexive_ordering) \
00437                         ._M_iterator_value_type(_First, "< operator type"))
00438 #else
00439 # define __glibcxx_check_irreflexive2(_First,_Last)
00440 #endif
00441 
00442 #define __glibcxx_check_irreflexive_pred(_First,_Last,_Pred)            \
00443   _GLIBCXX_DEBUG_VERIFY(_First == _Last || !_Pred(*_First, *_First),            \
00444                         _M_message(__gnu_debug::__msg_irreflexive_ordering) \
00445                         ._M_instance(_Pred, "functor")                  \
00446                         ._M_iterator_value_type(_First, "ordered type"))
00447 
00448 #if __cplusplus >= 201103L
00449 # define __glibcxx_check_irreflexive_pred2(_First,_Last,_Pred)          \
00450   _GLIBCXX_DEBUG_VERIFY(_First == _Last                                 \
00451                         ||__gnu_debug::__is_irreflexive_pred(_First, _Pred), \
00452                         _M_message(__gnu_debug::__msg_irreflexive_ordering) \
00453                         ._M_instance(_Pred, "functor")                  \
00454                         ._M_iterator_value_type(_First, "ordered type"))
00455 #else
00456 # define __glibcxx_check_irreflexive_pred2(_First,_Last,_Pred)
00457 #endif
00458 
00459 #endif