diff --git a/include/boost/function.hpp b/include/boost/function.hpp index d71264c..6fd7388 100644 --- a/include/boost/function.hpp +++ b/include/boost/function.hpp @@ -1,3 +1,6 @@ +#ifndef BOOST_FUNCTION_HPP_INCLUDED +#define BOOST_FUNCTION_HPP_INCLUDED + // Boost.Function library // Copyright Douglas Gregor 2001-2003. Use, modification and @@ -10,18 +13,6 @@ // William Kempf, Jesse Jones and Karl Nelson were all very helpful in the // design of this library. -#ifndef BOOST_FUNCTION_MAX_ARGS -# define BOOST_FUNCTION_MAX_ARGS 10 -#endif // BOOST_FUNCTION_MAX_ARGS +#include -#if !defined(BOOST_FUNCTION_MAX_ARGS_DEFINED) || (BOOST_FUNCTION_MAX_ARGS_DEFINED != BOOST_FUNCTION_MAX_ARGS) - -#if !defined(BOOST_FUNCTION_MAX_ARGS_DEFINED) -#define BOOST_FUNCTION_MAX_ARGS_DEFINED 0 -#endif - -#include -#include -#include - -#endif // !defined(BOOST_FUNCTION_MAX_ARGS_DEFINED) || (BOOST_FUNCTION_MAX_ARGS_DEFINED != BOOST_FUNCTION_MAX_ARGS) +#endif // #ifndef BOOST_FUNCTION_HPP_INCLUDED diff --git a/include/boost/function/detail/epilogue.hpp b/include/boost/function/detail/epilogue.hpp deleted file mode 100644 index 03cc3ae..0000000 --- a/include/boost/function/detail/epilogue.hpp +++ /dev/null @@ -1,35 +0,0 @@ -// Boost.Function library - -#ifndef BOOST_FUNCTION_EPILOGUE_HPP -#define BOOST_FUNCTION_EPILOGUE_HPP - -// Copyright 2023 Peter Dimov -// Distributed under the Boost Software License, Version 1.0. -// https://www.boost.org/LICENSE_1_0.txt - -// Resolve C++20 issue with fn == bind(...) -// https://github.com/boostorg/function/issues/45 - -namespace boost -{ - -namespace _bi -{ - -template class bind_t; - -} // namespace _bi - -template bool operator==( function const& f, _bi::bind_t const& b ) -{ - return f.contains( b ); -} - -template bool operator!=( function const& f, _bi::bind_t const& b ) -{ - return !f.contains( b ); -} - -} // namespace boost - -#endif // #ifndef BOOST_FUNCTION_EPILOGUE_HPP diff --git a/include/boost/function/detail/maybe_include.hpp b/include/boost/function/detail/maybe_include.hpp deleted file mode 100644 index e34e825..0000000 --- a/include/boost/function/detail/maybe_include.hpp +++ /dev/null @@ -1,17 +0,0 @@ -// Boost.Function library - -// Copyright Douglas Gregor 2003. Use, modification and -// distribution is subject to 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) - -// For more information, see http://www.boost.org - -# undef BOOST_FUNCTION_NUM_ARGS -# define BOOST_FUNCTION_NUM_ARGS 30 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 30 -# ifndef BOOST_FUNCTION_VARIADIC_INCLUDED -# define BOOST_FUNCTION_VARIADIC_INCLUDED -# include -# endif diff --git a/include/boost/function/detail/prologue.hpp b/include/boost/function/detail/prologue.hpp deleted file mode 100644 index b0303fd..0000000 --- a/include/boost/function/detail/prologue.hpp +++ /dev/null @@ -1,20 +0,0 @@ -// Boost.Function library - -// Copyright Douglas Gregor 2002-2003. Use, modification and -// distribution is subject to 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) - -// For more information, see http://www.boost.org - -#ifndef BOOST_FUNCTION_PROLOGUE_HPP -#define BOOST_FUNCTION_PROLOGUE_HPP -# include -# include -# include -# include -# include -# include -# include -# include -#endif // BOOST_FUNCTION_PROLOGUE_HPP diff --git a/include/boost/function/function0.hpp b/include/boost/function/function0.hpp index 65a02e5..b0275b2 100644 --- a/include/boost/function/function0.hpp +++ b/include/boost/function/function0.hpp @@ -7,6 +7,4 @@ // For more information, see http://www.boost.org -#define BOOST_FUNCTION_NUM_ARGS 0 -#include -#undef BOOST_FUNCTION_NUM_ARGS +#include diff --git a/include/boost/function/function1.hpp b/include/boost/function/function1.hpp index 9089715..b0275b2 100644 --- a/include/boost/function/function1.hpp +++ b/include/boost/function/function1.hpp @@ -7,6 +7,4 @@ // For more information, see http://www.boost.org -#define BOOST_FUNCTION_NUM_ARGS 1 -#include -#undef BOOST_FUNCTION_NUM_ARGS +#include diff --git a/include/boost/function/function10.hpp b/include/boost/function/function10.hpp index 6562724..b0275b2 100644 --- a/include/boost/function/function10.hpp +++ b/include/boost/function/function10.hpp @@ -7,6 +7,4 @@ // For more information, see http://www.boost.org -#define BOOST_FUNCTION_NUM_ARGS 10 -#include -#undef BOOST_FUNCTION_NUM_ARGS +#include diff --git a/include/boost/function/function2.hpp b/include/boost/function/function2.hpp index dc8bf97..b0275b2 100644 --- a/include/boost/function/function2.hpp +++ b/include/boost/function/function2.hpp @@ -7,6 +7,4 @@ // For more information, see http://www.boost.org -#define BOOST_FUNCTION_NUM_ARGS 2 -#include -#undef BOOST_FUNCTION_NUM_ARGS +#include diff --git a/include/boost/function/function3.hpp b/include/boost/function/function3.hpp index 19d1a49..b0275b2 100644 --- a/include/boost/function/function3.hpp +++ b/include/boost/function/function3.hpp @@ -7,6 +7,4 @@ // For more information, see http://www.boost.org -#define BOOST_FUNCTION_NUM_ARGS 3 -#include -#undef BOOST_FUNCTION_NUM_ARGS +#include diff --git a/include/boost/function/function4.hpp b/include/boost/function/function4.hpp index f3349e2..b0275b2 100644 --- a/include/boost/function/function4.hpp +++ b/include/boost/function/function4.hpp @@ -7,6 +7,4 @@ // For more information, see http://www.boost.org -#define BOOST_FUNCTION_NUM_ARGS 4 -#include -#undef BOOST_FUNCTION_NUM_ARGS +#include diff --git a/include/boost/function/function5.hpp b/include/boost/function/function5.hpp index a1305eb..b0275b2 100644 --- a/include/boost/function/function5.hpp +++ b/include/boost/function/function5.hpp @@ -7,6 +7,4 @@ // For more information, see http://www.boost.org -#define BOOST_FUNCTION_NUM_ARGS 5 -#include -#undef BOOST_FUNCTION_NUM_ARGS +#include diff --git a/include/boost/function/function6.hpp b/include/boost/function/function6.hpp index 1f60914..b0275b2 100644 --- a/include/boost/function/function6.hpp +++ b/include/boost/function/function6.hpp @@ -7,6 +7,4 @@ // For more information, see http://www.boost.org -#define BOOST_FUNCTION_NUM_ARGS 6 -#include -#undef BOOST_FUNCTION_NUM_ARGS +#include diff --git a/include/boost/function/function7.hpp b/include/boost/function/function7.hpp index 68542ed..b0275b2 100644 --- a/include/boost/function/function7.hpp +++ b/include/boost/function/function7.hpp @@ -7,6 +7,4 @@ // For more information, see http://www.boost.org -#define BOOST_FUNCTION_NUM_ARGS 7 -#include -#undef BOOST_FUNCTION_NUM_ARGS +#include diff --git a/include/boost/function/function8.hpp b/include/boost/function/function8.hpp index cf2c376..b0275b2 100644 --- a/include/boost/function/function8.hpp +++ b/include/boost/function/function8.hpp @@ -7,6 +7,4 @@ // For more information, see http://www.boost.org -#define BOOST_FUNCTION_NUM_ARGS 8 -#include -#undef BOOST_FUNCTION_NUM_ARGS +#include diff --git a/include/boost/function/function9.hpp b/include/boost/function/function9.hpp index 590e088..b0275b2 100644 --- a/include/boost/function/function9.hpp +++ b/include/boost/function/function9.hpp @@ -7,6 +7,4 @@ // For more information, see http://www.boost.org -#define BOOST_FUNCTION_NUM_ARGS 9 -#include -#undef BOOST_FUNCTION_NUM_ARGS +#include diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 36e5f19..0746921 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -1,3 +1,6 @@ +#ifndef BOOST_FUNCTION_FUNCTION_TEMPLATE_HPP_INCLUDED +#define BOOST_FUNCTION_FUNCTION_TEMPLATE_HPP_INCLUDED + // Boost.Function library // Copyright Douglas Gregor 2001-2006 @@ -8,10 +11,15 @@ // For more information, see http://www.boost.org -// Note: this header is a header template and must NOT have multiple-inclusion -// protection. -#include +#include #include +#include +#include +#include +#include +#include +#include +#include #if defined(BOOST_MSVC) # pragma warning( push ) @@ -1041,3 +1049,30 @@ public: #if defined(BOOST_MSVC) # pragma warning( pop ) #endif + +// Resolve C++20 issue with fn == bind(...) +// https://github.com/boostorg/function/issues/45 + +namespace boost +{ + +namespace _bi +{ + +template class bind_t; + +} // namespace _bi + +template bool operator==( function const& f, _bi::bind_t const& b ) +{ + return f.contains( b ); +} + +template bool operator!=( function const& f, _bi::bind_t const& b ) +{ + return !f.contains( b ); +} + +} // namespace boost + +#endif // #ifndef BOOST_FUNCTION_FUNCTION_TEMPLATE_HPP_INCLUDED