From 01f01c3ecf142b088a2181f6edc1bc631340d8cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=BA=E5=8F=B2=E8=89=B2=E7=AC=9B?= <48883004+cishisedis@users.noreply.github.com> Date: Tue, 26 Mar 2019 12:19:35 +0100 Subject: [PATCH] simpler type signature for as_if::operator () --- include/yaml-cpp/node/impl.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/yaml-cpp/node/impl.h b/include/yaml-cpp/node/impl.h index e3e086d..1170def 100644 --- a/include/yaml-cpp/node/impl.h +++ b/include/yaml-cpp/node/impl.h @@ -13,7 +13,6 @@ #include "yaml-cpp/node/iterator.h" #include "yaml-cpp/node/node.h" #include -#include #ifdef __cpp_lib_optional #include @@ -121,7 +120,7 @@ struct as_if { const Node& node; template - auto operator()() const -> typename std::tuple_element<1, std::tuple::decode), T>>::type { + auto operator()() const -> typename std::pair::decode), T>::second_type { if (!node.m_pNode) throw TypedBadConversion(node.Mark()); @@ -133,7 +132,7 @@ struct as_if { #ifdef __cpp_lib_optional template - auto operator()() const -> typename std::tuple_element<1, std::tuple::decode_optional), T>>::type { + auto operator()() const -> typename std::pair::decode_optional), T>::second_type { if (!node.m_pNode) throw TypedBadConversion(node.Mark());