From 819b3dd67ba9dcb949fb1fc9ed8619374617b154 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Mon, 11 Oct 2021 13:18:23 +0200 Subject: [PATCH 1/2] Small fix for those using -Wsign-conversion --- include/boost/tuple/detail/tuple_basic.hpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/boost/tuple/detail/tuple_basic.hpp b/include/boost/tuple/detail/tuple_basic.hpp index bed3042..5a7de65 100644 --- a/include/boost/tuple/detail/tuple_basic.hpp +++ b/include/boost/tuple/detail/tuple_basic.hpp @@ -34,6 +34,7 @@ #include // needed for the assignment from pair to tuple +#include // for std::size_t #include #include @@ -676,20 +677,20 @@ struct make_tuple_traits { // All arrays are converted to const. This is because make_tuple takes its // parameters as const T& and thus the knowledge of the potential // non-constness of actual argument is lost. -template struct make_tuple_traits { +template struct make_tuple_traits { typedef const T (&type)[n]; }; -template +template struct make_tuple_traits { typedef const T (&type)[n]; }; -template struct make_tuple_traits { +template struct make_tuple_traits { typedef const volatile T (&type)[n]; }; -template +template struct make_tuple_traits { typedef const volatile T (&type)[n]; }; From 7c01e916a32f5531335938efe786ffb9a4dd671b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Mon, 11 Oct 2021 13:26:45 +0200 Subject: [PATCH 2/2] More fixes for -Wsign-conversion --- include/boost/tuple/detail/tuple_basic.hpp | 34 +++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/include/boost/tuple/detail/tuple_basic.hpp b/include/boost/tuple/detail/tuple_basic.hpp index 5a7de65..96fb5bd 100644 --- a/include/boost/tuple/detail/tuple_basic.hpp +++ b/include/boost/tuple/detail/tuple_basic.hpp @@ -94,7 +94,7 @@ namespace detail { template class generate_error; -template +template struct drop_front { template struct apply { @@ -128,14 +128,14 @@ struct drop_front<0> { #ifndef BOOST_NO_CV_SPECIALIZATIONS -template +template struct element { typedef BOOST_DEDUCED_TYPENAME detail::drop_front::BOOST_NESTED_TEMPLATE apply::type::head_type type; }; -template +template struct element { private: @@ -152,14 +152,14 @@ public: namespace detail { -template +template struct element_impl { typedef BOOST_DEDUCED_TYPENAME detail::drop_front::BOOST_NESTED_TEMPLATE apply::type::head_type type; }; -template +template struct element_impl { typedef BOOST_DEDUCED_TYPENAME detail::drop_front::BOOST_NESTED_TEMPLATE @@ -170,7 +170,7 @@ struct element_impl } // end of namespace detail -template +template struct element: public detail::element_impl::value> { @@ -211,7 +211,7 @@ template struct access_traits { // get function for non-const cons-lists, returns a reference to the element -template +template inline typename access_traits< typename element >::type >::non_const_type @@ -225,7 +225,7 @@ get(cons& c) { // get function for const cons-lists, returns a const reference to // the element. If the element is a reference, returns the reference // as such (that is, can return a non-const reference) -template +template inline typename access_traits< typename element >::type >::const_type @@ -334,7 +334,7 @@ struct cons { } // get member functions (non-const and const) - template + template typename access_traits< typename element >::type >::non_const_type @@ -342,7 +342,7 @@ struct cons { return boost::tuples::get(*this); // delegate to non-member get } - template + template typename access_traits< typename element >::type >::const_type @@ -404,7 +404,7 @@ struct cons { // is illformed if HT is a reference cons& operator=(const cons& u) { head = u.head; return *this; } - template + template typename access_traits< typename element::type >::non_const_type @@ -412,7 +412,7 @@ struct cons { return boost::tuples::get(*this); } - template + template typename access_traits< typename element::type >::const_type @@ -425,27 +425,27 @@ struct cons { // templates for finding out the length of the tuple ------------------- template -struct length: boost::integral_constant::value> +struct length: boost::integral_constant::value> { }; template<> -struct length >: boost::integral_constant +struct length >: boost::integral_constant { }; template<> -struct length const>: boost::integral_constant +struct length const>: boost::integral_constant { }; template<> -struct length: boost::integral_constant +struct length: boost::integral_constant { }; template<> -struct length: boost::integral_constant +struct length: boost::integral_constant { };