diff --git a/doc/poly_collection.qbk b/doc/poly_collection.qbk index 1a7e6f4..f841c7b 100644 --- a/doc/poly_collection.qbk +++ b/doc/poly_collection.qbk @@ -1210,6 +1210,7 @@ to allow for the definition of container-level `operator<` and related operators only when the corresponding relational operator is available for all `Ts...`, in accordance with WG21 paper [@https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2944r3.html P2944R3]. +* Fixed incompatibility problem with libc++ v21 or higher ([github_pr poly_collection 34]). [endsect] diff --git a/include/boost/poly_collection/detail/is_final.hpp b/include/boost/poly_collection/detail/is_final.hpp index b9d91fc..71516c1 100644 --- a/include/boost/poly_collection/detail/is_final.hpp +++ b/include/boost/poly_collection/detail/is_final.hpp @@ -1,4 +1,4 @@ -/* Copyright 2016-2017 Joaquin M Lopez Munoz. +/* Copyright 2016-2026 Joaquin M Lopez Munoz. * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) @@ -13,56 +13,38 @@ #pragma once #endif -#include #include -/* technique explained at - * http://bannalia.blogspot.com/2016/09/compile-time-checking-existence-of.html - */ - -namespace boost{ -namespace poly_collection{ -namespace detail{ -namespace is_final_fallback{ - -template using is_final=boost::is_final; - -struct hook{}; - -}}}} - -namespace std{ - -template<> -struct is_void< ::boost::poly_collection::detail::is_final_fallback::hook>: - std::false_type -{ - template - static constexpr bool is_final_f() - { - using namespace ::boost::poly_collection::detail::is_final_fallback; - return is_final::value; - } -}; - -} /* namespace std */ - +#if __cpp_lib_is_final>=201402L namespace boost{ namespace poly_collection{ namespace detail{ -template -struct is_final:std::integral_constant< - bool, - std::is_void::template is_final_f() ->{}; +template using is_final=std::is_final; } /* namespace poly_collection::detail */ } /* namespace poly_collection */ } /* namespace boost */ +#else +#include + +namespace boost{ + +namespace poly_collection{ + +namespace detail{ + +template using is_final=boost::is_final; + +} /* namespace poly_collection::detail */ + +} /* namespace poly_collection */ + +} /* namespace boost */ +#endif #endif diff --git a/include/boost/poly_collection/detail/is_invocable.hpp b/include/boost/poly_collection/detail/is_invocable.hpp index c93ba47..1fa4666 100644 --- a/include/boost/poly_collection/detail/is_invocable.hpp +++ b/include/boost/poly_collection/detail/is_invocable.hpp @@ -1,4 +1,4 @@ -/* Copyright 2016-2017 Joaquin M Lopez Munoz. +/* Copyright 2016-2026 Joaquin M Lopez Munoz. * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) @@ -13,17 +13,34 @@ #pragma once #endif -#include #include -/* technique explained at - * http://bannalia.blogspot.com/2016/09/compile-time-checking-existence-of.html - */ +#if __cpp_lib_is_invocable>=201703L +namespace boost{ + +namespace poly_collection{ + +namespace detail{ + +template +using is_invocable=std::is_invocable; + +template +using is_invocable_r=std::is_invocable_r; + +} /* namespace poly_collection::detail */ + +} /* namespace poly_collection */ + +} /* namespace boost */ +#else +#include namespace boost{ + namespace poly_collection{ + namespace detail{ -namespace is_invocable_fallback{ template struct is_invocable: @@ -41,57 +58,11 @@ struct is_invocable_r: > {}; -struct hook{}; - -}}}} - -namespace std{ - -template<> -struct is_void< ::boost::poly_collection::detail::is_invocable_fallback::hook>: - std::false_type -{ - template - static constexpr bool is_invocable_f() - { - using namespace ::boost::poly_collection::detail::is_invocable_fallback; - return is_invocable::value; - } - - template - static constexpr bool is_invocable_r_f() - { - using namespace ::boost::poly_collection::detail::is_invocable_fallback; - return is_invocable_r::value; - } -}; - -} /* namespace std */ - -namespace boost{ - -namespace poly_collection{ - -namespace detail{ - -template -struct is_invocable:std::integral_constant< - bool, - std::is_void::template - is_invocable_f() ->{}; - -template -struct is_invocable_r:std::integral_constant< - bool, - std::is_void::template - is_invocable_r_f() ->{}; - } /* namespace poly_collection::detail */ } /* namespace poly_collection */ } /* namespace boost */ +#endif #endif