From 27d700ec010840205256bf64336cf3535ed1ec3d Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 10 Jun 2021 09:54:51 +0300 Subject: [PATCH] Use non-const references in ignore_unused to avoid g++-11 warning --- include/boost/core/ignore_unused.hpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/include/boost/core/ignore_unused.hpp b/include/boost/core/ignore_unused.hpp index 994e5f6..03614c5 100644 --- a/include/boost/core/ignore_unused.hpp +++ b/include/boost/core/ignore_unused.hpp @@ -11,12 +11,22 @@ namespace boost { -#ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES +#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) + +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) + +template +BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused(Ts&& ...) +{} + +#else template BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused(Ts const& ...) {} +#endif + template BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore_unused() {}