63 {
return *
static_cast<_Container*
>(
this); }
71 _M_invalidate_locals()
73 auto __local_end = _M_cont()._M_base().cend(0);
75 [__local_end](__decltype(__local_end) __it)
76 {
return __it != __local_end; });
79#if __cplusplus > 201402L
80 template<
typename _ExtractKey,
typename _Source>
81 struct _UContInvalidatePred
83 template<
typename _Iterator>
85 operator()(_Iterator __it)
const
86 {
return _M_source.count(_ExtractKey{}(*__it)) == 0; }
88 const _Source& _M_source;
91 template<
typename _ExtractKey,
typename _Source>
92 struct _UMContInvalidatePred
94 template<
typename _Iterator>
96 operator()(_Iterator __it)
const
99 _M_source._M_base().equal_range(_ExtractKey{}(*__it));
100 for (
auto __rit = __rng.first;
101 __rit != __rng.second; ++__rit)
110 const _Source& _M_source;
113 template<
typename _Source,
typename _Inval
idatePred>
114 struct _UContMergeGuard
116 _UContMergeGuard(_Source& __src) noexcept
117 : _M_source(__src), _M_size(__src.size()), _M_pred { __src }
120 _UContMergeGuard(
const _UContMergeGuard&) =
delete;
124 const std::size_t __size = _M_source.size();
125 if (__size == _M_size)
131 _M_source._M_invalidate_all();
134 _M_source._M_invalidate_if(_M_pred);
135 _M_source._M_invalidate_local_if(_M_pred);
140 _M_source._M_invalidate_all();
145 const std::size_t _M_size;
146 _InvalidatePred _M_pred;
149 template<
typename _ExtractKey,
typename _Source>
150 static _UContMergeGuard<_Source,
151 _UContInvalidatePred<_ExtractKey, _Source>>
152 _S_uc_guard(_ExtractKey, _Source& __src)
154 typedef _UContInvalidatePred<_ExtractKey, _Source> _InvalidatePred;
155 return _UContMergeGuard<_Source, _InvalidatePred>(__src);
158 template<
typename _ExtractKey,
typename _Source>
159 static _UContMergeGuard<_Source,
160 _UMContInvalidatePred<_ExtractKey, _Source>>
161 _S_umc_guard(_ExtractKey, _Source& __src)
163 typedef _UMContInvalidatePred<_ExtractKey, _Source> _InvalidatePred;
164 return _UContMergeGuard<_Source, _InvalidatePred>(__src);
172 auto __end = _M_cont()._M_base().cend();
174 {
return __it != __end; });
175 _M_invalidate_locals();
182 template<
typename _Predicate>
190 template<
typename _Predicate>