From 221ae46c2b9b48182542016505d6e03005c40512 Mon Sep 17 00:00:00 2001 From: cekc <31835620+cekc@users.noreply.github.com> Date: Mon, 25 Feb 2019 18:35:53 +0300 Subject: [PATCH] add std::tuple_element and std::tuple_size specializations for index_value To make index_value work with structured bindings https://wandbox.org/permlink/gsveiKdAamnEbOKM --- include/boost/range/adaptor/indexed.hpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/include/boost/range/adaptor/indexed.hpp b/include/boost/range/adaptor/indexed.hpp index a426bd6..8fd0289 100644 --- a/include/boost/range/adaptor/indexed.hpp +++ b/include/boost/range/adaptor/indexed.hpp @@ -367,4 +367,29 @@ index( } // namespace adaptors } // namespace boost +#if !defined(BOOST_NO_CXX11_HDR_TUPLE) + +namespace std { + +#if defined(BOOST_CLANG) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wmismatched-tags" +#endif + +template +struct tuple_element>: + boost::tuples::element> {}; + +template +struct tuple_size>: + std::integral_constant {}; + +#if defined(BOOST_CLANG) +#pragma clang diagnostic pop +#endif + +} // namespace std + +#endif // !defined(BOOST_NO_CXX11_HDR_TUPLE) + #endif // include guard