This is an automated email from the ASF dual-hosted git repository.

bneradt pushed a commit to branch cpp-20
in repository https://gitbox.apache.org/repos/asf/trafficserver-libswoc.git

commit 64a0bf7796c84db57cbbb5b16bce0f20346fd899
Author: Alan M. Carroll <[email protected]>
AuthorDate: Wed Apr 26 09:52:54 2023 -0500

    Clang 14 fixes.
---
 code/include/swoc/Lexicon.h | 28 +++++++++++++---------------
 1 file changed, 13 insertions(+), 15 deletions(-)

diff --git a/code/include/swoc/Lexicon.h b/code/include/swoc/Lexicon.h
index 8333b42..6692787 100644
--- a/code/include/swoc/Lexicon.h
+++ b/code/include/swoc/Lexicon.h
@@ -839,30 +839,28 @@ bwformat(BufferWriter &w, bwf::Spec const &spec, 
Lexicon<E> const &lex) {
   return w;
 }
 
-}} // namespace swoc
+template <size_t IDX, typename E>
+auto
+get(detail::lexicon_pair_type<E> const &p) -> typename std::tuple_element<IDX, 
detail::lexicon_pair_type<E>>::type {
+  if constexpr (IDX == 0) {
+    return p._value;
+  } else if constexpr (IDX == 1) {
+    return p._name;
+  }
+}
 
-namespace std {
+}} // namespace swoc
 
-template <size_t IDX, typename E> class tuple_element { 
static_assert("swoc::Lexicon::Pair tuple index out of range"); };
+template <size_t IDX, typename E> class std::tuple_element { 
static_assert("swoc::Lexicon::Pair tuple index out of range"); };
 
-template <typename E> class tuple_element<0, 
swoc::detail::lexicon_pair_type<E>> {
+template <typename E> class std::tuple_element<0, 
swoc::detail::lexicon_pair_type<E>> {
 public:
   using type = E;
 };
 
-template <typename E> class tuple_element<1, 
swoc::detail::lexicon_pair_type<E>> {
+template <typename E> class std::tuple_element<1, 
swoc::detail::lexicon_pair_type<E>> {
 public:
   using type = swoc::TextView;
 };
 
-template <size_t IDX, typename E>
-auto
-get(swoc::detail::lexicon_pair_type<E> const &p) -> typename 
std::tuple_element<IDX, swoc::detail::lexicon_pair_type<E>>::type {
-  if constexpr (IDX == 0) {
-    return p._value;
-  } else if constexpr (IDX == 1) {
-    return p._name;
-  }
-}
 
-}

Reply via email to