347
345
_LIBCPP_INLINE_VISIBILITY
348
346
const _Hash& hash_function() const _NOEXCEPT {return *this;}
349
347
_LIBCPP_INLINE_VISIBILITY
350
size_t operator()(const _Pp& __x) const
351
{return static_cast<const _Hash&>(*this)(__x.first);}
352
_LIBCPP_INLINE_VISIBILITY
353
348
size_t operator()(const _Cp& __x) const
354
{return static_cast<const _Hash&>(*this)(__x.first);}
349
{return static_cast<const _Hash&>(*this)(__x.__cc.first);}
355
350
_LIBCPP_INLINE_VISIBILITY
356
351
size_t operator()(const _Key& __x) const
357
352
{return static_cast<const _Hash&>(*this)(__x);}
360
template <class _Key, class _Tp, class _Hash>
361
class __unordered_map_hasher<_Key, _Tp, _Hash, false>
355
template <class _Key, class _Cp, class _Hash>
356
class __unordered_map_hasher<_Key, _Cp, _Hash, false>
365
typedef pair<typename remove_const<_Key>::type, _Tp> _Pp;
366
typedef pair<const _Key, _Tp> _Cp;
368
361
_LIBCPP_INLINE_VISIBILITY
369
362
__unordered_map_hasher()
376
369
_LIBCPP_INLINE_VISIBILITY
377
370
const _Hash& hash_function() const _NOEXCEPT {return __hash_;}
378
371
_LIBCPP_INLINE_VISIBILITY
379
size_t operator()(const _Pp& __x) const
380
{return __hash_(__x.first);}
381
_LIBCPP_INLINE_VISIBILITY
382
372
size_t operator()(const _Cp& __x) const
383
{return __hash_(__x.first);}
373
{return __hash_(__x.__cc.first);}
384
374
_LIBCPP_INLINE_VISIBILITY
385
375
size_t operator()(const _Key& __x) const
386
376
{return __hash_(__x);}
389
template <class _Key, class _Tp, class _Pred, bool = is_empty<_Pred>::value
379
template <class _Key, class _Cp, class _Pred, bool = is_empty<_Pred>::value
390
380
#if __has_feature(is_final)
391
381
&& !__is_final(_Pred)
408
396
_LIBCPP_INLINE_VISIBILITY
409
397
const _Pred& key_eq() const _NOEXCEPT {return *this;}
410
398
_LIBCPP_INLINE_VISIBILITY
411
bool operator()(const _Pp& __x, const _Pp& __y) const
412
{return static_cast<const _Pred&>(*this)(__x.first, __y.first);}
413
_LIBCPP_INLINE_VISIBILITY
414
bool operator()(const _Pp& __x, const _Cp& __y) const
415
{return static_cast<const _Pred&>(*this)(__x.first, __y.first);}
416
_LIBCPP_INLINE_VISIBILITY
417
bool operator()(const _Pp& __x, const _Key& __y) const
418
{return static_cast<const _Pred&>(*this)(__x.first, __y);}
419
_LIBCPP_INLINE_VISIBILITY
420
bool operator()(const _Cp& __x, const _Pp& __y) const
421
{return static_cast<const _Pred&>(*this)(__x.first, __y.first);}
422
_LIBCPP_INLINE_VISIBILITY
423
399
bool operator()(const _Cp& __x, const _Cp& __y) const
424
{return static_cast<const _Pred&>(*this)(__x.first, __y.first);}
400
{return static_cast<const _Pred&>(*this)(__x.__cc.first, __y.__cc.first);}
425
401
_LIBCPP_INLINE_VISIBILITY
426
402
bool operator()(const _Cp& __x, const _Key& __y) const
427
{return static_cast<const _Pred&>(*this)(__x.first, __y);}
428
_LIBCPP_INLINE_VISIBILITY
429
bool operator()(const _Key& __x, const _Pp& __y) const
430
{return static_cast<const _Pred&>(*this)(__x, __y.first);}
403
{return static_cast<const _Pred&>(*this)(__x.__cc.first, __y);}
431
404
_LIBCPP_INLINE_VISIBILITY
432
405
bool operator()(const _Key& __x, const _Cp& __y) const
433
{return static_cast<const _Pred&>(*this)(__x, __y.first);}
434
_LIBCPP_INLINE_VISIBILITY
435
bool operator()(const _Key& __x, const _Key& __y) const
436
{return static_cast<const _Pred&>(*this)(__x, __y);}
406
{return static_cast<const _Pred&>(*this)(__x, __y.__cc.first);}
439
template <class _Key, class _Tp, class _Pred>
440
class __unordered_map_equal<_Key, _Tp, _Pred, false>
409
template <class _Key, class _Cp, class _Pred>
410
class __unordered_map_equal<_Key, _Cp, _Pred, false>
444
typedef pair<typename remove_const<_Key>::type, _Tp> _Pp;
445
typedef pair<const _Key, _Tp> _Cp;
447
415
_LIBCPP_INLINE_VISIBILITY
448
416
__unordered_map_equal()
455
423
_LIBCPP_INLINE_VISIBILITY
456
424
const _Pred& key_eq() const _NOEXCEPT {return __pred_;}
457
425
_LIBCPP_INLINE_VISIBILITY
458
bool operator()(const _Pp& __x, const _Pp& __y) const
459
{return __pred_(__x.first, __y.first);}
460
_LIBCPP_INLINE_VISIBILITY
461
bool operator()(const _Pp& __x, const _Cp& __y) const
462
{return __pred_(__x.first, __y.first);}
463
_LIBCPP_INLINE_VISIBILITY
464
bool operator()(const _Pp& __x, const _Key& __y) const
465
{return __pred_(__x.first, __y);}
466
_LIBCPP_INLINE_VISIBILITY
467
bool operator()(const _Cp& __x, const _Pp& __y) const
468
{return __pred_(__x.first, __y.first);}
469
_LIBCPP_INLINE_VISIBILITY
470
426
bool operator()(const _Cp& __x, const _Cp& __y) const
471
{return __pred_(__x.first, __y.first);}
427
{return __pred_(__x.__cc.first, __y.__cc.first);}
472
428
_LIBCPP_INLINE_VISIBILITY
473
429
bool operator()(const _Cp& __x, const _Key& __y) const
474
{return __pred_(__x.first, __y);}
475
_LIBCPP_INLINE_VISIBILITY
476
bool operator()(const _Key& __x, const _Pp& __y) const
477
{return __pred_(__x, __y.first);}
430
{return __pred_(__x.__cc.first, __y);}
478
431
_LIBCPP_INLINE_VISIBILITY
479
432
bool operator()(const _Key& __x, const _Cp& __y) const
480
{return __pred_(__x, __y.first);}
481
_LIBCPP_INLINE_VISIBILITY
482
bool operator()(const _Key& __x, const _Key& __y) const
483
{return __pred_(__x, __y);}
433
{return __pred_(__x, __y.__cc.first);}
486
436
template <class _Alloc>
535
485
void operator()(pointer __p) _NOEXCEPT
537
487
if (__second_constructed)
538
__alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.second));
488
__alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.__cc.second));
539
489
if (__first_constructed)
540
__alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.first));
490
__alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.__cc.first));
542
492
__alloc_traits::deallocate(__na_, __p, 1);
549
499
_HashIterator __i_;
551
501
typedef pointer_traits<typename _HashIterator::pointer> __pointer_traits;
552
typedef const typename _HashIterator::value_type::first_type key_type;
553
typedef typename _HashIterator::value_type::second_type mapped_type;
502
typedef const typename _HashIterator::value_type::value_type::first_type key_type;
503
typedef typename _HashIterator::value_type::value_type::second_type mapped_type;
555
505
typedef forward_iterator_tag iterator_category;
556
506
typedef pair<key_type, mapped_type> value_type;
571
521
__hash_map_iterator(_HashIterator __i) _NOEXCEPT : __i_(__i) {}
573
523
_LIBCPP_INLINE_VISIBILITY
574
reference operator*() const {return *operator->();}
524
reference operator*() const {return __i_->__cc;}
575
525
_LIBCPP_INLINE_VISIBILITY
576
pointer operator->() const {return (pointer)__i_.operator->();}
526
pointer operator->() const {return pointer_traits<pointer>::pointer_to(__i_->__cc);}
578
528
_LIBCPP_INLINE_VISIBILITY
579
529
__hash_map_iterator& operator++() {++__i_; return *this;}
605
555
_HashIterator __i_;
607
557
typedef pointer_traits<typename _HashIterator::pointer> __pointer_traits;
608
typedef const typename _HashIterator::value_type::first_type key_type;
609
typedef typename _HashIterator::value_type::second_type mapped_type;
558
typedef const typename _HashIterator::value_type::value_type::first_type key_type;
559
typedef typename _HashIterator::value_type::value_type::second_type mapped_type;
611
561
typedef forward_iterator_tag iterator_category;
612
562
typedef pair<key_type, mapped_type> value_type;
632
582
: __i_(__i.__i_) {}
634
584
_LIBCPP_INLINE_VISIBILITY
635
reference operator*() const {return *operator->();}
585
reference operator*() const {return __i_->__cc;}
636
586
_LIBCPP_INLINE_VISIBILITY
637
pointer operator->() const {return (pointer)__i_.operator->();}
587
pointer operator->() const {return pointer_traits<pointer>::pointer_to(__i_->__cc);}
639
589
_LIBCPP_INLINE_VISIBILITY
640
590
__hash_map_const_iterator& operator++() {++__i_; return *this;}
671
621
typedef _Pred key_equal;
672
622
typedef _Alloc allocator_type;
673
623
typedef pair<const key_type, mapped_type> value_type;
624
typedef pair<key_type, mapped_type> __nc_value_type;
674
625
typedef value_type& reference;
675
626
typedef const value_type& const_reference;
627
static_assert((is_same<value_type, typename allocator_type::value_type>::value),
628
"Invalid allocator::value_type");
678
typedef pair<key_type, mapped_type> __value_type;
679
typedef __unordered_map_hasher<key_type, mapped_type, hasher> __hasher;
680
typedef __unordered_map_equal<key_type, mapped_type, key_equal> __key_equal;
631
#if __cplusplus >= 201103L
634
typedef typename unordered_map::value_type value_type;
635
typedef typename unordered_map::__nc_value_type __nc_value_type;
637
__nc_value_type __nc;
639
template <class ..._Args>
640
__value_type(_Args&& ...__args)
641
: __cc(std::forward<_Args>(__args)...) {}
643
__value_type(const __value_type& __v)
644
: __cc(std::move(__v.__cc)) {}
646
__value_type(__value_type&& __v)
647
: __nc(std::move(__v.__nc)) {}
649
__value_type& operator=(const __value_type& __v)
650
{__nc = __v.__cc; return *this;}
652
__value_type& operator=(__value_type&& __v)
653
{__nc = std::move(__v.__nc); return *this;}
655
~__value_type() {__cc.~value_type();}
660
typedef typename unordered_map::value_type value_type;
666
__value_type(const _A0& __a0)
669
template <class _A0, class _A1>
670
__value_type(const _A0& __a0, const _A1& __a1)
671
: __cc(__a0, __a1) {}
674
typedef __unordered_map_hasher<key_type, __value_type, hasher> __hasher;
675
typedef __unordered_map_equal<key_type, __value_type, key_equal> __key_equal;
681
676
typedef typename allocator_traits<allocator_type>::template
682
677
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
683
678
rebind_alloc<__value_type>
713
708
_LIBCPP_INLINE_VISIBILITY
715
710
_NOEXCEPT_(is_nothrow_default_constructible<__table>::value)
712
#if _LIBCPP_DEBUG_LEVEL >= 2
713
__get_db()->__insert_c(this);
717
716
explicit unordered_map(size_type __n, const hasher& __hf = hasher(),
718
717
const key_equal& __eql = key_equal());
719
718
unordered_map(size_type __n, const hasher& __hf,
750
749
_LIBCPP_INLINE_VISIBILITY
751
750
unordered_map& operator=(const unordered_map& __u)
752
#if __cplusplus >= 201103L
753
753
__table_ = __u.__table_;
756
__table_.hash_function() = __u.__table_.hash_function();
757
__table_.key_eq() = __u.__table_.key_eq();
758
__table_.max_load_factor() = __u.__table_.max_load_factor();
759
__table_.__copy_assign_alloc(__u.__table_);
760
insert(__u.begin(), __u.end());
756
764
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
794
802
template <class... _Args>
795
803
_LIBCPP_INLINE_VISIBILITY
804
#if _LIBCPP_DEBUG_LEVEL >= 2
805
iterator emplace_hint(const_iterator __p, _Args&&... __args)
807
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
808
"unordered_map::emplace_hint(const_iterator, args...) called with an iterator not"
809
" referring to this unordered_map");
810
return __table_.__emplace_unique(_VSTD::forward<_Args>(__args)...).first;
796
813
iterator emplace_hint(const_iterator, _Args&&... __args)
797
814
{return emplace(_VSTD::forward<_Args>(__args)...).first;}
798
816
#endif // _LIBCPP_HAS_NO_VARIADICS
799
817
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
800
818
_LIBCPP_INLINE_VISIBILITY
808
826
{return __table_.__insert_unique(_VSTD::forward<_Pp>(__x));}
809
827
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
810
828
_LIBCPP_INLINE_VISIBILITY
829
#if _LIBCPP_DEBUG_LEVEL >= 2
830
iterator insert(const_iterator __p, const value_type& __x)
832
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
833
"unordered_map::insert(const_iterator, const value_type&) called with an iterator not"
834
" referring to this unordered_map");
835
return insert(__x).first;
811
838
iterator insert(const_iterator, const value_type& __x)
812
839
{return insert(__x).first;}
813
841
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
814
842
template <class _Pp,
815
843
class = typename enable_if<is_constructible<value_type, _Pp>::value>::type>
816
844
_LIBCPP_INLINE_VISIBILITY
845
#if _LIBCPP_DEBUG_LEVEL >= 2
846
iterator insert(const_iterator __p, _Pp&& __x)
848
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
849
"unordered_map::insert(const_iterator, value_type&&) called with an iterator not"
850
" referring to this unordered_map");
851
return insert(_VSTD::forward<_Pp>(__x)).first;
817
854
iterator insert(const_iterator, _Pp&& __x)
818
855
{return insert(_VSTD::forward<_Pp>(__x)).first;}
819
857
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
820
858
template <class _InputIterator>
821
859
void insert(_InputIterator __first, _InputIterator __last);
903
941
_LIBCPP_INLINE_VISIBILITY
904
942
void reserve(size_type __n) {__table_.reserve(__n);}
944
#if _LIBCPP_DEBUG_LEVEL >= 2
946
bool __dereferenceable(const const_iterator* __i) const
947
{return __table_.__dereferenceable(&__i->__i_);}
948
bool __decrementable(const const_iterator* __i) const
949
{return __table_.__decrementable(&__i->__i_);}
950
bool __addable(const const_iterator* __i, ptrdiff_t __n) const
951
{return __table_.__addable(&__i->__i_, __n);}
952
bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const
953
{return __table_.__addable(&__i->__i_, __n);}
955
#endif // _LIBCPP_DEBUG_LEVEL >= 2
907
958
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
908
959
__node_holder __construct_node();
909
960
template <class _A0>
912
is_constructible<value_type, _A0>::value,
915
__construct_node(_A0&& __a0);
919
is_constructible<key_type, _A0>::value,
922
__construct_node(_A0&& __a0);
962
__construct_node(_A0&& __a0);
963
__node_holder __construct_node_with_key(key_type&& __k);
923
964
#ifndef _LIBCPP_HAS_NO_VARIADICS
924
965
template <class _A0, class _A1, class ..._Args>
925
966
__node_holder __construct_node(_A0&& __a0, _A1&& __a1, _Args&& ...__args);
926
967
#endif // _LIBCPP_HAS_NO_VARIADICS
927
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
928
__node_holder __construct_node(const key_type& __k);
968
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
969
__node_holder __construct_node_with_key(const key_type& __k);
932
972
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
1011
1075
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
1012
1076
: __table_(_VSTD::move(__u.__table_))
1078
#if _LIBCPP_DEBUG_LEVEL >= 2
1079
__get_db()->__insert_c(this);
1080
__get_db()->swap(this, &__u);
1016
1084
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
1106
1190
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
1107
1191
template <class _A0>
1110
is_constructible<pair<const _Key, _Tp>, _A0>::value,
1111
typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
1192
typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
1113
1193
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0)
1115
1195
__node_allocator& __na = __table_.__node_alloc();
1124
1204
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
1125
template <class _A0>
1128
is_constructible<_Key, _A0>::value,
1129
typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
1131
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0)
1205
typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
1206
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node_with_key(key_type&& __k)
1133
1208
__node_allocator& __na = __table_.__node_alloc();
1134
1209
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
1135
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.first),
1136
_VSTD::forward<_A0>(__a0));
1210
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.first), _VSTD::move(__k));
1137
1211
__h.get_deleter().__first_constructed = true;
1138
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second));
1212
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.second));
1139
1213
__h.get_deleter().__second_constructed = true;
1214
return _VSTD::move(__h);
1143
1217
#ifndef _LIBCPP_HAS_NO_VARIADICS
1174
1248
#endif // _LIBCPP_HAS_NO_VARIADICS
1175
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1249
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1177
1251
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
1178
1252
typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
1179
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(const key_type& __k)
1253
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node_with_key(const key_type& __k)
1181
1255
__node_allocator& __na = __table_.__node_alloc();
1182
1256
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
1183
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), __k);
1257
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.first), __k);
1184
1258
__h.get_deleter().__first_constructed = true;
1185
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second));
1259
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.second));
1186
1260
__h.get_deleter().__second_constructed = true;
1187
1261
return _VSTD::move(__h);
1190
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1192
1264
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
1193
1265
template <class _InputIterator>
1194
1266
inline _LIBCPP_INLINE_VISIBILITY
1304
1376
typedef _Pred key_equal;
1305
1377
typedef _Alloc allocator_type;
1306
1378
typedef pair<const key_type, mapped_type> value_type;
1379
typedef pair<key_type, mapped_type> __nc_value_type;
1307
1380
typedef value_type& reference;
1308
1381
typedef const value_type& const_reference;
1382
static_assert((is_same<value_type, typename allocator_type::value_type>::value),
1383
"Invalid allocator::value_type");
1311
typedef pair<key_type, mapped_type> __value_type;
1312
typedef __unordered_map_hasher<key_type, mapped_type, hasher> __hasher;
1313
typedef __unordered_map_equal<key_type, mapped_type, key_equal> __key_equal;
1386
#if __cplusplus >= 201103L
1389
typedef typename unordered_multimap::value_type value_type;
1390
typedef typename unordered_multimap::__nc_value_type __nc_value_type;
1392
__nc_value_type __nc;
1394
template <class ..._Args>
1395
__value_type(_Args&& ...__args)
1396
: __cc(std::forward<_Args>(__args)...) {}
1398
__value_type(const __value_type& __v)
1399
: __cc(std::move(__v.__cc)) {}
1401
__value_type(__value_type&& __v)
1402
: __nc(std::move(__v.__nc)) {}
1404
__value_type& operator=(const __value_type& __v)
1405
{__nc = __v.__cc; return *this;}
1407
__value_type& operator=(__value_type&& __v)
1408
{__nc = std::move(__v.__nc); return *this;}
1410
~__value_type() {__cc.~value_type();}
1415
typedef typename unordered_multimap::value_type value_type;
1420
template <class _A0>
1421
__value_type(const _A0& __a0)
1424
template <class _A0, class _A1>
1425
__value_type(const _A0& __a0, const _A1& __a1)
1426
: __cc(__a0, __a1) {}
1429
typedef __unordered_map_hasher<key_type, __value_type, hasher> __hasher;
1430
typedef __unordered_map_equal<key_type, __value_type, key_equal> __key_equal;
1314
1431
typedef typename allocator_traits<allocator_type>::template
1315
1432
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
1316
1433
rebind_alloc<__value_type>
1344
1461
_LIBCPP_INLINE_VISIBILITY
1345
1462
unordered_multimap()
1346
1463
_NOEXCEPT_(is_nothrow_default_constructible<__table>::value)
1465
#if _LIBCPP_DEBUG_LEVEL >= 2
1466
__get_db()->__insert_c(this);
1348
1469
explicit unordered_multimap(size_type __n, const hasher& __hf = hasher(),
1349
1470
const key_equal& __eql = key_equal());
1350
1471
unordered_multimap(size_type __n, const hasher& __hf,
1382
1503
_LIBCPP_INLINE_VISIBILITY
1383
1504
unordered_multimap& operator=(const unordered_multimap& __u)
1506
#if __cplusplus >= 201103L
1385
1507
__table_ = __u.__table_;
1510
__table_.hash_function() = __u.__table_.hash_function();
1511
__table_.key_eq() = __u.__table_.key_eq();
1512
__table_.max_load_factor() = __u.__table_.max_load_factor();
1513
__table_.__copy_assign_alloc(__u.__table_);
1514
insert(__u.begin(), __u.end());
1388
1518
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1525
1655
_LIBCPP_INLINE_VISIBILITY
1526
1656
void reserve(size_type __n) {__table_.reserve(__n);}
1658
#if _LIBCPP_DEBUG_LEVEL >= 2
1660
bool __dereferenceable(const const_iterator* __i) const
1661
{return __table_.__dereferenceable(&__i->__i_);}
1662
bool __decrementable(const const_iterator* __i) const
1663
{return __table_.__decrementable(&__i->__i_);}
1664
bool __addable(const const_iterator* __i, ptrdiff_t __n) const
1665
{return __table_.__addable(&__i->__i_, __n);}
1666
bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const
1667
{return __table_.__addable(&__i->__i_, __n);}
1669
#endif // _LIBCPP_DEBUG_LEVEL >= 2
1529
1672
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1530
1673
__node_holder __construct_node();
1531
1674
template <class _A0>
1534
is_constructible<value_type, _A0>::value,
1537
__construct_node(_A0&& __a0);
1538
template <class _A0>
1541
is_constructible<key_type, _A0>::value,
1544
1676
__construct_node(_A0&& __a0);
1545
1677
#ifndef _LIBCPP_HAS_NO_VARIADICS
1546
1678
template <class _A0, class _A1, class ..._Args>
1631
1787
_NOEXCEPT_(is_nothrow_move_constructible<__table>::value)
1632
1788
: __table_(_VSTD::move(__u.__table_))
1790
#if _LIBCPP_DEBUG_LEVEL >= 2
1791
__get_db()->__insert_c(this);
1792
__get_db()->swap(this, &__u);
1636
1796
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
1638
1798
unordered_multimap&& __u, const allocator_type& __a)
1639
1799
: __table_(_VSTD::move(__u.__table_), __a)
1801
#if _LIBCPP_DEBUG_LEVEL >= 2
1802
__get_db()->__insert_c(this);
1641
1804
if (__a != __u.get_allocator())
1643
1806
iterator __i = __u.begin();
1644
1807
while (__u.size() != 0)
1646
1809
__table_.__insert_multi(
1647
1810
_VSTD::move(__u.__table_.remove((__i++).__i_)->__value_)
1814
#if _LIBCPP_DEBUG_LEVEL >= 2
1816
__get_db()->swap(this, &__u);
1653
1820
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
1728
1904
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
1729
1905
template <class _A0>
1732
is_constructible<pair<const _Key, _Tp>, _A0>::value,
1733
typename unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
1906
typename unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
1735
1907
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0)
1737
1909
__node_allocator& __na = __table_.__node_alloc();
1746
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
1747
template <class _A0>
1750
is_constructible<_Key, _A0>::value,
1751
typename unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
1753
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0)
1755
__node_allocator& __na = __table_.__node_alloc();
1756
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
1757
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.first),
1758
_VSTD::forward<_A0>(__a0));
1759
__h.get_deleter().__first_constructed = true;
1760
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second));
1761
__h.get_deleter().__second_constructed = true;
1765
1918
#ifndef _LIBCPP_HAS_NO_VARIADICS
1767
1920
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>