From 48375e95648bed776a2f6d34148185daf2cdce96 Mon Sep 17 00:00:00 2001 From: Zach Laine Date: Fri, 31 Oct 2025 17:15:34 -0500 Subject: [PATCH] Create separate macro guards for the use of GCC's _RangeAdaptorClosure, since they keep messing with it. --- include/boost/stl_interfaces/view_adaptor.hpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/include/boost/stl_interfaces/view_adaptor.hpp b/include/boost/stl_interfaces/view_adaptor.hpp index 8887480..dd2b1b3 100644 --- a/include/boost/stl_interfaces/view_adaptor.hpp +++ b/include/boost/stl_interfaces/view_adaptor.hpp @@ -24,10 +24,14 @@ #endif #if !BOOST_STL_INTERFACES_USE_CPP23_STD_RANGE_ADAPTOR_CLOSURE && \ + BOOST_STL_INTERFACES_USE_CONCEPTS && defined(BOOST_GCC) && 14 <= __GNUC__ +#define BOOST_STL_INTERFACES_USE_LIBSTDCPP_GCC14_RANGE_ADAPTOR_CLOSURE 1 +#elif !BOOST_STL_INTERFACES_USE_CPP23_STD_RANGE_ADAPTOR_CLOSURE && \ BOOST_STL_INTERFACES_USE_CONCEPTS && defined(BOOST_GCC) && 12 <= __GNUC__ #define BOOST_STL_INTERFACES_USE_LIBSTDCPP_GCC12_RANGE_ADAPTOR_CLOSURE 1 #else #define BOOST_STL_INTERFACES_USE_LIBSTDCPP_GCC12_RANGE_ADAPTOR_CLOSURE 0 +#define BOOST_STL_INTERFACES_USE_LIBSTDCPP_GCC14_RANGE_ADAPTOR_CLOSURE 0 #endif #if !BOOST_STL_INTERFACES_USE_CPP23_STD_RANGE_ADAPTOR_CLOSURE && \ @@ -38,6 +42,7 @@ #endif #if !BOOST_STL_INTERFACES_USE_CPP23_STD_RANGE_ADAPTOR_CLOSURE && \ + !BOOST_STL_INTERFACES_USE_LIBSTDCPP_GCC14_RANGE_ADAPTOR_CLOSURE && \ !BOOST_STL_INTERFACES_USE_LIBSTDCPP_GCC12_RANGE_ADAPTOR_CLOSURE && \ !BOOST_STL_INTERFACES_NEED_VS_COMPATIBLE_RANGE_ADAPTOR_CLOSURE #define BOOST_STL_INTERFACES_DEFINE_CUSTOM_RANGE_ADAPTOR_CLOSURE 1 @@ -170,11 +175,16 @@ namespace boost { namespace stl_interfaces { template using range_adaptor_closure = std::ranges::range_adaptor_closure; -#elif BOOST_STL_INTERFACES_USE_LIBSTDCPP_GCC12_RANGE_ADAPTOR_CLOSURE +#elif BOOST_STL_INTERFACES_USE_LIBSTDCPP_GCC14_RANGE_ADAPTOR_CLOSURE template using range_adaptor_closure = std::views::__adaptor::_RangeAdaptorClosure; +#elif BOOST_STL_INTERFACES_USE_LIBSTDCPP_GCC12_RANGE_ADAPTOR_CLOSURE + + template + using range_adaptor_closure = std::views::__adaptor::_RangeAdaptorClosure; + #elif BOOST_STL_INTERFACES_NEED_VS_COMPATIBLE_RANGE_ADAPTOR_CLOSURE template