File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -199,17 +199,18 @@ class SmallVectorTemplateCommon
199199 }
200200
201201 // / Check whether any part of the range will be invalidated by clearing.
202- void assertSafeToReferenceAfterClear (const T *From, const T *To) {
203- if (From == To)
204- return ;
205- this ->assertSafeToReferenceAfterResize (From, 0 );
206- this ->assertSafeToReferenceAfterResize (To - 1 , 0 );
207- }
208- template <
209- class ItTy ,
210- std::enable_if_t <!std::is_same<std::remove_const_t <ItTy>, T *>::value,
211- bool > = false >
212- void assertSafeToReferenceAfterClear (ItTy, ItTy) {}
202+ template <class ItTy >
203+ void assertSafeToReferenceAfterClear (ItTy From, ItTy To) {
204+ if constexpr (std::is_pointer_v<ItTy> &&
205+ std::is_same_v<
206+ std::remove_const_t <std::remove_pointer_t <ItTy>>,
207+ std::remove_const_t <T>>) {
208+ if (From == To)
209+ return ;
210+ this ->assertSafeToReferenceAfterResize (From, 0 );
211+ this ->assertSafeToReferenceAfterResize (To - 1 , 0 );
212+ }
213+ }
213214
214215 // / Check whether any part of the range will be invalidated by growing.
215216 template <class ItTy > void assertSafeToAddRange (ItTy From, ItTy To) {
You can’t perform that action at this time.
0 commit comments