@@ -301,21 +301,21 @@ class ABSL_ATTRIBUTE_WARN_UNUSED PROTOBUF_DECLSPEC_EMPTY_BASES
301301 static_assert (
302302 alignof (Arena) >= alignof(Element),
303303 "We only support types that have an alignment smaller than Arena");
304- static_assert (!std::is_const <Element>::value ,
304+ static_assert (!std::is_const_v <Element>,
305305 " We do not support const value types." );
306- static_assert (!std::is_volatile <Element>::value ,
306+ static_assert (!std::is_volatile_v <Element>,
307307 " We do not support volatile value types." );
308- static_assert (!std::is_pointer <Element>::value ,
308+ static_assert (!std::is_pointer_v <Element>,
309309 " We do not support pointer value types." );
310- static_assert (!std::is_reference <Element>::value ,
310+ static_assert (!std::is_reference_v <Element>,
311311 " We do not support reference value types." );
312312 static constexpr PROTOBUF_ALWAYS_INLINE void StaticValidityCheck () {
313313 static_assert (
314- std::disjunction <internal::is_supported_integral_type<Element>,
315- internal::is_supported_floating_point_type<Element>,
316- std::is_same<absl::Cord, Element>,
317- std::is_same<UnknownField, Element>,
318- is_proto_enum<Element>>::value ,
314+ std::disjunction_v <internal::is_supported_integral_type<Element>,
315+ internal::is_supported_floating_point_type<Element>,
316+ std::is_same<absl::Cord, Element>,
317+ std::is_same<UnknownField, Element>,
318+ is_proto_enum<Element>>,
319319 " We only support non-string scalars in RepeatedField." );
320320 }
321321
@@ -337,9 +337,8 @@ class ABSL_ATTRIBUTE_WARN_UNUSED PROTOBUF_DECLSPEC_EMPTY_BASES
337337 : RepeatedField(internal::InternalMetadataOffset(), /* arena=*/ nullptr,
338338 rhs) {}
339339
340- template <typename Iter,
341- typename = typename std::enable_if<std::is_constructible<
342- Element, decltype (*std::declval<Iter>())>::value>::type>
340+ template <typename Iter, typename = std::enable_if_t <std::is_constructible_v<
341+ Element, decltype (*std::declval<Iter>())>>>
343342 RepeatedField (Iter begin, Iter end);
344343
345344 // Arena enabled constructors: for internal use only.
@@ -649,7 +648,7 @@ class ABSL_ATTRIBUTE_WARN_UNUSED PROTOBUF_DECLSPEC_EMPTY_BASES
649648 // This function does nothing if `Element` is trivial.
650649 static void Destroy ([[maybe_unused]] const Element* begin,
651650 [[maybe_unused]] const Element* end) {
652- if constexpr (!std::is_trivially_destructible <Element>::value ) {
651+ if constexpr (!std::is_trivially_destructible_v <Element>) {
653652 std::for_each (begin, end, [&](const Element& e) { e.~Element (); });
654653 }
655654 }
@@ -1192,9 +1191,9 @@ template <typename Element>
11921191template <typename ArenaProvider, typename Iter>
11931192inline void RepeatedField<Element>::AddWithArena(ArenaProvider arena_provider,
11941193 Iter begin, Iter end) {
1195- if (std::is_base_of <
1194+ if (std::is_base_of_v <
11961195 std::forward_iterator_tag,
1197- typename std::iterator_traits<Iter>::iterator_category>::value ) {
1196+ typename std::iterator_traits<Iter>::iterator_category>) {
11981197 AddForwardIterator (arena_provider, begin, end);
11991198 } else {
12001199 AddInputIterator (arena_provider, begin, end);
@@ -1589,7 +1588,7 @@ PROTOBUF_NOINLINE void RepeatedField<Element>::GrowNoAnnotate(
15891588 if (old_size > 0 ) {
15901589 Element* pnew = new_rep->elements <Element>();
15911590 Element* pold = elements (was_soo);
1592- if constexpr (std::is_trivially_copyable <Element>::value ||
1591+ if constexpr (std::is_trivially_copyable_v <Element> ||
15931592 absl::is_trivially_relocatable<Element>::value) {
15941593 memcpy (static_cast <void *>(pnew), pold, old_size * sizeof (Element));
15951594 } else {
@@ -1657,8 +1656,7 @@ namespace internal {
16571656template <typename Element>
16581657class RepeatedIterator {
16591658 private:
1660- using traits =
1661- std::iterator_traits<typename std::remove_const<Element>::type*>;
1659+ using traits = std::iterator_traits<std::remove_const_t <Element>*>;
16621660
16631661 public:
16641662 // Note: value_type is never cv-qualified.
0 commit comments