@@ -490,28 +490,28 @@ class btree_map_container : public btree_set_container<Tree> {
490490
491491 // TODO(b/402804213): Remove these macros whenever we have a better mechanism
492492 // available to handle lifetime analysis.
493- #define ABSL_INTERNAL_X (Func, Callee, KQual, MQual, KValue, MValue, ...) \
494- template < \
495- typename K = key_type, class M , \
496- ABSL_INTERNAL_IF_NOR ( \
497- KValue, MValue, \
498- int = (EnableIf<LifetimeBoundKV<K, KValue, M, MValue, \
499- IfRRef<int KQual >::AddPtr<K>, \
500- IfRRef< int MQual>::AddPtr<M>>>()), \
501- ABSL_INTERNAL_SINGLE_ARG( \
502- int &..., \
503- decltype (EnableIf<LifetimeBoundKV<K, KValue, M, MValue>>()) = \
504- 0))> \
505- decltype( auto ) Func( __VA_ARGS__ key_arg<K> KQual k ABSL_INTERNAL_IF ( \
506- KValue, ABSL_INTERNAL_ATTRIBUTE_CAPTURED_BY( this )), \
507- M MQual obj ABSL_INTERNAL_IF( \
508- MValue, ABSL_INTERNAL_ATTRIBUTE_CAPTURED_BY( this ))) \
509- ABSL_ATTRIBUTE_LIFETIME_BOUND { \
510- return ABSL_INTERNAL_IF_OR ( KValue, MValue, ( this -> template Func <K, M, 0 >), \
511- Callee)( \
512- __VA_ARGS__ std::forward<decltype (k)>(k), \
513- std::forward<decltype (obj)>(obj)); \
514- } \
493+ #define ABSL_INTERNAL_X (Func, Callee, KQual, MQual, KValue, MValue, ...) \
494+ template < \
495+ typename K = key_type, class M , \
496+ ABSL_INTERNAL_IF_##KValue##_NOR_##MValue( \
497+ int = (EnableIf<LifetimeBoundKV<K, KValue, M, MValue, \
498+ IfRRef< int KQual>::AddPtr<K>, \
499+ IfRRef<int MQual >::AddPtr<M>>>()), \
500+ ABSL_INTERNAL_SINGLE_ARG ( \
501+ int &..., \
502+ decltype (EnableIf<LifetimeBoundKV<K, KValue, M, MValue>>()) = \
503+ 0))> \
504+ decltype( auto ) Func( \
505+ __VA_ARGS__ key_arg<K> KQual k ABSL_INTERNAL_IF_##KValue( \
506+ ABSL_INTERNAL_ATTRIBUTE_CAPTURED_BY ( this )), \
507+ M MQual obj ABSL_INTERNAL_IF_##MValue( \
508+ ABSL_INTERNAL_ATTRIBUTE_CAPTURED_BY ( this ))) \
509+ ABSL_ATTRIBUTE_LIFETIME_BOUND { \
510+ return ABSL_INTERNAL_IF_## KValue##_OR_## MValue ( \
511+ ( this -> template Func <K, M, 0 >), Callee)( \
512+ __VA_ARGS__ std::forward<decltype (k)>(k), \
513+ std::forward<decltype (obj)>(obj)); \
514+ } \
515515 friend struct std ::enable_if<false > /* just to force a semicolon */
516516 // Insertion routines.
517517 // Note: the nullptr template arguments and extra `const M&` overloads allow
@@ -591,21 +591,23 @@ class btree_map_container : public btree_set_container<Tree> {
591591#undef ABSL_INTERNAL_X
592592
593593#define ABSL_INTERNAL_X (Func, Callee, KQual, KValue, ...) \
594- template <class K = key_type, \
595- ABSL_INTERNAL_IF (KValue, class ... Args, \
596- int = EnableIf<LifetimeBoundK< \
597- K, KValue, IfRRef<int KQual>::AddPtr<K>>>()), \
598- ABSL_INTERNAL_IF( \
599- KValue, \
600- decltype (EnableIf<LifetimeBoundK< \
601- K, KValue, IfRRef<int KQual>::AddPtr<K>>>()) = 0, \
602- class... Args), \
603- std::enable_if_t<!std::is_convertible<K, const_iterator>::value, \
604- int> = 0> \
605- decltype(auto ) Func(__VA_ARGS__ key_arg<K> KQual k ABSL_INTERNAL_IF ( \
606- KValue, ABSL_INTERNAL_ATTRIBUTE_CAPTURED_BY(this )), \
607- Args &&...args) ABSL_ATTRIBUTE_LIFETIME_BOUND { \
608- return ABSL_INTERNAL_IF (KValue, (this ->template Func <K, 0 >), Callee)( \
594+ template < \
595+ class K = key_type, \
596+ ABSL_INTERNAL_IF_##KValue( \
597+ class ... Args, \
598+ int = (EnableIf< \
599+ LifetimeBoundK<K, KValue, IfRRef<int KQual>::AddPtr<K>>>())), \
600+ ABSL_INTERNAL_IF_##KValue( \
601+ decltype (EnableIf<LifetimeBoundK< \
602+ K, KValue, IfRRef<int KQual>::AddPtr<K>>>()) = 0, \
603+ class... Args), \
604+ std::enable_if_t<!std::is_convertible<K, const_iterator>::value, int> = \
605+ 0> \
606+ decltype(auto ) Func( \
607+ __VA_ARGS__ key_arg<K> KQual k ABSL_INTERNAL_IF_##KValue( \
608+ ABSL_INTERNAL_ATTRIBUTE_CAPTURED_BY (this )), \
609+ Args &&...args) ABSL_ATTRIBUTE_LIFETIME_BOUND { \
610+ return ABSL_INTERNAL_IF_##KValue ((this ->template Func <K, 0 >), Callee)( \
609611 __VA_ARGS__ std::forward<decltype (k)>(k), \
610612 std::forward<decltype (args)>(args)...); \
611613 } \
0 commit comments