From 6961c50cceed9582fafda48dcaba4c1aee846218 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 12 Feb 2023 03:23:54 +0200 Subject: [PATCH 001/115] Add fn_eq_bind_test. Refs #45. --- test/Jamfile.v2 | 2 + test/fn_eq_bind_test.cpp | 87 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 test/fn_eq_bind_test.cpp diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 423f61cf..168fb7f3 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -84,3 +84,5 @@ run test_return_function.cpp return_function/14 : : : static $(che run quick.cpp ; compile issue_42.cpp ; + +run fn_eq_bind_test.cpp ; diff --git a/test/fn_eq_bind_test.cpp b/test/fn_eq_bind_test.cpp new file mode 100644 index 00000000..b6ad599f --- /dev/null +++ b/test/fn_eq_bind_test.cpp @@ -0,0 +1,87 @@ +// Copyright 2023 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include +#include +#include + +using namespace boost::placeholders; + +int f1() { return 1; } +int f2() { return 2; } + +int main() +{ + { + boost::function fn( boost::bind( f1 ) ); + + BOOST_TEST( fn == boost::bind( f1 ) ); + BOOST_TEST( fn != boost::bind( f2 ) ); + } + + { + boost::function fn( boost::bind( f1 ) ); + + BOOST_TEST( fn == boost::bind( f1 ) ); + BOOST_TEST( fn != boost::bind( f2 ) ); + } + + { + boost::function fn( boost::bind( f1 ) ); + + BOOST_TEST( fn == boost::bind( f1 ) ); + BOOST_TEST( fn != boost::bind( f2 ) ); + } + + { + boost::function fn( boost::bind( f1 ) ); + + BOOST_TEST( fn == boost::bind( f1 ) ); + BOOST_TEST( fn != boost::bind( f2 ) ); + } + + { + boost::function fn( boost::bind( f1 ) ); + + BOOST_TEST( fn == boost::bind( f1 ) ); + BOOST_TEST( fn != boost::bind( f2 ) ); + } + + { + boost::function fn( boost::bind( f1 ) ); + + BOOST_TEST( fn == boost::bind( f1 ) ); + BOOST_TEST( fn != boost::bind( f2 ) ); + } + + { + boost::function fn( boost::bind( f1 ) ); + + BOOST_TEST( fn == boost::bind( f1 ) ); + BOOST_TEST( fn != boost::bind( f2 ) ); + } + + { + boost::function fn( boost::bind( f1 ) ); + + BOOST_TEST( fn == boost::bind( f1 ) ); + BOOST_TEST( fn != boost::bind( f2 ) ); + } + + { + boost::function fn( boost::bind( f1 ) ); + + BOOST_TEST( fn == boost::bind( f1 ) ); + BOOST_TEST( fn != boost::bind( f2 ) ); + } + + { + boost::function fn( boost::bind( f1 ) ); + + BOOST_TEST( fn == boost::bind( f1 ) ); + BOOST_TEST( fn != boost::bind( f2 ) ); + } + + return boost::report_errors(); +} From a12700613942fa2dc5d7dc82797572b65cb99f57 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 12 Feb 2023 04:00:33 +0200 Subject: [PATCH 002/115] Add Drone support --- .drone.jsonnet | 382 +++++++++++++++++++++++++++++++++++++++++++++++ .drone/drone.bat | 23 +++ .drone/drone.sh | 25 ++++ 3 files changed, 430 insertions(+) create mode 100644 .drone.jsonnet create mode 100644 .drone/drone.bat create mode 100755 .drone/drone.sh diff --git a/.drone.jsonnet b/.drone.jsonnet new file mode 100644 index 00000000..a0fae1b4 --- /dev/null +++ b/.drone.jsonnet @@ -0,0 +1,382 @@ +# Copyright 2022 Peter Dimov +# Distributed under the Boost Software License, Version 1.0. +# https://www.boost.org/LICENSE_1_0.txt + +local library = "function"; + +local triggers = +{ + branch: [ "master", "develop", "feature/*" ] +}; + +local ubsan = { UBSAN: '1', UBSAN_OPTIONS: 'print_stacktrace=1' }; +local asan = { ASAN: '1' }; + +local linux_pipeline(name, image, environment, packages = "", sources = [], arch = "amd64") = +{ + name: name, + kind: "pipeline", + type: "docker", + trigger: triggers, + platform: + { + os: "linux", + arch: arch + }, + steps: + [ + { + name: "everything", + image: image, + environment: environment, + commands: + [ + 'set -e', + 'wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -', + ] + + (if sources != [] then [ ('apt-add-repository "' + source + '"') for source in sources ] else []) + + (if packages != "" then [ 'apt-get update', 'apt-get -y install ' + packages ] else []) + + [ + 'export LIBRARY=' + library, + './.drone/drone.sh', + ] + } + ] +}; + +local macos_pipeline(name, environment, xcode_version = "12.2", osx_version = "catalina", arch = "amd64") = +{ + name: name, + kind: "pipeline", + type: "exec", + trigger: triggers, + platform: { + "os": "darwin", + "arch": arch + }, + node: { + "os": osx_version + }, + steps: [ + { + name: "everything", + environment: environment + { "DEVELOPER_DIR": "/Applications/Xcode-" + xcode_version + ".app/Contents/Developer" }, + commands: + [ + 'export LIBRARY=' + library, + './.drone/drone.sh', + ] + } + ] +}; + +local windows_pipeline(name, image, environment, arch = "amd64") = +{ + name: name, + kind: "pipeline", + type: "docker", + trigger: triggers, + platform: + { + os: "windows", + arch: arch + }, + "steps": + [ + { + name: "everything", + image: image, + environment: environment, + commands: + [ + 'cmd /C .drone\\\\drone.bat ' + library, + ] + } + ] +}; + +[ + linux_pipeline( + "Linux 14.04 GCC 4.4", + "cppalliance/droneubuntu1404:1", + { TOOLSET: 'gcc', COMPILER: 'g++-4.4', CXXSTD: '98,0x' }, + "g++-4.4", + [ "ppa:ubuntu-toolchain-r/test" ], + ), + + linux_pipeline( + "Linux 14.04 GCC 4.6 32/64", + "cppalliance/droneubuntu1404:1", + { TOOLSET: 'gcc', COMPILER: 'g++-4.6', CXXSTD: '98,0x', ADDRMD: '32,64' }, + "g++-4.6-multilib", + [ "ppa:ubuntu-toolchain-r/test" ], + ), + + linux_pipeline( + "Linux 14.04 GCC 4.7 32/64", + "cppalliance/droneubuntu1404:1", + { TOOLSET: 'gcc', COMPILER: 'g++-4.7', CXXSTD: '98,0x', ADDRMD: '32,64' }, + "g++-4.7-multilib", + [ "ppa:ubuntu-toolchain-r/test" ], + ), + + linux_pipeline( + "Linux 14.04 GCC 4.8* 32/64", + "cppalliance/droneubuntu1404:1", + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11', ADDRMD: '32,64' }, + ), + + linux_pipeline( + "Linux 14.04 GCC 4.9 32/64", + "cppalliance/droneubuntu1404:1", + { TOOLSET: 'gcc', COMPILER: 'g++-4.9', CXXSTD: '03,11', ADDRMD: '32,64' }, + "g++-4.9-multilib", + [ "ppa:ubuntu-toolchain-r/test" ], + ), + + linux_pipeline( + "Linux 16.04 GCC 5* 32/64", + "cppalliance/droneubuntu1604:1", + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14', ADDRMD: '32,64' }, + ), + + linux_pipeline( + "Linux 18.04 GCC 6 32/64", + "cppalliance/droneubuntu1804:1", + { TOOLSET: 'gcc', COMPILER: 'g++-6', CXXSTD: '03,11,14', ADDRMD: '32,64' }, + "g++-6-multilib", + ), + + linux_pipeline( + "Linux 18.04 GCC 7* 32/64", + "cppalliance/droneubuntu1804:1", + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17', ADDRMD: '32,64' }, + ), + + linux_pipeline( + "Linux 18.04 GCC 8 32/64", + "cppalliance/droneubuntu1804:1", + { TOOLSET: 'gcc', COMPILER: 'g++-8', CXXSTD: '03,11,14,17', ADDRMD: '32,64' }, + "g++-8-multilib", + ), + + linux_pipeline( + "Linux 20.04 GCC 9* 32/64", + "cppalliance/droneubuntu2004:1", + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a', ADDRMD: '32,64' }, + ), + + linux_pipeline( + "Linux 20.04 GCC 9* ARM64", + "cppalliance/droneubuntu2004:multiarch", + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a' }, + arch="arm64", + ), + + linux_pipeline( + "Linux 20.04 GCC 9* S390x", + "cppalliance/droneubuntu2004:multiarch", + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a' }, + arch="s390x", + ), + + linux_pipeline( + "Linux 20.04 GCC 10 32/64", + "cppalliance/droneubuntu2004:1", + { TOOLSET: 'gcc', COMPILER: 'g++-10', CXXSTD: '03,11,14,17,20', ADDRMD: '32,64' }, + "g++-10-multilib", + ), + + linux_pipeline( + "Linux 22.04 GCC 11* 32/64", + "cppalliance/droneubuntu2204:1", + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a', ADDRMD: '32,64' }, + ), + + linux_pipeline( + "Linux 22.04 GCC 12 32 ASAN", + "cppalliance/droneubuntu2204:1", + { TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '03,11,14,17,20,2b', ADDRMD: '32' } + asan, + "g++-12-multilib", + ), + + linux_pipeline( + "Linux 22.04 GCC 12 64 ASAN", + "cppalliance/droneubuntu2204:1", + { TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '03,11,14,17,20,2b', ADDRMD: '64' } + asan, + "g++-12-multilib", + ), + + linux_pipeline( + "Linux 16.04 Clang 3.5", + "cppalliance/droneubuntu1604:1", + { TOOLSET: 'clang', COMPILER: 'clang++-3.5', CXXSTD: '03,11' }, + "clang-3.5", + ), + + linux_pipeline( + "Linux 16.04 Clang 3.6", + "cppalliance/droneubuntu1604:1", + { TOOLSET: 'clang', COMPILER: 'clang++-3.6', CXXSTD: '03,11,14' }, + "clang-3.6", + ), + + linux_pipeline( + "Linux 16.04 Clang 3.7", + "cppalliance/droneubuntu1604:1", + { TOOLSET: 'clang', COMPILER: 'clang++-3.7', CXXSTD: '03,11,14' }, + "clang-3.7", + ), + + linux_pipeline( + "Linux 16.04 Clang 3.8", + "cppalliance/droneubuntu1604:1", + { TOOLSET: 'clang', COMPILER: 'clang++-3.8', CXXSTD: '03,11,14' }, + "clang-3.8", + ), + + linux_pipeline( + "Linux 18.04 Clang 3.9", + "cppalliance/droneubuntu1804:1", + { TOOLSET: 'clang', COMPILER: 'clang++-3.9', CXXSTD: '03,11,14' }, + "clang-3.9", + ), + + linux_pipeline( + "Linux 18.04 Clang 4.0", + "cppalliance/droneubuntu1804:1", + { TOOLSET: 'clang', COMPILER: 'clang++-4.0', CXXSTD: '03,11,14' }, + "clang-4.0", + ), + + linux_pipeline( + "Linux 18.04 Clang 5.0", + "cppalliance/droneubuntu1804:1", + { TOOLSET: 'clang', COMPILER: 'clang++-5.0', CXXSTD: '03,11,14,1z' }, + "clang-5.0", + ), + + linux_pipeline( + "Linux 18.04 Clang 6.0", + "cppalliance/droneubuntu1804:1", + { TOOLSET: 'clang', COMPILER: 'clang++-6.0', CXXSTD: '03,11,14,17' }, + "clang-6.0", + ), + + linux_pipeline( + "Linux 20.04 Clang 7", + "cppalliance/droneubuntu2004:1", + { TOOLSET: 'clang', COMPILER: 'clang++-7', CXXSTD: '03,11,14,17' }, + "clang-7", + ), + + linux_pipeline( + "Linux 20.04 Clang 8", + "cppalliance/droneubuntu2004:1", + { TOOLSET: 'clang', COMPILER: 'clang++-8', CXXSTD: '03,11,14,17' }, + "clang-8", + ), + + linux_pipeline( + "Linux 20.04 Clang 9", + "cppalliance/droneubuntu2004:1", + { TOOLSET: 'clang', COMPILER: 'clang++-9', CXXSTD: '03,11,14,17,2a' }, + "clang-9", + ), + + linux_pipeline( + "Linux 20.04 Clang 10", + "cppalliance/droneubuntu2004:1", + { TOOLSET: 'clang', COMPILER: 'clang++-10', CXXSTD: '03,11,14,17,2a' }, + "clang-10", + ), + + linux_pipeline( + "Linux 20.04 Clang 11", + "cppalliance/droneubuntu2004:1", + { TOOLSET: 'clang', COMPILER: 'clang++-11', CXXSTD: '03,11,14,17,2a' }, + "clang-11", + ), + + linux_pipeline( + "Linux 20.04 Clang 12", + "cppalliance/droneubuntu2004:1", + { TOOLSET: 'clang', COMPILER: 'clang++-12', CXXSTD: '03,11,14,17,2a' }, + "clang-12", + ), + + linux_pipeline( + "Linux 22.04 Clang 13", + "cppalliance/droneubuntu2204:1", + { TOOLSET: 'clang', COMPILER: 'clang++-13', CXXSTD: '03,11,14,17,20' }, + "clang-13", + ), + + linux_pipeline( + "Linux 22.04 Clang 14 UBSAN", + "cppalliance/droneubuntu2204:1", + { TOOLSET: 'clang', COMPILER: 'clang++-14', CXXSTD: '03,11,14,17,20,2b' } + ubsan, + "clang-14", + ), + + linux_pipeline( + "Linux 22.04 Clang 14 ASAN", + "cppalliance/droneubuntu2204:1", + { TOOLSET: 'clang', COMPILER: 'clang++-14', CXXSTD: '03,11,14,17,20,2b' } + asan, + "clang-14", + ), + + linux_pipeline( + "Linux 22.04 Clang 15", + "cppalliance/droneubuntu2204:1", + { TOOLSET: 'clang', COMPILER: 'clang++-15', CXXSTD: '03,11,14,17,20,2b' }, + "clang-15", + ["deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main"], + ), + + macos_pipeline( + "MacOS 10.15 Xcode 12.2 UBSAN", + { TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,17,2a' } + ubsan, + ), + + macos_pipeline( + "MacOS 10.15 Xcode 12.2 ASAN", + { TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,17,2a' } + asan, + ), + + macos_pipeline( + "MacOS 12.4 Xcode 13.4.1 UBSAN", + { TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,17,20,2b' } + ubsan, + xcode_version = "13.4.1", osx_version = "monterey", arch = "arm64", + ), + + macos_pipeline( + "MacOS 12.4 Xcode 13.4.1 ASAN", + { TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,17,20,2b' } + asan, + xcode_version = "13.4.1", osx_version = "monterey", arch = "arm64", + ), + + windows_pipeline( + "Windows VS2015 msvc-14.0", + "cppalliance/dronevs2015", + { TOOLSET: 'msvc-14.0', CXXSTD: '14,latest' }, + ), + + windows_pipeline( + "Windows VS2017 msvc-14.1", + "cppalliance/dronevs2017", + { TOOLSET: 'msvc-14.1', CXXSTD: '14,17,latest' }, + ), + + windows_pipeline( + "Windows VS2019 msvc-14.2", + "cppalliance/dronevs2019", + { TOOLSET: 'msvc-14.2', CXXSTD: '14,17,20,latest' }, + ), + + windows_pipeline( + "Windows VS2022 msvc-14.3", + "cppalliance/dronevs2022:1", + { TOOLSET: 'msvc-14.3', CXXSTD: '14,17,20,latest' }, + ), +] diff --git a/.drone/drone.bat b/.drone/drone.bat new file mode 100644 index 00000000..c0e33656 --- /dev/null +++ b/.drone/drone.bat @@ -0,0 +1,23 @@ +@REM Copyright 2022 Peter Dimov +@REM Distributed under the Boost Software License, Version 1.0. +@REM https://www.boost.org/LICENSE_1_0.txt + +@ECHO ON + +set LIBRARY=%1 +set DRONE_BUILD_DIR=%CD% + +set BOOST_BRANCH=develop +if "%DRONE_BRANCH%" == "master" set BOOST_BRANCH=master +cd .. +git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root +cd boost-root +git submodule update --init tools/boostdep +xcopy /s /e /q %DRONE_BUILD_DIR% libs\%LIBRARY%\ +python tools/boostdep/depinst/depinst.py -I example %LIBRARY% +cmd /c bootstrap +b2 -d0 headers + +if not "%CXXSTD%" == "" set CXXSTD=cxxstd=%CXXSTD% +if not "%ADDRMD%" == "" set ADDRMD=address-model=%ADDRMD% +b2 -j3 libs/%LIBRARY%/test toolset=%TOOLSET% %CXXSTD% %ADDRMD% variant=debug,release embed-manifest-via=linker diff --git a/.drone/drone.sh b/.drone/drone.sh new file mode 100755 index 00000000..e3cda03d --- /dev/null +++ b/.drone/drone.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# Copyright 2022 Peter Dimov +# Distributed under the Boost Software License, Version 1.0. +# https://www.boost.org/LICENSE_1_0.txt + +set -ex +export PATH=~/.local/bin:/usr/local/bin:$PATH + +DRONE_BUILD_DIR=$(pwd) + +BOOST_BRANCH=develop +if [ "$DRONE_BRANCH" = "master" ]; then BOOST_BRANCH=master; fi + +cd .. +git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root +cd boost-root +git submodule update --init tools/boostdep +cp -r $DRONE_BUILD_DIR/* libs/$LIBRARY +python tools/boostdep/depinst/depinst.py -I example $LIBRARY +./bootstrap.sh +./b2 -d0 headers + +echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam +./b2 -j3 libs/$LIBRARY/test toolset=$TOOLSET cxxstd=$CXXSTD variant=debug,release ${ADDRMD:+address-model=$ADDRMD} ${UBSAN:+undefined-sanitizer=norecover debug-symbols=on} ${ASAN:+address-sanitizer=norecover debug-symbols=on} ${LINKFLAGS:+linkflags=$LINKFLAGS} From c44392fcae2ad65e3e246eb554d117800565ada8 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 12 Feb 2023 04:43:26 +0200 Subject: [PATCH 003/115] Update test/Jamfile --- test/Jamfile.v2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 423f61cf..f42641d4 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -20,7 +20,7 @@ project run function_test.cpp ; # /usr/include/c++/4.4/bits/shared_ptr.h:146: error: cannot use typeid with -fno-rtti -run function_test.cpp : : : off gcc-4.4.7,0x:no : function_test_no_rtti ; +run function_test.cpp : : : off gcc-4.4,0x:no : function_test_no_rtti ; run function_n_test.cpp ; run allocator_test.cpp ; run stateless_test.cpp ; From e9f10369275f586d98b3138324fa0fe400879fac Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 12 Feb 2023 04:44:32 +0200 Subject: [PATCH 004/115] Avoid -Wsign-compare under GCC 4.4 in lambda_test.cpp --- test/lambda_test.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/lambda_test.cpp b/test/lambda_test.cpp index 7def0fa5..738e876a 100644 --- a/test/lambda_test.cpp +++ b/test/lambda_test.cpp @@ -28,13 +28,13 @@ int main() using namespace boost::lambda; function f1 = bind(func_impl, 15, _1, _2); - BOOST_TEST_EQ( f1(true, 2.0), 30 ); + BOOST_TEST_EQ( f1(true, 2.0), 30u ); function f2 = boost::lambda::bind(f1, false, _1); - BOOST_TEST_EQ( f2(2.0), 60 ); + BOOST_TEST_EQ( f2(2.0), 60u ); function f3 = boost::lambda::bind(f2, 4.0); - BOOST_TEST_EQ( f3(), 120 ); + BOOST_TEST_EQ( f3(), 120u ); return boost::report_errors(); } From 9229ed30103df59a4f989ca0235b0d1026bf6e1c Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 12 Feb 2023 04:47:38 +0200 Subject: [PATCH 005/115] Avoid another -Wmaybe-uninitialized under GCC 11/12 --- include/boost/function/function_template.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index dcfc8f00..bd0ce791 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -501,8 +501,16 @@ namespace boost { void clear(function_buffer& functor) const { +#if defined(BOOST_GCC) && (__GNUC__ >= 11) +# pragma GCC diagnostic push +// False positive in GCC 11/12 for empty function objects +# pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif if (base.manager) base.manager(functor, functor, destroy_functor_tag); +#if defined(BOOST_GCC) && (__GNUC__ >= 11) +# pragma GCC diagnostic pop +#endif } private: From b75386f628b46f1060a20b6e015931bac37b7da7 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 12 Feb 2023 04:50:04 +0200 Subject: [PATCH 006/115] Avoid -Wuninitialized under GCC 11.3 --- include/boost/function/function_template.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index bd0ce791..23814464 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -914,8 +914,8 @@ namespace boost { // This warning is technically correct, but we don't want to pay the price for initializing // just to silence a warning: https://github.com/boostorg/function/issues/27 # pragma GCC diagnostic ignored "-Wmaybe-uninitialized" -# if (BOOST_GCC >= 120000) - // GCC 12 emits a different warning: https://github.com/boostorg/function/issues/42 +# if (BOOST_GCC >= 110000) + // GCC 11.3, 12 emit a different warning: https://github.com/boostorg/function/issues/42 # pragma GCC diagnostic ignored "-Wuninitialized" # endif # endif From 8882d0b74cbd173846b1f8ab8d07a855c4c25e6f Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 12 Feb 2023 05:30:33 +0200 Subject: [PATCH 007/115] Update ci.yml --- .github/workflows/ci.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 95b088d4..43eab5fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,12 +53,12 @@ jobs: install: g++-10-multilib address-model: 32,64 - toolset: gcc-11 - cxxstd: "03,11,14,17,20" - os: ubuntu-20.04 + cxxstd: "03,11,14,17,20,2b" + os: ubuntu-22.04 install: g++-11-multilib address-model: 32,64 - toolset: gcc-12 - cxxstd: "03,11,14,17,20" + cxxstd: "03,11,14,17,20,2b" os: ubuntu-22.04 install: g++-12-multilib address-model: 32,64 @@ -116,12 +116,20 @@ jobs: install: clang-13 - toolset: clang compiler: clang++-14 - cxxstd: "03,11,14,17,20" + cxxstd: "03,11,14,17,20,2b" os: ubuntu-22.04 install: clang-14 + - toolset: clang + compiler: clang++-15 + cxxstd: "03,11,14,17,20,2b" + os: ubuntu-22.04 + install: clang-15 - toolset: clang cxxstd: "03,11,14,17,2a" os: macos-11 + - toolset: clang + cxxstd: "03,11,14,17,20,2b" + os: macos-12 runs-on: ${{matrix.os}} From 5470c5fa320fa492488db457d4846f00dfeb4d17 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 12 Feb 2023 19:25:39 +0200 Subject: [PATCH 008/115] Resolve C++20 issue with fn == bind(...). Fixes #45. --- include/boost/function.hpp | 2 ++ include/boost/function/detail/epilogue.hpp | 39 ++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 include/boost/function/detail/epilogue.hpp diff --git a/include/boost/function.hpp b/include/boost/function.hpp index ef907e0f..f6ee8820 100644 --- a/include/boost/function.hpp +++ b/include/boost/function.hpp @@ -71,4 +71,6 @@ # undef BOOST_PP_ITERATION_PARAMS_1 #endif +#include + #endif // !defined(BOOST_FUNCTION_MAX_ARGS_DEFINED) || (BOOST_FUNCTION_MAX_ARGS_DEFINED != BOOST_FUNCTION_MAX_ARGS) diff --git a/include/boost/function/detail/epilogue.hpp b/include/boost/function/detail/epilogue.hpp new file mode 100644 index 00000000..908788bc --- /dev/null +++ b/include/boost/function/detail/epilogue.hpp @@ -0,0 +1,39 @@ +// 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 + +#if !defined(BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX) + +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 // #if !defined(BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX) + +#endif // #ifndef BOOST_FUNCTION_EPILOGUE_HPP From 1e7cc33d77827e8ac41d2a1319eb68dd5f9a23d7 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 12 Feb 2023 20:14:56 +0200 Subject: [PATCH 009/115] Add VS2017 clang-cl to appveyor.yml --- appveyor.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 40be4fda..07f8b256 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -24,6 +24,10 @@ environment: TOOLSET: msvc-14.1 CXXSTD: 14,17 ADDRMD: 32,64 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + TOOLSET: clang-win + CXXSTD: 14,17,latest + ADDRMD: 64 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 TOOLSET: clang-win CXXSTD: 14,17,latest From cb888a496d18034a72e366d3dd0b83c36afaf679 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 17 Feb 2023 03:48:52 +0200 Subject: [PATCH 010/115] Remove unnecessary include of boost/integer.hpp --- include/boost/function/function_base.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/include/boost/function/function_base.hpp b/include/boost/function/function_base.hpp index 14185323..6a65bd2c 100644 --- a/include/boost/function/function_base.hpp +++ b/include/boost/function/function_base.hpp @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include From 9f21554e13b760f1199fb9ca0c0aae2a882417a4 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 17 Feb 2023 04:20:51 +0200 Subject: [PATCH 011/115] Regenerate CMakeLists.txt --- CMakeLists.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d1402849..caa6c865 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,9 @@ # Generated by `boostdep --cmake function` -# Copyright 2020 Peter Dimov +# Copyright 2020, 2021 Peter Dimov # Distributed under the Boost Software License, Version 1.0. # https://www.boost.org/LICENSE_1_0.txt -cmake_minimum_required(VERSION 3.5...3.16) +cmake_minimum_required(VERSION 3.5...3.20) project(boost_function VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) @@ -18,7 +18,6 @@ target_link_libraries(boost_function Boost::bind Boost::config Boost::core - Boost::integer Boost::preprocessor Boost::throw_exception Boost::type_index @@ -31,4 +30,3 @@ if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt") add_subdirectory(test) endif() - From df5ae70b71c664baeb61a32db3e65f3c835f52cc Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 17 Feb 2023 06:16:02 +0200 Subject: [PATCH 012/115] Update test/cmake_subdir_test --- test/cmake_subdir_test/CMakeLists.txt | 42 +++++++++++++-------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/test/cmake_subdir_test/CMakeLists.txt b/test/cmake_subdir_test/CMakeLists.txt index c55ed0ef..a6d3f7ee 100644 --- a/test/cmake_subdir_test/CMakeLists.txt +++ b/test/cmake_subdir_test/CMakeLists.txt @@ -2,39 +2,39 @@ # 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 -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.5...3.20) project(cmake_subdir_test LANGUAGES CXX) add_subdirectory(../.. boostorg/function) -# boost_add_subdir +set(deps -function(boost_add_subdir name) +# Primary dependencies - add_subdirectory(../../../${name} boostorg/${name}) +assert +bind +config +core +preprocessor +throw_exception +type_index +type_traits +typeof -endfunction() +# Secondary dependencies -# primary dependencies +static_assert +container_hash +describe +mp11 +) -boost_add_subdir(assert) -boost_add_subdir(bind) -boost_add_subdir(config) -boost_add_subdir(core) -boost_add_subdir(integer) -boost_add_subdir(preprocessor) -boost_add_subdir(throw_exception) -boost_add_subdir(type_index) -boost_add_subdir(type_traits) -boost_add_subdir(typeof) +foreach(dep IN LISTS deps) -# secondary dependencies + add_subdirectory(../../../${dep} boostorg/${dep}) -boost_add_subdir(static_assert) -boost_add_subdir(container_hash) -boost_add_subdir(describe) -boost_add_subdir(mp11) +endforeach() # --target check From 45e1ddeabcdc37baa4785ababc5c18e23dc83843 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 17 Feb 2023 13:32:59 +0200 Subject: [PATCH 013/115] Add -fno-rtti runs of contains_test and contains2_test --- test/Jamfile.v2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 02b0c5c4..15d401ea 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -86,3 +86,7 @@ run quick.cpp ; compile issue_42.cpp ; run fn_eq_bind_test.cpp ; + +# /usr/include/c++/4.4/bits/shared_ptr.h:146: error: cannot use typeid with -fno-rtti +run contains_test.cpp : : : off gcc-4.4,0x:no : contains_test_no_rtti ; +run contains2_test.cpp : : : off gcc-4.4,0x:no : contains2_test_no_rtti ; From 361e07808f39bc25cb25aa3f0504593d8caa6373 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 17 Feb 2023 13:55:26 +0200 Subject: [PATCH 014/115] Rearrange include order --- include/boost/function/function_base.hpp | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/include/boost/function/function_base.hpp b/include/boost/function/function_base.hpp index 6a65bd2c..6c9e9b4f 100644 --- a/include/boost/function/function_base.hpp +++ b/include/boost/function/function_base.hpp @@ -11,30 +11,27 @@ #ifndef BOOST_FUNCTION_BASE_HEADER #define BOOST_FUNCTION_BASE_HEADER -#include -#include -#include -#include -#include -#include +#include +#include #include +#include #include #include #include #include #include #include -#include #include -#include #include -#ifndef BOOST_NO_SFINAE #include -#else #include -#endif -#include -#include +#include +#include +#include +#include +#include +#include +#include #if defined(BOOST_MSVC) # pragma warning( push ) From d268283044c25e11154e19b8507fbf0fedaff2bb Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 17 Feb 2023 14:25:43 +0200 Subject: [PATCH 015/115] Replace boost/typeindex.hpp use with core/typeinfo.hpp --- include/boost/function/function_base.hpp | 38 ++++++++++++------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/include/boost/function/function_base.hpp b/include/boost/function/function_base.hpp index 6c9e9b4f..5693e11e 100644 --- a/include/boost/function/function_base.hpp +++ b/include/boost/function/function_base.hpp @@ -13,8 +13,8 @@ #include #include -#include -#include +#include +#include #include #include #include @@ -70,7 +70,7 @@ namespace boost { // For pointers to std::type_info objects struct type_t { // (get_functor_type_tag, check_functor_type_tag). - const boost::typeindex::type_info* type; + const boost::core::typeinfo* type; // Whether the type is const-qualified. bool const_qualified; @@ -200,7 +200,7 @@ namespace boost { { // Check whether we have the same type. We can add // cv-qualifiers, but we can't take them away. - if (*out_buffer.members.type.type == boost::typeindex::type_id() + if (*out_buffer.members.type.type == BOOST_CORE_TYPEID(F) && (!in_buffer.members.obj_ref.is_const_qualified || out_buffer.members.type.const_qualified) && (!in_buffer.members.obj_ref.is_volatile_qualified @@ -212,7 +212,7 @@ namespace boost { return; case get_functor_type_tag: - out_buffer.members.type.type = &boost::typeindex::type_id().type_info(); + out_buffer.members.type.type = &BOOST_CORE_TYPEID(F); out_buffer.members.type.const_qualified = in_buffer.members.obj_ref.is_const_qualified; out_buffer.members.type.volatile_qualified = in_buffer.members.obj_ref.is_volatile_qualified; return; @@ -272,12 +272,12 @@ namespace boost { } else if (op == destroy_functor_tag) out_buffer.members.func_ptr = 0; else if (op == check_functor_type_tag) { - if (*out_buffer.members.type.type == boost::typeindex::type_id()) + if (*out_buffer.members.type.type == BOOST_CORE_TYPEID(Functor)) out_buffer.members.obj_ptr = &in_buffer.members.func_ptr; else out_buffer.members.obj_ptr = 0; } else /* op == get_functor_type_tag */ { - out_buffer.members.type.type = &boost::typeindex::type_id().type_info(); + out_buffer.members.type.type = &BOOST_CORE_TYPEID(Functor); out_buffer.members.type.const_qualified = false; out_buffer.members.type.volatile_qualified = false; } @@ -304,12 +304,12 @@ namespace boost { (void)f; // suppress warning about the value of f not being used (MSVC) f->~Functor(); } else if (op == check_functor_type_tag) { - if (*out_buffer.members.type.type == boost::typeindex::type_id()) + if (*out_buffer.members.type.type == BOOST_CORE_TYPEID(Functor)) out_buffer.members.obj_ptr = in_buffer.data; else out_buffer.members.obj_ptr = 0; } else /* op == get_functor_type_tag */ { - out_buffer.members.type.type = &boost::typeindex::type_id().type_info(); + out_buffer.members.type.type = &BOOST_CORE_TYPEID(Functor); out_buffer.members.type.const_qualified = false; out_buffer.members.type.volatile_qualified = false; } @@ -363,12 +363,12 @@ namespace boost { delete f; out_buffer.members.obj_ptr = 0; } else if (op == check_functor_type_tag) { - if (*out_buffer.members.type.type == boost::typeindex::type_id()) + if (*out_buffer.members.type.type == BOOST_CORE_TYPEID(Functor)) out_buffer.members.obj_ptr = in_buffer.members.obj_ptr; else out_buffer.members.obj_ptr = 0; } else /* op == get_functor_type_tag */ { - out_buffer.members.type.type = &boost::typeindex::type_id().type_info(); + out_buffer.members.type.type = &BOOST_CORE_TYPEID(Functor); out_buffer.members.type.const_qualified = false; out_buffer.members.type.volatile_qualified = false; } @@ -402,7 +402,7 @@ namespace boost { { typedef typename get_function_tag::type tag_type; if (op == get_functor_type_tag) { - out_buffer.members.type.type = &boost::typeindex::type_id().type_info(); + out_buffer.members.type.type = &BOOST_CORE_TYPEID(functor_type); out_buffer.members.type.const_qualified = false; out_buffer.members.type.volatile_qualified = false; } else { @@ -481,12 +481,12 @@ namespace boost { wrapper_allocator.deallocate(victim,1); out_buffer.members.obj_ptr = 0; } else if (op == check_functor_type_tag) { - if (*out_buffer.members.type.type == boost::typeindex::type_id()) + if (*out_buffer.members.type.type == BOOST_CORE_TYPEID(Functor)) out_buffer.members.obj_ptr = in_buffer.members.obj_ptr; else out_buffer.members.obj_ptr = 0; } else /* op == get_functor_type_tag */ { - out_buffer.members.type.type = &boost::typeindex::type_id().type_info(); + out_buffer.members.type.type = &BOOST_CORE_TYPEID(Functor); out_buffer.members.type.const_qualified = false; out_buffer.members.type.volatile_qualified = false; } @@ -512,7 +512,7 @@ namespace boost { { typedef typename get_function_tag::type tag_type; if (op == get_functor_type_tag) { - out_buffer.members.type.type = &boost::typeindex::type_id().type_info(); + out_buffer.members.type.type = &BOOST_CORE_TYPEID(functor_type); out_buffer.members.type.const_qualified = false; out_buffer.members.type.volatile_qualified = false; } else { @@ -612,9 +612,9 @@ class function_base /** Retrieve the type of the stored function object, or type_id() if this is empty. */ - const boost::typeindex::type_info& target_type() const + const boost::core::typeinfo& target_type() const { - if (!vtable) return boost::typeindex::type_id().type_info(); + if (!vtable) return BOOST_CORE_TYPEID(void); detail::function::function_buffer type; get_vtable()->manager(functor, type, detail::function::get_functor_type_tag); @@ -627,7 +627,7 @@ class function_base if (!vtable) return 0; detail::function::function_buffer type_result; - type_result.members.type.type = &boost::typeindex::type_id().type_info(); + type_result.members.type.type = &BOOST_CORE_TYPEID(Functor); type_result.members.type.const_qualified = is_const::value; type_result.members.type.volatile_qualified = is_volatile::value; get_vtable()->manager(functor, type_result, @@ -641,7 +641,7 @@ class function_base if (!vtable) return 0; detail::function::function_buffer type_result; - type_result.members.type.type = &boost::typeindex::type_id().type_info(); + type_result.members.type.type = &BOOST_CORE_TYPEID(Functor); type_result.members.type.const_qualified = true; type_result.members.type.volatile_qualified = is_volatile::value; get_vtable()->manager(functor, type_result, From 69eae72f9bd3a5ab468a6112e92fb5c21a2bcd9e Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 17 Feb 2023 15:31:06 +0200 Subject: [PATCH 016/115] Regenerate CMakeLists.txt --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index caa6c865..18a34d54 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,6 @@ target_link_libraries(boost_function Boost::core Boost::preprocessor Boost::throw_exception - Boost::type_index Boost::type_traits Boost::typeof ) From 141b4331e4efb01c86fdc62c34851b0a91c0ce75 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 17 Feb 2023 15:32:36 +0200 Subject: [PATCH 017/115] Update test/cmake_subdir_test --- test/cmake_subdir_test/CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/cmake_subdir_test/CMakeLists.txt b/test/cmake_subdir_test/CMakeLists.txt index a6d3f7ee..f3ef5393 100644 --- a/test/cmake_subdir_test/CMakeLists.txt +++ b/test/cmake_subdir_test/CMakeLists.txt @@ -18,16 +18,12 @@ config core preprocessor throw_exception -type_index type_traits typeof # Secondary dependencies static_assert -container_hash -describe -mp11 ) foreach(dep IN LISTS deps) From f1535c3b00a5a56607ef0f8058aee96f77a9af85 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 5 Mar 2023 18:27:55 +0200 Subject: [PATCH 018/115] Update ci.yml --- .github/workflows/ci.yml | 225 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 211 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43eab5fd..4b7a5419 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,27 +19,30 @@ jobs: include: - toolset: gcc-4.8 cxxstd: "03,11" - os: ubuntu-18.04 + os: ubuntu-latest + container: ubuntu:18.04 install: g++-4.8-multilib address-model: 32,64 - toolset: gcc-5 cxxstd: "03,11,14,1z" - os: ubuntu-18.04 + os: ubuntu-latest + container: ubuntu:18.04 install: g++-5-multilib address-model: 32,64 - toolset: gcc-6 cxxstd: "03,11,14,1z" - os: ubuntu-18.04 + os: ubuntu-latest + container: ubuntu:18.04 install: g++-6-multilib address-model: 32,64 - toolset: gcc-7 cxxstd: "03,11,14,17" - os: ubuntu-18.04 + os: ubuntu-20.04 install: g++-7-multilib address-model: 32,64 - toolset: gcc-8 cxxstd: "03,11,14,17,2a" - os: ubuntu-18.04 + os: ubuntu-20.04 install: g++-8-multilib address-model: 32,64 - toolset: gcc-9 @@ -65,27 +68,30 @@ jobs: - toolset: clang compiler: clang++-3.9 cxxstd: "03,11,14" - os: ubuntu-18.04 + os: ubuntu-latest + container: ubuntu:18.04 install: clang-3.9 - toolset: clang compiler: clang++-4.0 cxxstd: "03,11,14" - os: ubuntu-18.04 + os: ubuntu-latest + container: ubuntu:18.04 install: clang-4.0 - toolset: clang compiler: clang++-5.0 cxxstd: "03,11,14,1z" - os: ubuntu-18.04 + os: ubuntu-latest + container: ubuntu:18.04 install: clang-5.0 - toolset: clang compiler: clang++-6.0 cxxstd: "03,11,14,17" - os: ubuntu-18.04 + os: ubuntu-20.04 install: clang-6.0 - toolset: clang compiler: clang++-7 cxxstd: "03,11,14,17" - os: ubuntu-18.04 + os: ubuntu-20.04 install: clang-7 - toolset: clang compiler: clang++-8 @@ -132,13 +138,24 @@ jobs: os: macos-12 runs-on: ${{matrix.os}} + container: ${{matrix.container}} + + defaults: + run: + shell: bash steps: - uses: actions/checkout@v3 + - name: Setup container environment + if: matrix.container + run: | + apt-get update + apt-get -y install sudo python git g++ + - name: Install packages if: matrix.install - run: sudo apt install ${{matrix.install}} + run: sudo apt-get -y install ${{matrix.install}} - name: Setup Boost run: | @@ -249,7 +266,7 @@ jobs: - name: Install packages if: matrix.install - run: sudo apt install ${{matrix.install}} + run: sudo apt-get -y install ${{matrix.install}} - name: Setup Boost run: | @@ -296,7 +313,7 @@ jobs: - name: Install packages if: matrix.install - run: sudo apt install ${{matrix.install}} + run: sudo apt-get -y install ${{matrix.install}} - name: Setup Boost run: | @@ -353,7 +370,7 @@ jobs: - name: Install packages if: matrix.install - run: sudo apt install ${{matrix.install}} + run: sudo apt-get -y install ${{matrix.install}} - name: Setup Boost run: | @@ -390,3 +407,183 @@ jobs: run: | cd ../boost-root/__build__ ctest --output-on-failure --no-tests=error + + windows-cmake-subdir: + strategy: + fail-fast: false + matrix: + include: + - os: windows-2019 + - os: windows-2022 + + runs-on: ${{matrix.os}} + + steps: + - uses: actions/checkout@v3 + + - name: Setup Boost + shell: cmd + run: | + echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY% + for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi + echo LIBRARY: %LIBRARY% + echo LIBRARY=%LIBRARY%>>%GITHUB_ENV% + echo GITHUB_BASE_REF: %GITHUB_BASE_REF% + echo GITHUB_REF: %GITHUB_REF% + if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF% + set BOOST_BRANCH=develop + for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master + echo BOOST_BRANCH: %BOOST_BRANCH% + cd .. + git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\ + git submodule update --init tools/boostdep + python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY% + + - name: Use library with add_subdirectory (Debug) + shell: cmd + run: | + cd ../boost-root/libs/%LIBRARY%/test/cmake_subdir_test + mkdir __build__ && cd __build__ + cmake .. + cmake --build . --config Debug + ctest --output-on-failure --no-tests=error -C Debug + + - name: Use library with add_subdirectory (Release) + shell: cmd + run: | + cd ../boost-root/libs/%LIBRARY%/test/cmake_subdir_test/__build__ + cmake --build . --config Release + ctest --output-on-failure --no-tests=error -C Release + + windows-cmake-install: + strategy: + fail-fast: false + matrix: + include: + - os: windows-2019 + - os: windows-2022 + + runs-on: ${{matrix.os}} + + steps: + - uses: actions/checkout@v3 + + - name: Setup Boost + shell: cmd + run: | + echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY% + for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi + echo LIBRARY: %LIBRARY% + echo LIBRARY=%LIBRARY%>>%GITHUB_ENV% + echo GITHUB_BASE_REF: %GITHUB_BASE_REF% + echo GITHUB_REF: %GITHUB_REF% + if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF% + set BOOST_BRANCH=develop + for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master + echo BOOST_BRANCH: %BOOST_BRANCH% + cd .. + git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\ + git submodule update --init tools/boostdep + python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY% + + - name: Configure + shell: cmd + run: | + cd ../boost-root + mkdir __build__ && cd __build__ + cmake -DBOOST_INCLUDE_LIBRARIES=%LIBRARY% -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix .. + + - name: Install (Debug) + shell: cmd + run: | + cd ../boost-root/__build__ + cmake --build . --target install --config Debug + + - name: Install (Release) + shell: cmd + run: | + cd ../boost-root/__build__ + cmake --build . --target install --config Release + + - name: Use the installed library (Debug) + shell: cmd + run: | + cd ../boost-root/libs/%LIBRARY%/test/cmake_install_test && mkdir __build__ && cd __build__ + cmake -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix .. + cmake --build . --config Debug + ctest --output-on-failure --no-tests=error -C Debug + + - name: Use the installed library (Release) + shell: cmd + run: | + cd ../boost-root/libs/%LIBRARY%/test/cmake_install_test/__build__ + cmake --build . --config Release + ctest --output-on-failure --no-tests=error -C Release + + windows-cmake-test: + strategy: + fail-fast: false + matrix: + include: + - os: windows-2019 + - os: windows-2022 + + runs-on: ${{matrix.os}} + + steps: + - uses: actions/checkout@v3 + + - name: Setup Boost + shell: cmd + run: | + echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY% + for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi + echo LIBRARY: %LIBRARY% + echo LIBRARY=%LIBRARY%>>%GITHUB_ENV% + echo GITHUB_BASE_REF: %GITHUB_BASE_REF% + echo GITHUB_REF: %GITHUB_REF% + if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF% + set BOOST_BRANCH=develop + for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master + echo BOOST_BRANCH: %BOOST_BRANCH% + cd .. + git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root + cd boost-root + xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\ + git submodule update --init tools/boostdep + python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY% + + - name: Configure + shell: cmd + run: | + cd ../boost-root + mkdir __build__ && cd __build__ + cmake -DBOOST_INCLUDE_LIBRARIES=%LIBRARY% -DBUILD_TESTING=ON .. + + - name: Build tests (Debug) + shell: cmd + run: | + cd ../boost-root/__build__ + cmake --build . --target tests --config Debug + + - name: Run tests (Debug) + shell: cmd + run: | + cd ../boost-root/__build__ + ctest --output-on-failure --no-tests=error -C Debug + + - name: Build tests (Release) + shell: cmd + run: | + cd ../boost-root/__build__ + cmake --build . --target tests --config Release + + - name: Run tests (Release) + shell: cmd + run: | + cd ../boost-root/__build__ + ctest --output-on-failure --no-tests=error -C Release From 65bbbbc359b2e1c57f589d020b8e9615a9a05843 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 5 Mar 2023 20:00:18 +0200 Subject: [PATCH 019/115] Add C++03 deprecation notice --- include/boost/function/detail/prologue.hpp | 1 + .../boost/function/detail/requires_cxx11.hpp | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 include/boost/function/detail/requires_cxx11.hpp diff --git a/include/boost/function/detail/prologue.hpp b/include/boost/function/detail/prologue.hpp index 53d0f05c..2edebe06 100644 --- a/include/boost/function/detail/prologue.hpp +++ b/include/boost/function/detail/prologue.hpp @@ -9,6 +9,7 @@ #ifndef BOOST_FUNCTION_PROLOGUE_HPP #define BOOST_FUNCTION_PROLOGUE_HPP +# include # include # include # include // unary_function, binary_function diff --git a/include/boost/function/detail/requires_cxx11.hpp b/include/boost/function/detail/requires_cxx11.hpp new file mode 100644 index 00000000..a68da218 --- /dev/null +++ b/include/boost/function/detail/requires_cxx11.hpp @@ -0,0 +1,22 @@ +#ifndef BOOST_FUNCTION_DETAIL_REQUIRES_CXX11_HPP_INCLUDED +#define BOOST_FUNCTION_DETAIL_REQUIRES_CXX11_HPP_INCLUDED + +// Copyright 2023 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include +#include + +#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || \ + defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \ + defined(BOOST_NO_CXX11_DECLTYPE) || \ + defined(BOOST_NO_CXX11_CONSTEXPR) || \ + defined(BOOST_NO_CXX11_NOEXCEPT) || \ + defined(BOOST_NO_CXX11_HDR_FUNCTIONAL) + +BOOST_PRAGMA_MESSAGE("C++03 support is deprecated in Boost.Function 1.82 and will be removed in Boost.Function 1.84.") + +#endif + +#endif // #ifndef BOOST_FUNCTION_DETAIL_REQUIRES_CXX11_HPP_INCLUDED From a8ae69798d205911f9a12c246be734d6868e0bd3 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 3 Jun 2023 02:29:35 +0300 Subject: [PATCH 020/115] Update C++03 deprecation message --- include/boost/function/detail/requires_cxx11.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/function/detail/requires_cxx11.hpp b/include/boost/function/detail/requires_cxx11.hpp index a68da218..a2da96ca 100644 --- a/include/boost/function/detail/requires_cxx11.hpp +++ b/include/boost/function/detail/requires_cxx11.hpp @@ -15,7 +15,7 @@ defined(BOOST_NO_CXX11_NOEXCEPT) || \ defined(BOOST_NO_CXX11_HDR_FUNCTIONAL) -BOOST_PRAGMA_MESSAGE("C++03 support is deprecated in Boost.Function 1.82 and will be removed in Boost.Function 1.84.") +BOOST_PRAGMA_MESSAGE("C++03 support was deprecated in Boost.Function 1.82 and will be removed in Boost.Function 1.84. Please open an issue in https://github.com/boostorg/function if you want it retained.") #endif From 4d3b477d71fff41bac83d21b5d52ad62ee1a3c5b Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 3 Jun 2023 10:17:00 +0300 Subject: [PATCH 021/115] Update ci.yml --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b7a5419..9bb13722 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -136,6 +136,9 @@ jobs: - toolset: clang cxxstd: "03,11,14,17,20,2b" os: macos-12 + - toolset: clang + cxxstd: "03,11,14,17,20,2b" + os: macos-13 runs-on: ${{matrix.os}} container: ${{matrix.container}} @@ -155,7 +158,9 @@ jobs: - name: Install packages if: matrix.install - run: sudo apt-get -y install ${{matrix.install}} + run: | + sudo apt-get update + sudo apt-get -y install ${{matrix.install}} - name: Setup Boost run: | From 4ecf3e8ad51798f8f4e11896dc55dd9b41333b88 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 3 Sep 2023 17:19:59 +0300 Subject: [PATCH 022/115] Update ci.yml --- .github/workflows/ci.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9bb13722..53c7f5d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,6 +65,12 @@ jobs: os: ubuntu-22.04 install: g++-12-multilib address-model: 32,64 + - toolset: gcc-13 + cxxstd: "03,11,14,17,20,2b" + os: ubuntu-latest + container: ubuntu:23.04 + install: g++-13-multilib + address-model: 32,64 - toolset: clang compiler: clang++-3.9 cxxstd: "03,11,14" @@ -130,6 +136,12 @@ jobs: cxxstd: "03,11,14,17,20,2b" os: ubuntu-22.04 install: clang-15 + - toolset: clang + compiler: clang++-16 + cxxstd: "03,11,14,17,20,2b" + os: ubuntu-latest + container: ubuntu:23.04 + install: clang-16 - toolset: clang cxxstd: "03,11,14,17,2a" os: macos-11 @@ -154,7 +166,7 @@ jobs: if: matrix.container run: | apt-get update - apt-get -y install sudo python git g++ + apt-get -y install sudo python3 git g++ - name: Install packages if: matrix.install @@ -180,7 +192,7 @@ jobs: cd boost-root cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY git submodule update --init tools/boostdep - python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY + python3 tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY ./bootstrap.sh ./b2 -d0 headers @@ -263,6 +275,7 @@ jobs: - os: ubuntu-22.04 - os: macos-11 - os: macos-12 + - os: macos-13 runs-on: ${{matrix.os}} @@ -310,6 +323,7 @@ jobs: - os: ubuntu-22.04 - os: macos-11 - os: macos-12 + - os: macos-13 runs-on: ${{matrix.os}} @@ -367,6 +381,7 @@ jobs: - os: ubuntu-22.04 - os: macos-11 - os: macos-12 + - os: macos-13 runs-on: ${{matrix.os}} From 7ca2310b15e387258e97e4cd16887f5ee4906b28 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 3 Sep 2023 17:55:50 +0300 Subject: [PATCH 023/115] Support fn.contains(f) where f is a function. Fixes #46. --- include/boost/function/function_base.hpp | 17 +++++++++++- test/Jamfile.v2 | 3 +++ test/contains3_test.cpp | 33 ++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 test/contains3_test.cpp diff --git a/include/boost/function/function_base.hpp b/include/boost/function/function_base.hpp index 5693e11e..00c7ce8e 100644 --- a/include/boost/function/function_base.hpp +++ b/include/boost/function/function_base.hpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -652,7 +653,8 @@ class function_base } template - bool contains(const F& f) const + typename boost::enable_if_< !boost::is_function::value, bool >::type + contains(const F& f) const { if (const F* fp = this->template target()) { @@ -662,6 +664,19 @@ class function_base } } + template + typename boost::enable_if_< boost::is_function::value, bool >::type + contains(Fn& f) const + { + typedef Fn* F; + if (const F* fp = this->template target()) + { + return function_equal(*fp, &f); + } else { + return false; + } + } + #if defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3 // GCC 3.3 and newer cannot copy with the global operator==, due to // problems with instantiation of function return types before it diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 15d401ea..7be87a11 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -90,3 +90,6 @@ run fn_eq_bind_test.cpp ; # /usr/include/c++/4.4/bits/shared_ptr.h:146: error: cannot use typeid with -fno-rtti run contains_test.cpp : : : off gcc-4.4,0x:no : contains_test_no_rtti ; run contains2_test.cpp : : : off gcc-4.4,0x:no : contains2_test_no_rtti ; + +run contains3_test.cpp ; +run contains3_test.cpp : : : off gcc-4.4,0x:no : contains3_test_no_rtti ; diff --git a/test/contains3_test.cpp b/test/contains3_test.cpp new file mode 100644 index 00000000..e6130bbe --- /dev/null +++ b/test/contains3_test.cpp @@ -0,0 +1,33 @@ +// Copyright 2023 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include +#include + +static int f() +{ + return 1; +} + +static int g() +{ + return 2; +} + +int main() +{ + { + boost::function fn; + BOOST_TEST( !fn.contains( f ) ); + BOOST_TEST( !fn.contains( g ) ); + } + + { + boost::function fn( f ); + BOOST_TEST( fn.contains( f ) ); + BOOST_TEST( !fn.contains( g ) ); + } + + return boost::report_errors(); +} From 8b126c89504f3675d1c0746f8c437041e6ebee7a Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 11 Oct 2023 21:37:34 +0300 Subject: [PATCH 024/115] Disable function_typeof_test for 03 --- test/Jamfile.v2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 7be87a11..cac41def 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -43,7 +43,8 @@ run contains_test.cpp ; run contains2_test.cpp ; run nothrow_swap.cpp ; run rvalues_test.cpp ; -compile function_typeof_test.cpp ; +compile function_typeof_test.cpp + : 03:no ; run result_arg_types_test.cpp ; lib throw_bad_function_call : throw_bad_function_call.cpp : shared:THROW_BAD_FUNCTION_CALL_DYN_LINK=1 ; From a6605b5d0b0168a82f866ff92c8f02bb54864e22 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 11 Oct 2023 21:57:45 +0300 Subject: [PATCH 025/115] Disable function_typeof_test for 98 and 0x as well --- test/Jamfile.v2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index cac41def..b3c08b03 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -44,7 +44,7 @@ run contains2_test.cpp ; run nothrow_swap.cpp ; run rvalues_test.cpp ; compile function_typeof_test.cpp - : 03:no ; + : 03:no 98:no 0x:no ; run result_arg_types_test.cpp ; lib throw_bad_function_call : throw_bad_function_call.cpp : shared:THROW_BAD_FUNCTION_CALL_DYN_LINK=1 ; From 6eddcae095ced9a4d5a7cd2c5cbc3f0b40da2e00 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 12 Oct 2023 01:31:00 +0300 Subject: [PATCH 026/115] Remove typeof registrations from function_typeof.hpp; they are no longer necessary since Boost.Typeof now requires decltype --- include/boost/function/function_typeof.hpp | 32 +--------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/include/boost/function/function_typeof.hpp b/include/boost/function/function_typeof.hpp index 246dc15d..3bef2704 100644 --- a/include/boost/function/function_typeof.hpp +++ b/include/boost/function/function_typeof.hpp @@ -9,37 +9,7 @@ #ifndef BOOST_FUNCTION_TYPEOF_HPP #define BOOST_FUNCTION_TYPEOF_HPP #include -#include -#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() +// This header is no longer necessary and is only retained for compatibility -BOOST_TYPEOF_REGISTER_TYPE(boost::bad_function_call) - -#if !defined(BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX) -BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function, (typename)) -#endif - -BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function0, (typename)) -BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function1, (typename)(typename)) -BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function2, (typename)(typename)(typename)) -BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function3, - (typename)(typename)(typename)(typename)) -BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function4, - (typename)(typename)(typename)(typename)(typename)) -BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function5, - (typename)(typename)(typename)(typename)(typename)(typename)) -BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function6, - (typename)(typename)(typename)(typename)(typename)(typename)(typename)) -BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function7, - (typename)(typename)(typename)(typename)(typename)(typename)(typename) - (typename)) -BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function8, - (typename)(typename)(typename)(typename)(typename)(typename)(typename) - (typename)(typename)) -BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function9, - (typename)(typename)(typename)(typename)(typename)(typename)(typename) - (typename)(typename)(typename)) -BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function10, - (typename)(typename)(typename)(typename)(typename)(typename)(typename) - (typename)(typename)(typename)(typename)) #endif From 1f3f971d1ffe3d60c6aa7d30727f76adc7050084 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 12 Oct 2023 01:33:27 +0300 Subject: [PATCH 027/115] Update C++03 deprecation message --- include/boost/function/detail/requires_cxx11.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/function/detail/requires_cxx11.hpp b/include/boost/function/detail/requires_cxx11.hpp index a2da96ca..8ed947c9 100644 --- a/include/boost/function/detail/requires_cxx11.hpp +++ b/include/boost/function/detail/requires_cxx11.hpp @@ -15,7 +15,7 @@ defined(BOOST_NO_CXX11_NOEXCEPT) || \ defined(BOOST_NO_CXX11_HDR_FUNCTIONAL) -BOOST_PRAGMA_MESSAGE("C++03 support was deprecated in Boost.Function 1.82 and will be removed in Boost.Function 1.84. Please open an issue in https://github.com/boostorg/function if you want it retained.") +BOOST_PRAGMA_MESSAGE("C++03 support was deprecated in Boost.Function 1.82 and will be removed in Boost.Function 1.85.") #endif From b3905c73948c553f642016a276a4cbefd87b60cd Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 12 Oct 2023 01:47:09 +0300 Subject: [PATCH 028/115] Regenerate CMakeLists.txt --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 18a34d54..ea5dece2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,6 @@ target_link_libraries(boost_function Boost::preprocessor Boost::throw_exception Boost::type_traits - Boost::typeof ) if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt") From d56678401d3c720b6f24a23bca239157eacbf1b1 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 12 Oct 2023 10:19:09 +0300 Subject: [PATCH 029/115] Remove msvc-9.0 from Appveyor --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 07f8b256..95434c73 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,7 +15,7 @@ branches: environment: matrix: - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0 + TOOLSET: msvc-10.0,msvc-11.0 ADDRMD: 32 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 TOOLSET: msvc-12.0,msvc-14.0 From 3182d502eb7f68c04c61a002d612c7834ed0db0a Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 10 Jan 2024 02:51:32 +0200 Subject: [PATCH 030/115] Remove C++03 from CI --- .drone.jsonnet | 76 ++++++++++++++++++++-------------------- .github/workflows/ci.yml | 56 ++++++++++++++--------------- appveyor.yml | 11 +++--- 3 files changed, 70 insertions(+), 73 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index a0fae1b4..f400dd79 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -99,7 +99,7 @@ local windows_pipeline(name, image, environment, arch = "amd64") = linux_pipeline( "Linux 14.04 GCC 4.4", "cppalliance/droneubuntu1404:1", - { TOOLSET: 'gcc', COMPILER: 'g++-4.4', CXXSTD: '98,0x' }, + { TOOLSET: 'gcc', COMPILER: 'g++-4.4', CXXSTD: '0x' }, "g++-4.4", [ "ppa:ubuntu-toolchain-r/test" ], ), @@ -107,7 +107,7 @@ local windows_pipeline(name, image, environment, arch = "amd64") = linux_pipeline( "Linux 14.04 GCC 4.6 32/64", "cppalliance/droneubuntu1404:1", - { TOOLSET: 'gcc', COMPILER: 'g++-4.6', CXXSTD: '98,0x', ADDRMD: '32,64' }, + { TOOLSET: 'gcc', COMPILER: 'g++-4.6', CXXSTD: '0x', ADDRMD: '32,64' }, "g++-4.6-multilib", [ "ppa:ubuntu-toolchain-r/test" ], ), @@ -115,7 +115,7 @@ local windows_pipeline(name, image, environment, arch = "amd64") = linux_pipeline( "Linux 14.04 GCC 4.7 32/64", "cppalliance/droneubuntu1404:1", - { TOOLSET: 'gcc', COMPILER: 'g++-4.7', CXXSTD: '98,0x', ADDRMD: '32,64' }, + { TOOLSET: 'gcc', COMPILER: 'g++-4.7', CXXSTD: '0x', ADDRMD: '32,64' }, "g++-4.7-multilib", [ "ppa:ubuntu-toolchain-r/test" ], ), @@ -123,13 +123,13 @@ local windows_pipeline(name, image, environment, arch = "amd64") = linux_pipeline( "Linux 14.04 GCC 4.8* 32/64", "cppalliance/droneubuntu1404:1", - { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11', ADDRMD: '32,64' }, + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11', ADDRMD: '32,64' }, ), linux_pipeline( "Linux 14.04 GCC 4.9 32/64", "cppalliance/droneubuntu1404:1", - { TOOLSET: 'gcc', COMPILER: 'g++-4.9', CXXSTD: '03,11', ADDRMD: '32,64' }, + { TOOLSET: 'gcc', COMPILER: 'g++-4.9', CXXSTD: '11', ADDRMD: '32,64' }, "g++-4.9-multilib", [ "ppa:ubuntu-toolchain-r/test" ], ), @@ -137,222 +137,222 @@ local windows_pipeline(name, image, environment, arch = "amd64") = linux_pipeline( "Linux 16.04 GCC 5* 32/64", "cppalliance/droneubuntu1604:1", - { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14', ADDRMD: '32,64' }, + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14', ADDRMD: '32,64' }, ), linux_pipeline( "Linux 18.04 GCC 6 32/64", "cppalliance/droneubuntu1804:1", - { TOOLSET: 'gcc', COMPILER: 'g++-6', CXXSTD: '03,11,14', ADDRMD: '32,64' }, + { TOOLSET: 'gcc', COMPILER: 'g++-6', CXXSTD: '11,14', ADDRMD: '32,64' }, "g++-6-multilib", ), linux_pipeline( "Linux 18.04 GCC 7* 32/64", "cppalliance/droneubuntu1804:1", - { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17', ADDRMD: '32,64' }, + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14,17', ADDRMD: '32,64' }, ), linux_pipeline( "Linux 18.04 GCC 8 32/64", "cppalliance/droneubuntu1804:1", - { TOOLSET: 'gcc', COMPILER: 'g++-8', CXXSTD: '03,11,14,17', ADDRMD: '32,64' }, + { TOOLSET: 'gcc', COMPILER: 'g++-8', CXXSTD: '11,14,17', ADDRMD: '32,64' }, "g++-8-multilib", ), linux_pipeline( "Linux 20.04 GCC 9* 32/64", "cppalliance/droneubuntu2004:1", - { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a', ADDRMD: '32,64' }, + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14,17,2a', ADDRMD: '32,64' }, ), linux_pipeline( "Linux 20.04 GCC 9* ARM64", "cppalliance/droneubuntu2004:multiarch", - { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a' }, + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14,17,2a' }, arch="arm64", ), linux_pipeline( "Linux 20.04 GCC 9* S390x", "cppalliance/droneubuntu2004:multiarch", - { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a' }, + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14,17,2a' }, arch="s390x", ), linux_pipeline( "Linux 20.04 GCC 10 32/64", "cppalliance/droneubuntu2004:1", - { TOOLSET: 'gcc', COMPILER: 'g++-10', CXXSTD: '03,11,14,17,20', ADDRMD: '32,64' }, + { TOOLSET: 'gcc', COMPILER: 'g++-10', CXXSTD: '11,14,17,20', ADDRMD: '32,64' }, "g++-10-multilib", ), linux_pipeline( "Linux 22.04 GCC 11* 32/64", "cppalliance/droneubuntu2204:1", - { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a', ADDRMD: '32,64' }, + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14,17,2a', ADDRMD: '32,64' }, ), linux_pipeline( "Linux 22.04 GCC 12 32 ASAN", "cppalliance/droneubuntu2204:1", - { TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '03,11,14,17,20,2b', ADDRMD: '32' } + asan, + { TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '11,14,17,20,2b', ADDRMD: '32' } + asan, "g++-12-multilib", ), linux_pipeline( "Linux 22.04 GCC 12 64 ASAN", "cppalliance/droneubuntu2204:1", - { TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '03,11,14,17,20,2b', ADDRMD: '64' } + asan, + { TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '11,14,17,20,2b', ADDRMD: '64' } + asan, "g++-12-multilib", ), linux_pipeline( "Linux 16.04 Clang 3.5", "cppalliance/droneubuntu1604:1", - { TOOLSET: 'clang', COMPILER: 'clang++-3.5', CXXSTD: '03,11' }, + { TOOLSET: 'clang', COMPILER: 'clang++-3.5', CXXSTD: '11' }, "clang-3.5", ), linux_pipeline( "Linux 16.04 Clang 3.6", "cppalliance/droneubuntu1604:1", - { TOOLSET: 'clang', COMPILER: 'clang++-3.6', CXXSTD: '03,11,14' }, + { TOOLSET: 'clang', COMPILER: 'clang++-3.6', CXXSTD: '11,14' }, "clang-3.6", ), linux_pipeline( "Linux 16.04 Clang 3.7", "cppalliance/droneubuntu1604:1", - { TOOLSET: 'clang', COMPILER: 'clang++-3.7', CXXSTD: '03,11,14' }, + { TOOLSET: 'clang', COMPILER: 'clang++-3.7', CXXSTD: '11,14' }, "clang-3.7", ), linux_pipeline( "Linux 16.04 Clang 3.8", "cppalliance/droneubuntu1604:1", - { TOOLSET: 'clang', COMPILER: 'clang++-3.8', CXXSTD: '03,11,14' }, + { TOOLSET: 'clang', COMPILER: 'clang++-3.8', CXXSTD: '11,14' }, "clang-3.8", ), linux_pipeline( "Linux 18.04 Clang 3.9", "cppalliance/droneubuntu1804:1", - { TOOLSET: 'clang', COMPILER: 'clang++-3.9', CXXSTD: '03,11,14' }, + { TOOLSET: 'clang', COMPILER: 'clang++-3.9', CXXSTD: '11,14' }, "clang-3.9", ), linux_pipeline( "Linux 18.04 Clang 4.0", "cppalliance/droneubuntu1804:1", - { TOOLSET: 'clang', COMPILER: 'clang++-4.0', CXXSTD: '03,11,14' }, + { TOOLSET: 'clang', COMPILER: 'clang++-4.0', CXXSTD: '11,14' }, "clang-4.0", ), linux_pipeline( "Linux 18.04 Clang 5.0", "cppalliance/droneubuntu1804:1", - { TOOLSET: 'clang', COMPILER: 'clang++-5.0', CXXSTD: '03,11,14,1z' }, + { TOOLSET: 'clang', COMPILER: 'clang++-5.0', CXXSTD: '11,14,1z' }, "clang-5.0", ), linux_pipeline( "Linux 18.04 Clang 6.0", "cppalliance/droneubuntu1804:1", - { TOOLSET: 'clang', COMPILER: 'clang++-6.0', CXXSTD: '03,11,14,17' }, + { TOOLSET: 'clang', COMPILER: 'clang++-6.0', CXXSTD: '11,14,17' }, "clang-6.0", ), linux_pipeline( "Linux 20.04 Clang 7", "cppalliance/droneubuntu2004:1", - { TOOLSET: 'clang', COMPILER: 'clang++-7', CXXSTD: '03,11,14,17' }, + { TOOLSET: 'clang', COMPILER: 'clang++-7', CXXSTD: '11,14,17' }, "clang-7", ), linux_pipeline( "Linux 20.04 Clang 8", "cppalliance/droneubuntu2004:1", - { TOOLSET: 'clang', COMPILER: 'clang++-8', CXXSTD: '03,11,14,17' }, + { TOOLSET: 'clang', COMPILER: 'clang++-8', CXXSTD: '11,14,17' }, "clang-8", ), linux_pipeline( "Linux 20.04 Clang 9", "cppalliance/droneubuntu2004:1", - { TOOLSET: 'clang', COMPILER: 'clang++-9', CXXSTD: '03,11,14,17,2a' }, + { TOOLSET: 'clang', COMPILER: 'clang++-9', CXXSTD: '11,14,17,2a' }, "clang-9", ), linux_pipeline( "Linux 20.04 Clang 10", "cppalliance/droneubuntu2004:1", - { TOOLSET: 'clang', COMPILER: 'clang++-10', CXXSTD: '03,11,14,17,2a' }, + { TOOLSET: 'clang', COMPILER: 'clang++-10', CXXSTD: '11,14,17,2a' }, "clang-10", ), linux_pipeline( "Linux 20.04 Clang 11", "cppalliance/droneubuntu2004:1", - { TOOLSET: 'clang', COMPILER: 'clang++-11', CXXSTD: '03,11,14,17,2a' }, + { TOOLSET: 'clang', COMPILER: 'clang++-11', CXXSTD: '11,14,17,2a' }, "clang-11", ), linux_pipeline( "Linux 20.04 Clang 12", "cppalliance/droneubuntu2004:1", - { TOOLSET: 'clang', COMPILER: 'clang++-12', CXXSTD: '03,11,14,17,2a' }, + { TOOLSET: 'clang', COMPILER: 'clang++-12', CXXSTD: '11,14,17,2a' }, "clang-12", ), linux_pipeline( "Linux 22.04 Clang 13", "cppalliance/droneubuntu2204:1", - { TOOLSET: 'clang', COMPILER: 'clang++-13', CXXSTD: '03,11,14,17,20' }, + { TOOLSET: 'clang', COMPILER: 'clang++-13', CXXSTD: '11,14,17,20' }, "clang-13", ), linux_pipeline( "Linux 22.04 Clang 14 UBSAN", "cppalliance/droneubuntu2204:1", - { TOOLSET: 'clang', COMPILER: 'clang++-14', CXXSTD: '03,11,14,17,20,2b' } + ubsan, + { TOOLSET: 'clang', COMPILER: 'clang++-14', CXXSTD: '11,14,17,20,2b' } + ubsan, "clang-14", ), linux_pipeline( "Linux 22.04 Clang 14 ASAN", "cppalliance/droneubuntu2204:1", - { TOOLSET: 'clang', COMPILER: 'clang++-14', CXXSTD: '03,11,14,17,20,2b' } + asan, + { TOOLSET: 'clang', COMPILER: 'clang++-14', CXXSTD: '11,14,17,20,2b' } + asan, "clang-14", ), linux_pipeline( "Linux 22.04 Clang 15", "cppalliance/droneubuntu2204:1", - { TOOLSET: 'clang', COMPILER: 'clang++-15', CXXSTD: '03,11,14,17,20,2b' }, + { TOOLSET: 'clang', COMPILER: 'clang++-15', CXXSTD: '11,14,17,20,2b' }, "clang-15", ["deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main"], ), macos_pipeline( "MacOS 10.15 Xcode 12.2 UBSAN", - { TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,17,2a' } + ubsan, + { TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '11,14,17,2a' } + ubsan, ), macos_pipeline( "MacOS 10.15 Xcode 12.2 ASAN", - { TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,17,2a' } + asan, + { TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '11,14,17,2a' } + asan, ), macos_pipeline( "MacOS 12.4 Xcode 13.4.1 UBSAN", - { TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,17,20,2b' } + ubsan, + { TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '11,14,17,20,2b' } + ubsan, xcode_version = "13.4.1", osx_version = "monterey", arch = "arm64", ), macos_pipeline( "MacOS 12.4 Xcode 13.4.1 ASAN", - { TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,17,20,2b' } + asan, + { TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '11,14,17,20,2b' } + asan, xcode_version = "13.4.1", osx_version = "monterey", arch = "arm64", ), diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53c7f5d6..94c4cd1b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,138 +18,138 @@ jobs: matrix: include: - toolset: gcc-4.8 - cxxstd: "03,11" + cxxstd: "11" os: ubuntu-latest container: ubuntu:18.04 install: g++-4.8-multilib address-model: 32,64 - toolset: gcc-5 - cxxstd: "03,11,14,1z" + cxxstd: "11,14,1z" os: ubuntu-latest container: ubuntu:18.04 install: g++-5-multilib address-model: 32,64 - toolset: gcc-6 - cxxstd: "03,11,14,1z" + cxxstd: "11,14,1z" os: ubuntu-latest container: ubuntu:18.04 install: g++-6-multilib address-model: 32,64 - toolset: gcc-7 - cxxstd: "03,11,14,17" + cxxstd: "11,14,17" os: ubuntu-20.04 install: g++-7-multilib address-model: 32,64 - toolset: gcc-8 - cxxstd: "03,11,14,17,2a" + cxxstd: "11,14,17,2a" os: ubuntu-20.04 install: g++-8-multilib address-model: 32,64 - toolset: gcc-9 - cxxstd: "03,11,14,17,2a" + cxxstd: "11,14,17,2a" os: ubuntu-20.04 install: g++-9-multilib address-model: 32,64 - toolset: gcc-10 - cxxstd: "03,11,14,17,2a" + cxxstd: "11,14,17,2a" os: ubuntu-20.04 install: g++-10-multilib address-model: 32,64 - toolset: gcc-11 - cxxstd: "03,11,14,17,20,2b" + cxxstd: "11,14,17,20,2b" os: ubuntu-22.04 install: g++-11-multilib address-model: 32,64 - toolset: gcc-12 - cxxstd: "03,11,14,17,20,2b" + cxxstd: "11,14,17,20,2b" os: ubuntu-22.04 install: g++-12-multilib address-model: 32,64 - toolset: gcc-13 - cxxstd: "03,11,14,17,20,2b" + cxxstd: "11,14,17,20,2b" os: ubuntu-latest container: ubuntu:23.04 install: g++-13-multilib address-model: 32,64 - toolset: clang compiler: clang++-3.9 - cxxstd: "03,11,14" + cxxstd: "11,14" os: ubuntu-latest container: ubuntu:18.04 install: clang-3.9 - toolset: clang compiler: clang++-4.0 - cxxstd: "03,11,14" + cxxstd: "11,14" os: ubuntu-latest container: ubuntu:18.04 install: clang-4.0 - toolset: clang compiler: clang++-5.0 - cxxstd: "03,11,14,1z" + cxxstd: "11,14,1z" os: ubuntu-latest container: ubuntu:18.04 install: clang-5.0 - toolset: clang compiler: clang++-6.0 - cxxstd: "03,11,14,17" + cxxstd: "11,14,17" os: ubuntu-20.04 install: clang-6.0 - toolset: clang compiler: clang++-7 - cxxstd: "03,11,14,17" + cxxstd: "11,14,17" os: ubuntu-20.04 install: clang-7 - toolset: clang compiler: clang++-8 - cxxstd: "03,11,14,17" + cxxstd: "11,14,17" os: ubuntu-20.04 install: clang-8 - toolset: clang compiler: clang++-9 - cxxstd: "03,11,14,17" + cxxstd: "11,14,17" os: ubuntu-20.04 install: clang-9 - toolset: clang compiler: clang++-10 - cxxstd: "03,11,14,17,2a" + cxxstd: "11,14,17,2a" os: ubuntu-20.04 - toolset: clang compiler: clang++-11 - cxxstd: "03,11,14,17,2a" + cxxstd: "11,14,17,2a" os: ubuntu-20.04 - toolset: clang compiler: clang++-12 - cxxstd: "03,11,14,17,20" + cxxstd: "11,14,17,20" os: ubuntu-20.04 - toolset: clang compiler: clang++-13 - cxxstd: "03,11,14,17,20" + cxxstd: "11,14,17,20" os: ubuntu-22.04 install: clang-13 - toolset: clang compiler: clang++-14 - cxxstd: "03,11,14,17,20,2b" + cxxstd: "11,14,17,20,2b" os: ubuntu-22.04 install: clang-14 - toolset: clang compiler: clang++-15 - cxxstd: "03,11,14,17,20,2b" + cxxstd: "11,14,17,20,2b" os: ubuntu-22.04 install: clang-15 - toolset: clang compiler: clang++-16 - cxxstd: "03,11,14,17,20,2b" + cxxstd: "11,14,17,20,2b" os: ubuntu-latest container: ubuntu:23.04 install: clang-16 - toolset: clang - cxxstd: "03,11,14,17,2a" + cxxstd: "11,14,17,2a" os: macos-11 - toolset: clang - cxxstd: "03,11,14,17,20,2b" + cxxstd: "11,14,17,20,2b" os: macos-12 - toolset: clang - cxxstd: "03,11,14,17,20,2b" + cxxstd: "11,14,17,20,2b" os: macos-13 runs-on: ${{matrix.os}} @@ -229,7 +229,7 @@ jobs: addrmd: 32,64 os: windows-2022 - toolset: gcc - cxxstd: "03,11,14,17,2a" + cxxstd: "11,14,17,2a" addrmd: 64 os: windows-2019 diff --git a/appveyor.yml b/appveyor.yml index 95434c73..55404a90 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -14,9 +14,6 @@ branches: environment: matrix: - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLSET: msvc-10.0,msvc-11.0 - ADDRMD: 32 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 TOOLSET: msvc-12.0,msvc-14.0 ADDRMD: 32,64 @@ -35,19 +32,19 @@ environment: - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 ADDPATH: C:\cygwin\bin; TOOLSET: gcc - CXXSTD: 03,11,14,1z + CXXSTD: 11,14,1z - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 ADDPATH: C:\cygwin64\bin; TOOLSET: gcc - CXXSTD: 03,11,14,1z + CXXSTD: 11,14,1z - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 ADDPATH: C:\mingw\bin; TOOLSET: gcc - CXXSTD: 03,11,14,1z + CXXSTD: 11,14,1z - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 ADDPATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin; TOOLSET: gcc - CXXSTD: 03,11,14,1z + CXXSTD: 11,14,1z install: - set BOOST_BRANCH=develop From c96f9d68b4f22649017720f28499fb3766462ef2 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 10 Jan 2024 03:09:37 +0200 Subject: [PATCH 031/115] Remove C++03 tests --- test/Jamfile.v2 | 6 ------ 1 file changed, 6 deletions(-) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index b3c08b03..717a163e 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -57,9 +57,6 @@ lib mixed_cxxstd : mixed_cxxstd.cpp : shared:MIXED_CXXSTD_DYN_LINK run test_mixed_cxxstd.cpp mixed_cxxstd : : : shared : mixed_cxxstd_shared ; run test_mixed_cxxstd.cpp mixed_cxxstd : : : static : mixed_cxxstd_static ; -run test_mixed_cxxstd.cpp mixed_cxxstd/98 : : : shared : mixed_cxxstd_shared_98 ; -run test_mixed_cxxstd.cpp mixed_cxxstd/98 : : : static : mixed_cxxstd_static_98 ; - run test_mixed_cxxstd.cpp mixed_cxxstd/0x : : : shared : mixed_cxxstd_shared_0x ; run test_mixed_cxxstd.cpp mixed_cxxstd/0x : : : static : mixed_cxxstd_static_0x ; @@ -73,9 +70,6 @@ lib return_function : return_function.cpp : shared:RETURN_FUNCTION run test_return_function.cpp return_function : : : shared : return_function_shared ; run test_return_function.cpp return_function : : : static : return_function_static ; -run test_return_function.cpp return_function/98 : : : shared : return_function_shared_98 ; -run test_return_function.cpp return_function/98 : : : static : return_function_static_98 ; - run test_return_function.cpp return_function/0x : : : shared : return_function_shared_0x ; run test_return_function.cpp return_function/0x : : : static : return_function_static_0x ; From af53f1b672775e3894c8f6adf85fc9f9dcbbd132 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 10 Jan 2024 03:25:01 +0200 Subject: [PATCH 032/115] Update ci.yml --- .github/workflows/ci.yml | 45 +++++++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94c4cd1b..424af4f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,22 +17,34 @@ jobs: fail-fast: false matrix: include: + - toolset: gcc-4.7 + cxxstd: "0x" + container: ubuntu:16.04 + os: ubuntu-latest + install: g++-4.7-multilib + address-model: 32,64 - toolset: gcc-4.8 cxxstd: "11" + container: ubuntu:16.04 os: ubuntu-latest - container: ubuntu:18.04 install: g++-4.8-multilib address-model: 32,64 + - toolset: gcc-4.9 + cxxstd: "11" + container: ubuntu:16.04 + os: ubuntu-latest + install: g++-4.9-multilib + address-model: 32,64 - toolset: gcc-5 cxxstd: "11,14,1z" - os: ubuntu-latest container: ubuntu:18.04 + os: ubuntu-latest install: g++-5-multilib address-model: 32,64 - toolset: gcc-6 cxxstd: "11,14,1z" - os: ubuntu-latest container: ubuntu:18.04 + os: ubuntu-latest install: g++-6-multilib address-model: 32,64 - toolset: gcc-7 @@ -67,27 +79,27 @@ jobs: address-model: 32,64 - toolset: gcc-13 cxxstd: "11,14,17,20,2b" - os: ubuntu-latest container: ubuntu:23.04 + os: ubuntu-latest install: g++-13-multilib address-model: 32,64 - toolset: clang compiler: clang++-3.9 cxxstd: "11,14" - os: ubuntu-latest container: ubuntu:18.04 + os: ubuntu-latest install: clang-3.9 - toolset: clang compiler: clang++-4.0 cxxstd: "11,14" - os: ubuntu-latest container: ubuntu:18.04 + os: ubuntu-latest install: clang-4.0 - toolset: clang compiler: clang++-5.0 cxxstd: "11,14,1z" - os: ubuntu-latest container: ubuntu:18.04 + os: ubuntu-latest install: clang-5.0 - toolset: clang compiler: clang++-6.0 @@ -124,24 +136,33 @@ jobs: - toolset: clang compiler: clang++-13 cxxstd: "11,14,17,20" - os: ubuntu-22.04 + container: ubuntu:22.04 + os: ubuntu-latest install: clang-13 - toolset: clang compiler: clang++-14 cxxstd: "11,14,17,20,2b" - os: ubuntu-22.04 + container: ubuntu:22.04 + os: ubuntu-latest install: clang-14 - toolset: clang compiler: clang++-15 cxxstd: "11,14,17,20,2b" - os: ubuntu-22.04 + container: ubuntu:22.04 + os: ubuntu-latest install: clang-15 - toolset: clang compiler: clang++-16 cxxstd: "11,14,17,20,2b" - os: ubuntu-latest container: ubuntu:23.04 + os: ubuntu-latest install: clang-16 + - toolset: clang + compiler: clang++-17 + cxxstd: "11,14,17,20,2b" + container: ubuntu:23.10 + os: ubuntu-latest + install: clang-17 - toolset: clang cxxstd: "11,14,17,2a" os: macos-11 @@ -192,7 +213,7 @@ jobs: cd boost-root cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY git submodule update --init tools/boostdep - python3 tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY + python3 tools/boostdep/depinst/depinst.py $LIBRARY ./bootstrap.sh ./b2 -d0 headers From 42a16b084cbc82a67ba408965757f5407f25914a Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 10 Jan 2024 03:47:11 +0200 Subject: [PATCH 033/115] Update .drone.jsonnet --- .drone.jsonnet | 99 +++++++++++++++++++++++++++++--------------------- 1 file changed, 58 insertions(+), 41 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index f400dd79..26999e64 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -97,41 +97,24 @@ local windows_pipeline(name, image, environment, arch = "amd64") = [ linux_pipeline( - "Linux 14.04 GCC 4.4", - "cppalliance/droneubuntu1404:1", - { TOOLSET: 'gcc', COMPILER: 'g++-4.4', CXXSTD: '0x' }, - "g++-4.4", - [ "ppa:ubuntu-toolchain-r/test" ], - ), - - linux_pipeline( - "Linux 14.04 GCC 4.6 32/64", - "cppalliance/droneubuntu1404:1", - { TOOLSET: 'gcc', COMPILER: 'g++-4.6', CXXSTD: '0x', ADDRMD: '32,64' }, - "g++-4.6-multilib", - [ "ppa:ubuntu-toolchain-r/test" ], - ), - - linux_pipeline( - "Linux 14.04 GCC 4.7 32/64", - "cppalliance/droneubuntu1404:1", + "Linux 16.04 GCC 4.7 32/64", + "cppalliance/droneubuntu1604:1", { TOOLSET: 'gcc', COMPILER: 'g++-4.7', CXXSTD: '0x', ADDRMD: '32,64' }, "g++-4.7-multilib", - [ "ppa:ubuntu-toolchain-r/test" ], ), linux_pipeline( - "Linux 14.04 GCC 4.8* 32/64", - "cppalliance/droneubuntu1404:1", + "Linux 16.04 GCC 4.8 32/64", + "cppalliance/droneubuntu1604:1", { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11', ADDRMD: '32,64' }, + "g++-4.8-multilib", ), linux_pipeline( - "Linux 14.04 GCC 4.9 32/64", - "cppalliance/droneubuntu1404:1", + "Linux 16.04 GCC 4.9 32/64", + "cppalliance/droneubuntu1604:1", { TOOLSET: 'gcc', COMPILER: 'g++-4.9', CXXSTD: '11', ADDRMD: '32,64' }, "g++-4.9-multilib", - [ "ppa:ubuntu-toolchain-r/test" ], ), linux_pipeline( @@ -194,17 +177,38 @@ local windows_pipeline(name, image, environment, arch = "amd64") = ), linux_pipeline( - "Linux 22.04 GCC 12 32 ASAN", + "Linux 22.04 GCC 12 32/64", "cppalliance/droneubuntu2204:1", - { TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '11,14,17,20,2b', ADDRMD: '32' } + asan, + { TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '11,14,17,20,2b', ADDRMD: '32,64' }, "g++-12-multilib", ), linux_pipeline( - "Linux 22.04 GCC 12 64 ASAN", - "cppalliance/droneubuntu2204:1", - { TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '11,14,17,20,2b', ADDRMD: '64' } + asan, - "g++-12-multilib", + "Linux 23.04 GCC 13 32 ASAN", + "cppalliance/droneubuntu2304:1", + { TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '11,14,17,20,2b', ADDRMD: '32' } + asan, + "g++-13-multilib", + ), + + linux_pipeline( + "Linux 23.04 GCC 13 64 ASAN", + "cppalliance/droneubuntu2304:1", + { TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '11,14,17,20,2b', ADDRMD: '64' } + asan, + "g++-13-multilib", + ), + + linux_pipeline( + "Linux 23.04 GCC 13 32 UBSAN", + "cppalliance/droneubuntu2304:1", + { TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '11,14,17,20,2b', ADDRMD: '32' } + ubsan, + "g++-13-multilib", + ), + + linux_pipeline( + "Linux 23.04 GCC 13 64 UBSAN", + "cppalliance/droneubuntu2304:1", + { TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '11,14,17,20,2b', ADDRMD: '64' } + ubsan, + "g++-13-multilib", ), linux_pipeline( @@ -313,16 +317,9 @@ local windows_pipeline(name, image, environment, arch = "amd64") = ), linux_pipeline( - "Linux 22.04 Clang 14 UBSAN", + "Linux 22.04 Clang 14", "cppalliance/droneubuntu2204:1", - { TOOLSET: 'clang', COMPILER: 'clang++-14', CXXSTD: '11,14,17,20,2b' } + ubsan, - "clang-14", - ), - - linux_pipeline( - "Linux 22.04 Clang 14 ASAN", - "cppalliance/droneubuntu2204:1", - { TOOLSET: 'clang', COMPILER: 'clang++-14', CXXSTD: '11,14,17,20,2b' } + asan, + { TOOLSET: 'clang', COMPILER: 'clang++-14', CXXSTD: '11,14,17,20,2b' }, "clang-14", ), @@ -331,7 +328,27 @@ local windows_pipeline(name, image, environment, arch = "amd64") = "cppalliance/droneubuntu2204:1", { TOOLSET: 'clang', COMPILER: 'clang++-15', CXXSTD: '11,14,17,20,2b' }, "clang-15", - ["deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main"], + ), + + linux_pipeline( + "Linux 23.04 Clang 16", + "cppalliance/droneubuntu2304:1", + { TOOLSET: 'clang', COMPILER: 'clang++-16', CXXSTD: '11,14,17,20,2b' }, + "clang-16", + ), + + linux_pipeline( + "Linux 23.10 Clang 17 UBSAN", + "cppalliance/droneubuntu2310:1", + { TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '11,14,17,20,2b' } + ubsan, + "clang-17", + ), + + linux_pipeline( + "Linux 23.10 Clang 17 ASAN", + "cppalliance/droneubuntu2310:1", + { TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '11,14,17,20,2b' } + asan, + "clang-17", ), macos_pipeline( @@ -359,7 +376,7 @@ local windows_pipeline(name, image, environment, arch = "amd64") = windows_pipeline( "Windows VS2015 msvc-14.0", "cppalliance/dronevs2015", - { TOOLSET: 'msvc-14.0', CXXSTD: '14,latest' }, + { TOOLSET: 'msvc-14.0', CXXSTD: '14,latest', B2_DONT_EMBED_MANIFEST: '1' }, ), windows_pipeline( From 835e95f82f1b20fb9faaab64d8de02a4b2ee03dc Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 25 Jan 2024 04:54:52 +0200 Subject: [PATCH 034/115] Revert "Revert "Added variadic support"" This reverts commit 79045752e0426694e6b0456a9f79f22283ce8d35. --- include/boost/function.hpp | 4 +- .../boost/function/detail/maybe_include.hpp | 13 +++- include/boost/function/function_fwd.hpp | 16 +++++ include/boost/function/function_template.hpp | 70 ++++++++++++++++++- 4 files changed, 99 insertions(+), 4 deletions(-) diff --git a/include/boost/function.hpp b/include/boost/function.hpp index f6ee8820..8cb9f223 100644 --- a/include/boost/function.hpp +++ b/include/boost/function.hpp @@ -29,8 +29,10 @@ // in anything that may be included by function_template.hpp doesn't break #include +#ifndef BOOST_FUNCTION_NO_VARIADIC +# include // Older Visual Age C++ version do not handle the file iteration well -#if BOOST_WORKAROUND(__IBMCPP__, >= 500) && BOOST_WORKAROUND(__IBMCPP__, < 800) +#elif BOOST_WORKAROUND(__IBMCPP__, >= 500) && BOOST_WORKAROUND(__IBMCPP__, < 800) # if BOOST_FUNCTION_MAX_ARGS >= 0 # include # endif diff --git a/include/boost/function/detail/maybe_include.hpp b/include/boost/function/detail/maybe_include.hpp index ec88905d..df7eb7a7 100644 --- a/include/boost/function/detail/maybe_include.hpp +++ b/include/boost/function/detail/maybe_include.hpp @@ -7,7 +7,18 @@ // For more information, see http://www.boost.org -#if BOOST_FUNCTION_NUM_ARGS == 0 +#include // for BOOST_FUNCTION_NO_VARIADIC + +#ifndef BOOST_FUNCTION_NO_VARIADIC +# undef BOOST_FUNCTION_NUM_ARGS +# define BOOST_FUNCTION_NUM_ARGS 50 +# undef BOOST_FUNCTION_MAX_ARGS_DEFINED +# define BOOST_FUNCTION_MAX_ARGS_DEFINED 50 +# ifndef BOOST_FUNCTION_VARIADIC_INCLUDED +# define BOOST_FUNCTION_VARIADIC_INCLUDED +# include +# endif +#elif BOOST_FUNCTION_NUM_ARGS == 0 # undef BOOST_FUNCTION_MAX_ARGS_DEFINED # define BOOST_FUNCTION_MAX_ARGS_DEFINED 0 # ifndef BOOST_FUNCTION_0 diff --git a/include/boost/function/function_fwd.hpp b/include/boost/function/function_fwd.hpp index e79b5048..b31ec140 100644 --- a/include/boost/function/function_fwd.hpp +++ b/include/boost/function/function_fwd.hpp @@ -24,6 +24,12 @@ namespace boost { namespace python { namespace objects { # define BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX #endif +#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) +# define BOOST_FUNCTION_NO_VARIADIC +#else +# include // for functionN aliases generation below +#endif + namespace boost { class bad_function_call; @@ -38,6 +44,15 @@ namespace boost { } #endif // have partial specialization +#ifndef BOOST_FUNCTION_NO_VARIADIC + template class function_n; +# define BOOST_FUNCTION_N_ALIASES(z, N, d) \ + template \ + using function##N = function_n; + + BOOST_PP_REPEAT(51, BOOST_FUNCTION_N_ALIASES, ~) +# undef BOOST_FUNCTION_N_ALIASES +#else // Portable syntax template class function0; template class function1; @@ -64,6 +79,7 @@ namespace boost { typename T5, typename T6, typename T7, typename T8, typename T9, typename T10> class function10; +#endif } #endif diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 23814464..1f82152a 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -18,6 +18,39 @@ # pragma warning( disable : 4127 ) // "conditional expression is constant" #endif +#ifndef BOOST_FUNCTION_NO_VARIADIC + +#define BOOST_FUNCTION_TEMPLATE_PARMS typename... T +#define BOOST_FUNCTION_TEMPLATE_ARGS T... +#define BOOST_FUNCTION_PARMS T... a +#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES +# define BOOST_FUNCTION_ARGS a... +#else +# define BOOST_FUNCTION_ARGS static_cast(a)... +#endif + +// Always have commas (zero args case is handled with variadics too) +#define BOOST_FUNCTION_COMMA , + +// Class names used in this version of the code +#define BOOST_FUNCTION_FUNCTION function_n +#define BOOST_FUNCTION_FUNCTION_INVOKER function_invoker +#define BOOST_FUNCTION_VOID_FUNCTION_INVOKER void_function_invoker +#define BOOST_FUNCTION_FUNCTION_OBJ_INVOKER function_obj_invoker +#define BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER void_function_obj_invoker +#define BOOST_FUNCTION_FUNCTION_REF_INVOKER function_ref_invoker +#define BOOST_FUNCTION_VOID_FUNCTION_REF_INVOKER void_function_ref_invoker +#define BOOST_FUNCTION_MEMBER_INVOKER function_mem_invoker +#define BOOST_FUNCTION_VOID_MEMBER_INVOKER function_void_mem_invoker +#define BOOST_FUNCTION_GET_FUNCTION_INVOKER get_function_invoker +#define BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER get_function_obj_invoker +#define BOOST_FUNCTION_GET_FUNCTION_REF_INVOKER get_function_ref_invoker +#define BOOST_FUNCTION_GET_MEMBER_INVOKER get_member_invoker +#define BOOST_FUNCTION_GET_INVOKER get_invoker +#define BOOST_FUNCTION_VTABLE basic_vtable + +#else // BOOST_FUNCTION_NO_VARIADIC + #define BOOST_FUNCTION_TEMPLATE_PARMS BOOST_PP_ENUM_PARAMS(BOOST_FUNCTION_NUM_ARGS, typename T) #define BOOST_FUNCTION_TEMPLATE_ARGS BOOST_PP_ENUM_PARAMS(BOOST_FUNCTION_NUM_ARGS, T) @@ -75,6 +108,8 @@ BOOST_JOIN(get_invoker,BOOST_FUNCTION_NUM_ARGS) #define BOOST_FUNCTION_VTABLE BOOST_JOIN(basic_vtable,BOOST_FUNCTION_NUM_ARGS) +#endif // BOOST_FUNCTION_NO_VARIADIC + #ifndef BOOST_NO_VOID_RETURNS # define BOOST_FUNCTION_VOID_RETURN_TYPE void # define BOOST_FUNCTION_RETURN(X) X @@ -660,6 +695,26 @@ namespace boost { vtable_base base; invoker_type invoker; }; + +#ifndef BOOST_FUNCTION_NO_VARIADIC + template + struct variadic_function_base + {}; + + template + struct variadic_function_base + { + typedef T argument_type; + }; + + template + struct variadic_function_base + { + typedef T0 first_argument_type; + typedef T1 second_argument_type; + }; +#endif + } // end namespace function } // end namespace detail @@ -668,6 +723,9 @@ namespace boost { BOOST_FUNCTION_TEMPLATE_PARMS > class BOOST_FUNCTION_FUNCTION : public function_base +#ifndef BOOST_FUNCTION_NO_VARIADIC + , public detail::function::variadic_function_base +#endif { public: #ifndef BOOST_NO_VOID_RETURNS @@ -690,8 +748,6 @@ namespace boost { struct clear_type {}; public: - BOOST_STATIC_CONSTANT(int, args = BOOST_FUNCTION_NUM_ARGS); - // add signature for boost::lambda template struct sig @@ -699,6 +755,13 @@ namespace boost { typedef result_type type; }; +#ifndef BOOST_FUNCTION_NO_VARIADIC + + static int const args = sizeof...(T); + static int const arity = sizeof...(T); + +#else + #if BOOST_FUNCTION_NUM_ARGS == 1 typedef T0 argument_type; #elif BOOST_FUNCTION_NUM_ARGS == 2 @@ -706,9 +769,12 @@ namespace boost { typedef T1 second_argument_type; #endif + BOOST_STATIC_CONSTANT(int, args = BOOST_FUNCTION_NUM_ARGS); BOOST_STATIC_CONSTANT(int, arity = BOOST_FUNCTION_NUM_ARGS); BOOST_FUNCTION_ARG_TYPES +#endif + typedef BOOST_FUNCTION_FUNCTION self_type; BOOST_DEFAULTED_FUNCTION(BOOST_FUNCTION_FUNCTION(), : function_base() {}) From 86b7a7809ac0f9183deb58b99706c6f386c3d313 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 25 Jan 2024 05:06:41 +0200 Subject: [PATCH 035/115] Remove BOOST_FUNCTION_NO_VARIADIC code portions --- include/boost/function.hpp | 44 +-- .../boost/function/detail/maybe_include.hpp | 367 +----------------- include/boost/function/function_fwd.hpp | 75 ++-- include/boost/function/function_template.hpp | 87 +---- 4 files changed, 39 insertions(+), 534 deletions(-) diff --git a/include/boost/function.hpp b/include/boost/function.hpp index 8cb9f223..48fd523f 100644 --- a/include/boost/function.hpp +++ b/include/boost/function.hpp @@ -29,49 +29,7 @@ // in anything that may be included by function_template.hpp doesn't break #include -#ifndef BOOST_FUNCTION_NO_VARIADIC -# include -// Older Visual Age C++ version do not handle the file iteration well -#elif BOOST_WORKAROUND(__IBMCPP__, >= 500) && BOOST_WORKAROUND(__IBMCPP__, < 800) -# if BOOST_FUNCTION_MAX_ARGS >= 0 -# include -# endif -# if BOOST_FUNCTION_MAX_ARGS >= 1 -# include -# endif -# if BOOST_FUNCTION_MAX_ARGS >= 2 -# include -# endif -# if BOOST_FUNCTION_MAX_ARGS >= 3 -# include -# endif -# if BOOST_FUNCTION_MAX_ARGS >= 4 -# include -# endif -# if BOOST_FUNCTION_MAX_ARGS >= 5 -# include -# endif -# if BOOST_FUNCTION_MAX_ARGS >= 6 -# include -# endif -# if BOOST_FUNCTION_MAX_ARGS >= 7 -# include -# endif -# if BOOST_FUNCTION_MAX_ARGS >= 8 -# include -# endif -# if BOOST_FUNCTION_MAX_ARGS >= 9 -# include -# endif -# if BOOST_FUNCTION_MAX_ARGS >= 10 -# include -# endif -#else -// What is the '3' for? -# define BOOST_PP_ITERATION_PARAMS_1 (3,(0,BOOST_FUNCTION_MAX_ARGS,)) -# include BOOST_PP_ITERATE() -# undef BOOST_PP_ITERATION_PARAMS_1 -#endif +#include #include diff --git a/include/boost/function/detail/maybe_include.hpp b/include/boost/function/detail/maybe_include.hpp index df7eb7a7..e34e8256 100644 --- a/include/boost/function/detail/maybe_include.hpp +++ b/include/boost/function/detail/maybe_include.hpp @@ -7,374 +7,11 @@ // For more information, see http://www.boost.org -#include // for BOOST_FUNCTION_NO_VARIADIC - -#ifndef BOOST_FUNCTION_NO_VARIADIC # undef BOOST_FUNCTION_NUM_ARGS -# define BOOST_FUNCTION_NUM_ARGS 50 +# define BOOST_FUNCTION_NUM_ARGS 30 # undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 50 +# define BOOST_FUNCTION_MAX_ARGS_DEFINED 30 # ifndef BOOST_FUNCTION_VARIADIC_INCLUDED # define BOOST_FUNCTION_VARIADIC_INCLUDED # include # endif -#elif BOOST_FUNCTION_NUM_ARGS == 0 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 0 -# ifndef BOOST_FUNCTION_0 -# define BOOST_FUNCTION_0 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 1 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 1 -# ifndef BOOST_FUNCTION_1 -# define BOOST_FUNCTION_1 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 2 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 2 -# ifndef BOOST_FUNCTION_2 -# define BOOST_FUNCTION_2 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 3 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 3 -# ifndef BOOST_FUNCTION_3 -# define BOOST_FUNCTION_3 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 4 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 4 -# ifndef BOOST_FUNCTION_4 -# define BOOST_FUNCTION_4 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 5 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 5 -# ifndef BOOST_FUNCTION_5 -# define BOOST_FUNCTION_5 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 6 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 6 -# ifndef BOOST_FUNCTION_6 -# define BOOST_FUNCTION_6 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 7 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 7 -# ifndef BOOST_FUNCTION_7 -# define BOOST_FUNCTION_7 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 8 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 8 -# ifndef BOOST_FUNCTION_8 -# define BOOST_FUNCTION_8 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 9 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 9 -# ifndef BOOST_FUNCTION_9 -# define BOOST_FUNCTION_9 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 10 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 10 -# ifndef BOOST_FUNCTION_10 -# define BOOST_FUNCTION_10 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 11 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 11 -# ifndef BOOST_FUNCTION_11 -# define BOOST_FUNCTION_11 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 12 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 12 -# ifndef BOOST_FUNCTION_12 -# define BOOST_FUNCTION_12 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 13 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 13 -# ifndef BOOST_FUNCTION_13 -# define BOOST_FUNCTION_13 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 14 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 14 -# ifndef BOOST_FUNCTION_14 -# define BOOST_FUNCTION_14 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 15 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 15 -# ifndef BOOST_FUNCTION_15 -# define BOOST_FUNCTION_15 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 16 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 16 -# ifndef BOOST_FUNCTION_16 -# define BOOST_FUNCTION_16 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 17 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 17 -# ifndef BOOST_FUNCTION_17 -# define BOOST_FUNCTION_17 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 18 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 18 -# ifndef BOOST_FUNCTION_18 -# define BOOST_FUNCTION_18 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 19 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 19 -# ifndef BOOST_FUNCTION_19 -# define BOOST_FUNCTION_19 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 20 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 20 -# ifndef BOOST_FUNCTION_20 -# define BOOST_FUNCTION_20 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 21 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 21 -# ifndef BOOST_FUNCTION_21 -# define BOOST_FUNCTION_21 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 22 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 22 -# ifndef BOOST_FUNCTION_22 -# define BOOST_FUNCTION_22 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 23 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 23 -# ifndef BOOST_FUNCTION_23 -# define BOOST_FUNCTION_23 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 24 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 24 -# ifndef BOOST_FUNCTION_24 -# define BOOST_FUNCTION_24 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 25 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 25 -# ifndef BOOST_FUNCTION_25 -# define BOOST_FUNCTION_25 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 26 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 26 -# ifndef BOOST_FUNCTION_26 -# define BOOST_FUNCTION_26 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 27 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 27 -# ifndef BOOST_FUNCTION_27 -# define BOOST_FUNCTION_27 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 28 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 28 -# ifndef BOOST_FUNCTION_28 -# define BOOST_FUNCTION_28 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 29 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 29 -# ifndef BOOST_FUNCTION_29 -# define BOOST_FUNCTION_29 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 30 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 30 -# ifndef BOOST_FUNCTION_30 -# define BOOST_FUNCTION_30 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 31 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 31 -# ifndef BOOST_FUNCTION_31 -# define BOOST_FUNCTION_31 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 32 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 32 -# ifndef BOOST_FUNCTION_32 -# define BOOST_FUNCTION_32 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 33 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 33 -# ifndef BOOST_FUNCTION_33 -# define BOOST_FUNCTION_33 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 34 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 34 -# ifndef BOOST_FUNCTION_34 -# define BOOST_FUNCTION_34 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 35 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 35 -# ifndef BOOST_FUNCTION_35 -# define BOOST_FUNCTION_35 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 36 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 36 -# ifndef BOOST_FUNCTION_36 -# define BOOST_FUNCTION_36 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 37 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 37 -# ifndef BOOST_FUNCTION_37 -# define BOOST_FUNCTION_37 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 38 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 38 -# ifndef BOOST_FUNCTION_38 -# define BOOST_FUNCTION_38 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 39 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 39 -# ifndef BOOST_FUNCTION_39 -# define BOOST_FUNCTION_39 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 40 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 40 -# ifndef BOOST_FUNCTION_40 -# define BOOST_FUNCTION_40 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 41 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 41 -# ifndef BOOST_FUNCTION_41 -# define BOOST_FUNCTION_41 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 42 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 42 -# ifndef BOOST_FUNCTION_42 -# define BOOST_FUNCTION_42 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 43 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 43 -# ifndef BOOST_FUNCTION_43 -# define BOOST_FUNCTION_43 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 44 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 44 -# ifndef BOOST_FUNCTION_44 -# define BOOST_FUNCTION_44 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 45 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 45 -# ifndef BOOST_FUNCTION_45 -# define BOOST_FUNCTION_45 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 46 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 46 -# ifndef BOOST_FUNCTION_46 -# define BOOST_FUNCTION_46 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 47 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 47 -# ifndef BOOST_FUNCTION_47 -# define BOOST_FUNCTION_47 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 48 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 48 -# ifndef BOOST_FUNCTION_48 -# define BOOST_FUNCTION_48 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 49 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 49 -# ifndef BOOST_FUNCTION_49 -# define BOOST_FUNCTION_49 -# include -# endif -#elif BOOST_FUNCTION_NUM_ARGS == 50 -# undef BOOST_FUNCTION_MAX_ARGS_DEFINED -# define BOOST_FUNCTION_MAX_ARGS_DEFINED 50 -# ifndef BOOST_FUNCTION_50 -# define BOOST_FUNCTION_50 -# include -# endif -#else -# error Cannot handle Boost.Function objects that accept more than 50 arguments! -#endif diff --git a/include/boost/function/function_fwd.hpp b/include/boost/function/function_fwd.hpp index b31ec140..01e2fc0e 100644 --- a/include/boost/function/function_fwd.hpp +++ b/include/boost/function/function_fwd.hpp @@ -24,12 +24,6 @@ namespace boost { namespace python { namespace objects { # define BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX #endif -#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) -# define BOOST_FUNCTION_NO_VARIADIC -#else -# include // for functionN aliases generation below -#endif - namespace boost { class bad_function_call; @@ -44,42 +38,43 @@ namespace boost { } #endif // have partial specialization -#ifndef BOOST_FUNCTION_NO_VARIADIC + // Portable syntax template class function_n; -# define BOOST_FUNCTION_N_ALIASES(z, N, d) \ - template \ - using function##N = function_n; - BOOST_PP_REPEAT(51, BOOST_FUNCTION_N_ALIASES, ~) -# undef BOOST_FUNCTION_N_ALIASES -#else - // Portable syntax - template class function0; - template class function1; - template class function2; - template class function3; - template - class function4; - template - class function5; - template - class function6; - template - class function7; - template - class function8; - template - class function9; - template - class function10; -#endif + template using function0 = function_n; + template using function1 = function_n; + template using function2 = function_n; + template using function3 = function_n; + template using function4 = function_n; + template using function5 = function_n; + template using function6 = function_n; + template using function7 = function_n; + template using function8 = function_n; + template using function9 = function_n; + + template using function10 = function_n; + template using function11 = function_n; + template using function12 = function_n; + template using function13 = function_n; + template using function14 = function_n; + template using function15 = function_n; + template using function16 = function_n; + template using function17 = function_n; + template using function18 = function_n; + template using function19 = function_n; + + template using function20 = function_n; + template using function21 = function_n; + template using function22 = function_n; + template using function23 = function_n; + template using function24 = function_n; + template using function25 = function_n; + template using function26 = function_n; + template using function27 = function_n; + template using function28 = function_n; + template using function29 = function_n; + + template using function30 = function_n; } #endif diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 1f82152a..90f6118d 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -18,8 +18,6 @@ # pragma warning( disable : 4127 ) // "conditional expression is constant" #endif -#ifndef BOOST_FUNCTION_NO_VARIADIC - #define BOOST_FUNCTION_TEMPLATE_PARMS typename... T #define BOOST_FUNCTION_TEMPLATE_ARGS T... #define BOOST_FUNCTION_PARMS T... a @@ -49,67 +47,6 @@ #define BOOST_FUNCTION_GET_INVOKER get_invoker #define BOOST_FUNCTION_VTABLE basic_vtable -#else // BOOST_FUNCTION_NO_VARIADIC - -#define BOOST_FUNCTION_TEMPLATE_PARMS BOOST_PP_ENUM_PARAMS(BOOST_FUNCTION_NUM_ARGS, typename T) - -#define BOOST_FUNCTION_TEMPLATE_ARGS BOOST_PP_ENUM_PARAMS(BOOST_FUNCTION_NUM_ARGS, T) - -#define BOOST_FUNCTION_PARM(J,I,D) BOOST_PP_CAT(T,I) BOOST_PP_CAT(a,I) - -#define BOOST_FUNCTION_PARMS BOOST_PP_ENUM(BOOST_FUNCTION_NUM_ARGS,BOOST_FUNCTION_PARM,BOOST_PP_EMPTY) - -#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES -# define BOOST_FUNCTION_ARGS BOOST_PP_ENUM_PARAMS(BOOST_FUNCTION_NUM_ARGS, a) -#else -# define BOOST_FUNCTION_ARG(J,I,D) static_cast(BOOST_PP_CAT(a,I)) -# define BOOST_FUNCTION_ARGS BOOST_PP_ENUM(BOOST_FUNCTION_NUM_ARGS,BOOST_FUNCTION_ARG,BOOST_PP_EMPTY) -#endif - -#define BOOST_FUNCTION_ARG_TYPE(J,I,D) \ - typedef BOOST_PP_CAT(T,I) BOOST_PP_CAT(BOOST_PP_CAT(arg, BOOST_PP_INC(I)),_type); - -#define BOOST_FUNCTION_ARG_TYPES BOOST_PP_REPEAT(BOOST_FUNCTION_NUM_ARGS,BOOST_FUNCTION_ARG_TYPE,BOOST_PP_EMPTY) - -// Comma if nonzero number of arguments -#if BOOST_FUNCTION_NUM_ARGS == 0 -# define BOOST_FUNCTION_COMMA -#else -# define BOOST_FUNCTION_COMMA , -#endif // BOOST_FUNCTION_NUM_ARGS > 0 - -// Class names used in this version of the code -#define BOOST_FUNCTION_FUNCTION BOOST_JOIN(function,BOOST_FUNCTION_NUM_ARGS) -#define BOOST_FUNCTION_FUNCTION_INVOKER \ - BOOST_JOIN(function_invoker,BOOST_FUNCTION_NUM_ARGS) -#define BOOST_FUNCTION_VOID_FUNCTION_INVOKER \ - BOOST_JOIN(void_function_invoker,BOOST_FUNCTION_NUM_ARGS) -#define BOOST_FUNCTION_FUNCTION_OBJ_INVOKER \ - BOOST_JOIN(function_obj_invoker,BOOST_FUNCTION_NUM_ARGS) -#define BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER \ - BOOST_JOIN(void_function_obj_invoker,BOOST_FUNCTION_NUM_ARGS) -#define BOOST_FUNCTION_FUNCTION_REF_INVOKER \ - BOOST_JOIN(function_ref_invoker,BOOST_FUNCTION_NUM_ARGS) -#define BOOST_FUNCTION_VOID_FUNCTION_REF_INVOKER \ - BOOST_JOIN(void_function_ref_invoker,BOOST_FUNCTION_NUM_ARGS) -#define BOOST_FUNCTION_MEMBER_INVOKER \ - BOOST_JOIN(function_mem_invoker,BOOST_FUNCTION_NUM_ARGS) -#define BOOST_FUNCTION_VOID_MEMBER_INVOKER \ - BOOST_JOIN(function_void_mem_invoker,BOOST_FUNCTION_NUM_ARGS) -#define BOOST_FUNCTION_GET_FUNCTION_INVOKER \ - BOOST_JOIN(get_function_invoker,BOOST_FUNCTION_NUM_ARGS) -#define BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER \ - BOOST_JOIN(get_function_obj_invoker,BOOST_FUNCTION_NUM_ARGS) -#define BOOST_FUNCTION_GET_FUNCTION_REF_INVOKER \ - BOOST_JOIN(get_function_ref_invoker,BOOST_FUNCTION_NUM_ARGS) -#define BOOST_FUNCTION_GET_MEMBER_INVOKER \ - BOOST_JOIN(get_member_invoker,BOOST_FUNCTION_NUM_ARGS) -#define BOOST_FUNCTION_GET_INVOKER \ - BOOST_JOIN(get_invoker,BOOST_FUNCTION_NUM_ARGS) -#define BOOST_FUNCTION_VTABLE BOOST_JOIN(basic_vtable,BOOST_FUNCTION_NUM_ARGS) - -#endif // BOOST_FUNCTION_NO_VARIADIC - #ifndef BOOST_NO_VOID_RETURNS # define BOOST_FUNCTION_VOID_RETURN_TYPE void # define BOOST_FUNCTION_RETURN(X) X @@ -696,7 +633,6 @@ namespace boost { invoker_type invoker; }; -#ifndef BOOST_FUNCTION_NO_VARIADIC template struct variadic_function_base {}; @@ -713,7 +649,6 @@ namespace boost { typedef T0 first_argument_type; typedef T1 second_argument_type; }; -#endif } // end namespace function } // end namespace detail @@ -723,9 +658,7 @@ namespace boost { BOOST_FUNCTION_TEMPLATE_PARMS > class BOOST_FUNCTION_FUNCTION : public function_base -#ifndef BOOST_FUNCTION_NO_VARIADIC , public detail::function::variadic_function_base -#endif { public: #ifndef BOOST_NO_VOID_RETURNS @@ -755,25 +688,7 @@ namespace boost { typedef result_type type; }; -#ifndef BOOST_FUNCTION_NO_VARIADIC - - static int const args = sizeof...(T); - static int const arity = sizeof...(T); - -#else - -#if BOOST_FUNCTION_NUM_ARGS == 1 - typedef T0 argument_type; -#elif BOOST_FUNCTION_NUM_ARGS == 2 - typedef T0 first_argument_type; - typedef T1 second_argument_type; -#endif - - BOOST_STATIC_CONSTANT(int, args = BOOST_FUNCTION_NUM_ARGS); - BOOST_STATIC_CONSTANT(int, arity = BOOST_FUNCTION_NUM_ARGS); - BOOST_FUNCTION_ARG_TYPES - -#endif + BOOST_STATIC_CONSTANT(int, arity = sizeof...(T)); typedef BOOST_FUNCTION_FUNCTION self_type; From c4237534916fa830cc597f17dd24104a38f76a06 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 25 Jan 2024 05:28:17 +0200 Subject: [PATCH 036/115] Remove unnecessary includes --- include/boost/function.hpp | 9 --------- include/boost/function/detail/prologue.hpp | 14 ++++---------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/include/boost/function.hpp b/include/boost/function.hpp index 48fd523f..d71264c5 100644 --- a/include/boost/function.hpp +++ b/include/boost/function.hpp @@ -20,17 +20,8 @@ #define BOOST_FUNCTION_MAX_ARGS_DEFINED 0 #endif -#include // unary_function, binary_function - -#include -#include - -// Include the prologue here so that the use of file-level iteration -// in anything that may be included by function_template.hpp doesn't break #include - #include - #include #endif // !defined(BOOST_FUNCTION_MAX_ARGS_DEFINED) || (BOOST_FUNCTION_MAX_ARGS_DEFINED != BOOST_FUNCTION_MAX_ARGS) diff --git a/include/boost/function/detail/prologue.hpp b/include/boost/function/detail/prologue.hpp index 2edebe06..2af12b8c 100644 --- a/include/boost/function/detail/prologue.hpp +++ b/include/boost/function/detail/prologue.hpp @@ -10,18 +10,12 @@ #ifndef BOOST_FUNCTION_PROLOGUE_HPP #define BOOST_FUNCTION_PROLOGUE_HPP # include -# include -# include -# include // unary_function, binary_function -# include -# include # include # include +# include # include -# include -# include -# include -# include -# include # include +# include +# include +# include #endif // BOOST_FUNCTION_PROLOGUE_HPP From dadff436396b8db8329deea9e541fcc9348c21f8 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 25 Jan 2024 05:35:52 +0200 Subject: [PATCH 037/115] Remove requires_cxx11.hpp --- include/boost/function/detail/prologue.hpp | 1 - .../boost/function/detail/requires_cxx11.hpp | 22 ------------------- 2 files changed, 23 deletions(-) delete mode 100644 include/boost/function/detail/requires_cxx11.hpp diff --git a/include/boost/function/detail/prologue.hpp b/include/boost/function/detail/prologue.hpp index 2af12b8c..b0303fd6 100644 --- a/include/boost/function/detail/prologue.hpp +++ b/include/boost/function/detail/prologue.hpp @@ -9,7 +9,6 @@ #ifndef BOOST_FUNCTION_PROLOGUE_HPP #define BOOST_FUNCTION_PROLOGUE_HPP -# include # include # include # include diff --git a/include/boost/function/detail/requires_cxx11.hpp b/include/boost/function/detail/requires_cxx11.hpp deleted file mode 100644 index 8ed947c9..00000000 --- a/include/boost/function/detail/requires_cxx11.hpp +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef BOOST_FUNCTION_DETAIL_REQUIRES_CXX11_HPP_INCLUDED -#define BOOST_FUNCTION_DETAIL_REQUIRES_CXX11_HPP_INCLUDED - -// Copyright 2023 Peter Dimov -// Distributed under the Boost Software License, Version 1.0. -// https://www.boost.org/LICENSE_1_0.txt - -#include -#include - -#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || \ - defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \ - defined(BOOST_NO_CXX11_DECLTYPE) || \ - defined(BOOST_NO_CXX11_CONSTEXPR) || \ - defined(BOOST_NO_CXX11_NOEXCEPT) || \ - defined(BOOST_NO_CXX11_HDR_FUNCTIONAL) - -BOOST_PRAGMA_MESSAGE("C++03 support was deprecated in Boost.Function 1.82 and will be removed in Boost.Function 1.85.") - -#endif - -#endif // #ifndef BOOST_FUNCTION_DETAIL_REQUIRES_CXX11_HPP_INCLUDED From 97decbc7af3a775045d311a1f345e002cc5bc477 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 25 Jan 2024 22:26:12 +0200 Subject: [PATCH 038/115] Update README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6b1bb443..8b3449cb 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ into the C++11 standard as [`std::function`](https://en.cppreference.com/w/cpp/u ## Currently supported compilers -* g++ 4.8 or later +* g++ 4.7 or later * clang++ 3.9 or later -* Visual Studio 2005-2022 +* Visual Studio 2013-2022 Tested on [Github Actions](https://github.com/boostorg/function/actions) and [Appveyor](https://ci.appveyor.com/project/pdimov/function/). From 72889d5a017b37a58d47409ac366d1ded1ec82df Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 26 Jan 2024 07:57:13 +0200 Subject: [PATCH 039/115] Update meta/libraries.json --- meta/libraries.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/libraries.json b/meta/libraries.json index 56b9c660..4581166b 100644 --- a/meta/libraries.json +++ b/meta/libraries.json @@ -15,5 +15,5 @@ "maintainers": [ "Peter Dimov " ], - "cxxstd": "03" + "cxxstd": "11" } From f86ddb0bb977946c64ba22b8456fb6551c6d04ac Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 26 Jan 2024 07:57:47 +0200 Subject: [PATCH 040/115] Regenerate CMakeLists.txt --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ea5dece2..050ad37f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ # Distributed under the Boost Software License, Version 1.0. # https://www.boost.org/LICENSE_1_0.txt -cmake_minimum_required(VERSION 3.5...3.20) +cmake_minimum_required(VERSION 3.8...3.20) project(boost_function VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) @@ -18,11 +18,12 @@ target_link_libraries(boost_function Boost::bind Boost::config Boost::core - Boost::preprocessor Boost::throw_exception Boost::type_traits ) +target_compile_features(boost_function INTERFACE cxx_std_11) + if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt") add_subdirectory(test) From 18e8bf458ca9c29d2af7f1a4e4560da35437212d Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 27 Jan 2024 06:46:26 +0200 Subject: [PATCH 041/115] Remove BOOST_FUNCTION_TARGET_FIX workarounds --- include/boost/function/function_base.hpp | 7 ++----- include/boost/function/function_template.hpp | 8 ++++---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/include/boost/function/function_base.hpp b/include/boost/function/function_base.hpp index 00c7ce8e..cd3a5793 100644 --- a/include/boost/function/function_base.hpp +++ b/include/boost/function/function_base.hpp @@ -40,11 +40,8 @@ # pragma warning( disable : 4127 ) // "conditional expression is constant" #endif -#if defined(__ICL) && __ICL <= 600 || defined(__MWERKS__) && __MWERKS__ < 0x2406 && !defined(BOOST_STRICT_CONFIG) -# define BOOST_FUNCTION_TARGET_FIX(x) x -#else -# define BOOST_FUNCTION_TARGET_FIX(x) -#endif // __ICL etc +// retained because used in a test +#define BOOST_FUNCTION_TARGET_FIX(x) # define BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor,Type) \ typename ::boost::enable_if_< \ diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 90f6118d..006ca908 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -697,7 +697,7 @@ namespace boost { // MSVC chokes if the following two constructors are collapsed into // one with a default parameter. template - BOOST_FUNCTION_FUNCTION(Functor BOOST_FUNCTION_TARGET_FIX(const &) f + BOOST_FUNCTION_FUNCTION(Functor f #ifndef BOOST_NO_SFINAE ,typename boost::enable_if_< !(is_integral::value), @@ -709,7 +709,7 @@ namespace boost { this->assign_to(f); } template - BOOST_FUNCTION_FUNCTION(Functor BOOST_FUNCTION_TARGET_FIX(const &) f, Allocator a + BOOST_FUNCTION_FUNCTION(Functor f, Allocator a #ifndef BOOST_NO_SFINAE ,typename boost::enable_if_< !(is_integral::value), @@ -766,7 +766,7 @@ namespace boost { #else BOOST_FUNCTION_FUNCTION& #endif - operator=(Functor BOOST_FUNCTION_TARGET_FIX(const &) f) + operator=(Functor f) { this->clear(); BOOST_TRY { @@ -779,7 +779,7 @@ namespace boost { return *this; } template - void assign(Functor BOOST_FUNCTION_TARGET_FIX(const &) f, Allocator a) + void assign(Functor f, Allocator a) { this->clear(); BOOST_TRY{ From eff07e72c35d9e51ca75e66ba7e0d2c55df9b915 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 27 Jan 2024 06:52:02 +0200 Subject: [PATCH 042/115] Remove GCC 3.3 workarounds --- include/boost/function/function_base.hpp | 29 ++---------------------- test/contains_test.cpp | 18 --------------- 2 files changed, 2 insertions(+), 45 deletions(-) diff --git a/include/boost/function/function_base.hpp b/include/boost/function/function_base.hpp index cd3a5793..c2978475 100644 --- a/include/boost/function/function_base.hpp +++ b/include/boost/function/function_base.hpp @@ -674,29 +674,6 @@ class function_base } } -#if defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3 - // GCC 3.3 and newer cannot copy with the global operator==, due to - // problems with instantiation of function return types before it - // has been verified that the argument types match up. - template - BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) - operator==(Functor g) const - { - if (const Functor* fp = target()) - return function_equal(*fp, g); - else return false; - } - - template - BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) - operator!=(Functor g) const - { - if (const Functor* fp = target()) - return !function_equal(*fp, g); - else return true; - } -#endif - public: // should be protected, but GCC 2.95.3 will fail to allow access detail::function::vtable_base* get_vtable() const { return reinterpret_cast( @@ -785,10 +762,9 @@ template } #else -# if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3) // Comparisons between boost::function objects and arbitrary function -// objects. GCC 3.3 and before has an obnoxious bug that prevents this -// from working. +// objects. + template BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) operator==(const function_base& f, Functor g) @@ -824,7 +800,6 @@ template return !function_equal(g, *fp); else return true; } -# endif template BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) diff --git a/test/contains_test.cpp b/test/contains_test.cpp index 91e10ab7..f3173641 100644 --- a/test/contains_test.cpp +++ b/test/contains_test.cpp @@ -108,10 +108,8 @@ static void equal_test() f = &forty_two; BOOST_CHECK(f == &forty_two); BOOST_CHECK(f != ReturnInt(17)); -#if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3) BOOST_CHECK(&forty_two == f); BOOST_CHECK(ReturnInt(17) != f); -#endif BOOST_CHECK(f.contains(&forty_two)); @@ -119,11 +117,9 @@ static void equal_test() BOOST_CHECK(f != &forty_two); BOOST_CHECK(f == ReturnInt(17)); BOOST_CHECK(f != ReturnInt(16)); -#if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3) BOOST_CHECK(&forty_two != f); BOOST_CHECK(ReturnInt(17) == f); BOOST_CHECK(ReturnInt(16) != f); -#endif BOOST_CHECK(f.contains(ReturnInt(17))); @@ -131,11 +127,9 @@ static void equal_test() BOOST_CHECK(f != &forty_two); BOOST_CHECK(f == contain_test::ReturnIntFE(17)); BOOST_CHECK(f != contain_test::ReturnIntFE(16)); -#if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3) BOOST_CHECK(&forty_two != f); BOOST_CHECK(contain_test::ReturnIntFE(17) == f); BOOST_CHECK(contain_test::ReturnIntFE(16) != f); -#endif BOOST_CHECK(f.contains(contain_test::ReturnIntFE(17))); @@ -145,20 +139,16 @@ static void equal_test() g = &forty_two; BOOST_CHECK(g == &forty_two); BOOST_CHECK(g != ReturnInt(17)); -# if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3) BOOST_CHECK(&forty_two == g); BOOST_CHECK(ReturnInt(17) != g); -# endif g = ReturnInt(17); BOOST_CHECK(g != &forty_two); BOOST_CHECK(g == ReturnInt(17)); BOOST_CHECK(g != ReturnInt(16)); -# if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3) BOOST_CHECK(&forty_two != g); BOOST_CHECK(ReturnInt(17) == g); BOOST_CHECK(ReturnInt(16) != g); -# endif #endif } @@ -175,10 +165,8 @@ static void ref_equal_test() BOOST_CHECK(!(f != boost::ref(ri))); BOOST_CHECK(!(f != ri)); BOOST_CHECK(!(boost::ref(ri) != f)); -#if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3) BOOST_CHECK(ri == f); BOOST_CHECK(!(ri != f)); -#endif // Values equal, references inequal ReturnInt ri2(17); @@ -188,10 +176,8 @@ static void ref_equal_test() BOOST_CHECK(!(f != ri2)); BOOST_CHECK(!(f == boost::ref(ri2))); BOOST_CHECK(!(boost::ref(ri2) == f)); -#if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3) BOOST_CHECK(ri2 == f); BOOST_CHECK(!(ri2 != f)); -#endif } #if !defined(BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX) @@ -206,10 +192,8 @@ static void ref_equal_test() BOOST_CHECK(!(f != boost::ref(ri))); BOOST_CHECK(!(f != ri)); BOOST_CHECK(!(boost::ref(ri) != f)); -# if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3) BOOST_CHECK(ri == f); BOOST_CHECK(!(ri != f)); -# endif // Values equal, references inequal ReturnInt ri2(17); @@ -219,10 +203,8 @@ static void ref_equal_test() BOOST_CHECK(!(f != ri2)); BOOST_CHECK(!(f == boost::ref(ri2))); BOOST_CHECK(!(boost::ref(ri2) == f)); -# if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3) BOOST_CHECK(ri2 == f); BOOST_CHECK(!(ri2 != f)); -# endif } #endif } From 509de96a1ce16a32de6808ac3c75a1e9440a2db8 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 27 Jan 2024 06:58:05 +0200 Subject: [PATCH 043/115] Remove BOOST_NO_SFINAE workarounds --- include/boost/function/function_base.hpp | 94 -------------------- include/boost/function/function_template.hpp | 36 -------- 2 files changed, 130 deletions(-) diff --git a/include/boost/function/function_base.hpp b/include/boost/function/function_base.hpp index c2978475..98abc0f7 100644 --- a/include/boost/function/function_base.hpp +++ b/include/boost/function/function_base.hpp @@ -522,65 +522,6 @@ namespace boost { // A type that is only used for comparisons against zero struct useless_clear_type {}; -#ifdef BOOST_NO_SFINAE - // These routines perform comparisons between a Boost.Function - // object and an arbitrary function object (when the last - // parameter is false_type) or against zero (when the - // last parameter is true_type). They are only necessary - // for compilers that don't support SFINAE. - template - bool - compare_equal(const Function& f, const Functor&, int, true_type) - { return f.empty(); } - - template - bool - compare_not_equal(const Function& f, const Functor&, int, - true_type) - { return !f.empty(); } - - template - bool - compare_equal(const Function& f, const Functor& g, long, - false_type) - { - if (const Functor* fp = f.template target()) - return function_equal(*fp, g); - else return false; - } - - template - bool - compare_equal(const Function& f, const reference_wrapper& g, - int, false_type) - { - if (const Functor* fp = f.template target()) - return fp == g.get_pointer(); - else return false; - } - - template - bool - compare_not_equal(const Function& f, const Functor& g, long, - false_type) - { - if (const Functor* fp = f.template target()) - return !function_equal(*fp, g); - else return true; - } - - template - bool - compare_not_equal(const Function& f, - const reference_wrapper& g, int, - false_type) - { - if (const Functor* fp = f.template target()) - return fp != g.get_pointer(); - else return true; - } -#endif // BOOST_NO_SFINAE - /** * Stores the "manager" portion of the vtable for a * boost::function object. @@ -705,7 +646,6 @@ class BOOST_SYMBOL_VISIBLE bad_function_call : public std::runtime_error # pragma clang diagnostic pop #endif -#ifndef BOOST_NO_SFINAE inline bool operator==(const function_base& f, detail::function::useless_clear_type*) { @@ -729,38 +669,6 @@ inline bool operator!=(detail::function::useless_clear_type*, { return !f.empty(); } -#endif - -#ifdef BOOST_NO_SFINAE -// Comparisons between boost::function objects and arbitrary function objects -template - inline bool operator==(const function_base& f, Functor g) - { - typedef integral_constant::value)> integral; - return detail::function::compare_equal(f, g, 0, integral()); - } - -template - inline bool operator==(Functor g, const function_base& f) - { - typedef integral_constant::value)> integral; - return detail::function::compare_equal(f, g, 0, integral()); - } - -template - inline bool operator!=(const function_base& f, Functor g) - { - typedef integral_constant::value)> integral; - return detail::function::compare_not_equal(f, g, 0, integral()); - } - -template - inline bool operator!=(Functor g, const function_base& f) - { - typedef integral_constant::value)> integral; - return detail::function::compare_not_equal(f, g, 0, integral()); - } -#else // Comparisons between boost::function objects and arbitrary function // objects. @@ -837,8 +745,6 @@ template else return true; } -#endif // Compiler supporting SFINAE - namespace detail { namespace function { inline bool has_empty_target(const function_base* f) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 006ca908..aed8b5f1 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -698,11 +698,9 @@ namespace boost { // one with a default parameter. template BOOST_FUNCTION_FUNCTION(Functor f -#ifndef BOOST_NO_SFINAE ,typename boost::enable_if_< !(is_integral::value), int>::type = 0 -#endif // BOOST_NO_SFINAE ) : function_base() { @@ -710,25 +708,16 @@ namespace boost { } template BOOST_FUNCTION_FUNCTION(Functor f, Allocator a -#ifndef BOOST_NO_SFINAE ,typename boost::enable_if_< !(is_integral::value), int>::type = 0 -#endif // BOOST_NO_SFINAE ) : function_base() { this->assign_to_a(f,a); } -#ifndef BOOST_NO_SFINAE BOOST_FUNCTION_FUNCTION(clear_type*) : function_base() { } -#else - BOOST_FUNCTION_FUNCTION(int zero) : function_base() - { - BOOST_ASSERT(zero == 0); - } -#endif BOOST_FUNCTION_FUNCTION(const BOOST_FUNCTION_FUNCTION& f) : function_base() { @@ -759,13 +748,9 @@ namespace boost { // handle BOOST_FUNCTION_FUNCTION as the type of the temporary to // construct. template -#ifndef BOOST_NO_SFINAE typename boost::enable_if_< !(is_integral::value), BOOST_FUNCTION_FUNCTION&>::type -#else - BOOST_FUNCTION_FUNCTION& -#endif operator=(Functor f) { this->clear(); @@ -791,20 +776,11 @@ namespace boost { BOOST_CATCH_END } -#ifndef BOOST_NO_SFINAE BOOST_FUNCTION_FUNCTION& operator=(clear_type*) { this->clear(); return *this; } -#else - BOOST_FUNCTION_FUNCTION& operator=(int zero) - { - BOOST_ASSERT(zero == 0); - this->clear(); - return *this; - } -#endif // Assignment from another BOOST_FUNCTION_FUNCTION BOOST_FUNCTION_FUNCTION& operator=(const BOOST_FUNCTION_FUNCTION& f) @@ -1082,30 +1058,24 @@ class function template function(Functor f -#ifndef BOOST_NO_SFINAE ,typename boost::enable_if_< !(is_integral::value), int>::type = 0 -#endif ) : base_type(f) { } template function(Functor f, Allocator a -#ifndef BOOST_NO_SFINAE ,typename boost::enable_if_< !(is_integral::value), int>::type = 0 -#endif ) : base_type(f,a) { } -#ifndef BOOST_NO_SFINAE function(clear_type*) : base_type() {} -#endif function(const self_type& f) : base_type(static_cast(f)){} @@ -1132,26 +1102,20 @@ class function #endif template -#ifndef BOOST_NO_SFINAE typename boost::enable_if_< !(is_integral::value), self_type&>::type -#else - self_type& -#endif operator=(Functor f) { self_type(f).swap(*this); return *this; } -#ifndef BOOST_NO_SFINAE self_type& operator=(clear_type*) { this->clear(); return *this; } -#endif self_type& operator=(const base_type& f) { From 8d7f2ed1a578e32907a44d6adc41be6b5f0fd986 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 27 Jan 2024 07:00:49 +0200 Subject: [PATCH 044/115] Remove SGI workaround --- include/boost/function/function_fwd.hpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/include/boost/function/function_fwd.hpp b/include/boost/function/function_fwd.hpp index 01e2fc0e..e89b9c77 100644 --- a/include/boost/function/function_fwd.hpp +++ b/include/boost/function/function_fwd.hpp @@ -10,15 +10,6 @@ #define BOOST_FUNCTION_FWD_HPP #include -#if defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730 && !defined(BOOST_STRICT_CONFIG) -// Work around a compiler bug. -// boost::python::objects::function has to be seen by the compiler before the -// boost::function class template. -namespace boost { namespace python { namespace objects { - class function; -}}} -#endif - #if defined(BOOST_BCB_PARTIAL_SPECIALIZATION_BUG) \ || !(defined(BOOST_STRICT_CONFIG) || !defined(__SUNPRO_CC) || __SUNPRO_CC > 0x540) # define BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX From ee600cf665d72c42b547f396175aeff1cc5ea05c Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 27 Jan 2024 07:04:50 +0200 Subject: [PATCH 045/115] Remove BOOST_NO_VOID_RETURNS workarounds --- include/boost/function/function_template.hpp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index aed8b5f1..a3a20cea 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -47,13 +47,8 @@ #define BOOST_FUNCTION_GET_INVOKER get_invoker #define BOOST_FUNCTION_VTABLE basic_vtable -#ifndef BOOST_NO_VOID_RETURNS -# define BOOST_FUNCTION_VOID_RETURN_TYPE void -# define BOOST_FUNCTION_RETURN(X) X -#else -# define BOOST_FUNCTION_VOID_RETURN_TYPE boost::detail::function::unusable -# define BOOST_FUNCTION_RETURN(X) X; return BOOST_FUNCTION_VOID_RETURN_TYPE () -#endif +#define BOOST_FUNCTION_VOID_RETURN_TYPE void +#define BOOST_FUNCTION_RETURN(X) X namespace boost { namespace detail { @@ -448,11 +443,7 @@ namespace boost { template struct BOOST_FUNCTION_VTABLE { -#ifndef BOOST_NO_VOID_RETURNS typedef R result_type; -#else - typedef typename function_return_type::type result_type; -#endif // BOOST_NO_VOID_RETURNS typedef result_type (*invoker_type)(function_buffer& BOOST_FUNCTION_COMMA @@ -661,12 +652,7 @@ namespace boost { , public detail::function::variadic_function_base { public: -#ifndef BOOST_NO_VOID_RETURNS typedef R result_type; -#else - typedef typename boost::detail::function::function_return_type::type - result_type; -#endif // BOOST_NO_VOID_RETURNS private: typedef boost::detail::function::BOOST_FUNCTION_VTABLE< From 25706726239ff6d4f8e78205c57457025ce3250d Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 27 Jan 2024 07:08:12 +0200 Subject: [PATCH 046/115] Remove boost::detail::function::unusable --- include/boost/function/function_base.hpp | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/include/boost/function/function_base.hpp b/include/boost/function/function_base.hpp index 98abc0f7..42142d74 100644 --- a/include/boost/function/function_base.hpp +++ b/include/boost/function/function_base.hpp @@ -113,30 +113,6 @@ namespace boost { mutable char data[sizeof(function_buffer_members)]; }; - /** - * The unusable class is a placeholder for unused function arguments - * It is also completely unusable except that it constructable from - * anything. This helps compilers without partial specialization to - * handle Boost.Function objects returning void. - */ - struct unusable - { - unusable() {} - template unusable(const T&) {} - }; - - /* Determine the return type. This supports compilers that do not support - * void returns or partial specialization by silently changing the return - * type to "unusable". - */ - template struct function_return_type { typedef T type; }; - - template<> - struct function_return_type - { - typedef unusable type; - }; - // The operation type to perform on the given functor/function pointer enum functor_manager_operation_type { clone_functor_tag, From 3254a3857a8f36b5b66cfe3129b89cc8e698f74e Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 27 Jan 2024 07:12:35 +0200 Subject: [PATCH 047/115] Remove BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX workarounds --- include/boost/function/detail/epilogue.hpp | 4 ---- include/boost/function/function_fwd.hpp | 7 ------- include/boost/function/function_template.hpp | 7 ------- test/contains_test.cpp | 4 ---- 4 files changed, 22 deletions(-) diff --git a/include/boost/function/detail/epilogue.hpp b/include/boost/function/detail/epilogue.hpp index 908788bc..03cc3aec 100644 --- a/include/boost/function/detail/epilogue.hpp +++ b/include/boost/function/detail/epilogue.hpp @@ -10,8 +10,6 @@ // Resolve C++20 issue with fn == bind(...) // https://github.com/boostorg/function/issues/45 -#if !defined(BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX) - namespace boost { @@ -34,6 +32,4 @@ template bool operator!=( function const& } // namespace boost -#endif // #if !defined(BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX) - #endif // #ifndef BOOST_FUNCTION_EPILOGUE_HPP diff --git a/include/boost/function/function_fwd.hpp b/include/boost/function/function_fwd.hpp index e89b9c77..fccfecc2 100644 --- a/include/boost/function/function_fwd.hpp +++ b/include/boost/function/function_fwd.hpp @@ -10,15 +10,9 @@ #define BOOST_FUNCTION_FWD_HPP #include -#if defined(BOOST_BCB_PARTIAL_SPECIALIZATION_BUG) \ - || !(defined(BOOST_STRICT_CONFIG) || !defined(__SUNPRO_CC) || __SUNPRO_CC > 0x540) -# define BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX -#endif - namespace boost { class bad_function_call; -#if !defined(BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX) // Preferred syntax template class function; @@ -27,7 +21,6 @@ namespace boost { { f1.swap(f2); } -#endif // have partial specialization // Portable syntax template class function_n; diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index a3a20cea..289f5b66 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -1020,13 +1020,7 @@ template R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS>& ); -#if !defined(BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX) - -#if BOOST_FUNCTION_NUM_ARGS == 0 -#define BOOST_FUNCTION_PARTIAL_SPEC R (void) -#else #define BOOST_FUNCTION_PARTIAL_SPEC R (BOOST_FUNCTION_TEMPLATE_ARGS) -#endif template @@ -1119,7 +1113,6 @@ class function }; #undef BOOST_FUNCTION_PARTIAL_SPEC -#endif // have partial specialization } // end namespace boost diff --git a/test/contains_test.cpp b/test/contains_test.cpp index f3173641..7b96d648 100644 --- a/test/contains_test.cpp +++ b/test/contains_test.cpp @@ -133,7 +133,6 @@ static void equal_test() BOOST_CHECK(f.contains(contain_test::ReturnIntFE(17))); -#if !defined(BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX) boost::function g; g = &forty_two; @@ -149,7 +148,6 @@ static void equal_test() BOOST_CHECK(&forty_two != g); BOOST_CHECK(ReturnInt(17) == g); BOOST_CHECK(ReturnInt(16) != g); -#endif } static void ref_equal_test() @@ -180,7 +178,6 @@ static void ref_equal_test() BOOST_CHECK(!(ri2 != f)); } -#if !defined(BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX) { ReturnInt ri(17); boost::function f = boost::ref(ri); @@ -206,7 +203,6 @@ static void ref_equal_test() BOOST_CHECK(ri2 == f); BOOST_CHECK(!(ri2 != f)); } -#endif } int main() From c9357b681964cb8a727f0f3663d853e662f1768f Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 27 Jan 2024 07:18:00 +0200 Subject: [PATCH 048/115] Remove obsolete workarounds from contains_test --- test/contains_test.cpp | 42 +++++++++--------------------------------- 1 file changed, 9 insertions(+), 33 deletions(-) diff --git a/test/contains_test.cpp b/test/contains_test.cpp index 7b96d648..64418711 100644 --- a/test/contains_test.cpp +++ b/test/contains_test.cpp @@ -33,7 +33,7 @@ bool operator==(const ReturnInt& x, const ReturnInt& y) bool operator!=(const ReturnInt& x, const ReturnInt& y) { return x.value != y.value; } -namespace contain_test { +namespace contains_test { struct ReturnIntFE { @@ -44,34 +44,10 @@ struct ReturnIntFE int value; }; -} - -#ifndef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP - -namespace contain_test { -# ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING bool function_equal(const ReturnIntFE& x, const ReturnIntFE& y) { return x.value == y.value; } -# else -bool function_equal_impl(const ReturnIntFE& x, const ReturnIntFE& y, int) -{ return x.value == y.value; } -# endif // #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING -} -#else // BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP -namespace boost { -# ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING -bool -function_equal(const contain_test::ReturnIntFE& x, - const contain_test::ReturnIntFE& y) -{ return x.value == y.value; } -# else -bool -function_equal_impl(const contain_test::ReturnIntFE& x, - const contain_test::ReturnIntFE& y, int) -{ return x.value == y.value; } -# endif -} -#endif + +} // namespace contains_test static void target_test() { @@ -123,15 +99,15 @@ static void equal_test() BOOST_CHECK(f.contains(ReturnInt(17))); - f = contain_test::ReturnIntFE(17); + f = contains_test::ReturnIntFE(17); BOOST_CHECK(f != &forty_two); - BOOST_CHECK(f == contain_test::ReturnIntFE(17)); - BOOST_CHECK(f != contain_test::ReturnIntFE(16)); + BOOST_CHECK(f == contains_test::ReturnIntFE(17)); + BOOST_CHECK(f != contains_test::ReturnIntFE(16)); BOOST_CHECK(&forty_two != f); - BOOST_CHECK(contain_test::ReturnIntFE(17) == f); - BOOST_CHECK(contain_test::ReturnIntFE(16) != f); + BOOST_CHECK(contains_test::ReturnIntFE(17) == f); + BOOST_CHECK(contains_test::ReturnIntFE(16) != f); - BOOST_CHECK(f.contains(contain_test::ReturnIntFE(17))); + BOOST_CHECK(f.contains(contains_test::ReturnIntFE(17))); boost::function g; From a9a0f90bc2a320ba59e7ca6fae50eea6a7741c87 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 27 Jan 2024 07:21:54 +0200 Subject: [PATCH 049/115] Remove BOOST_NO_CXX11_RVALUE_REFERENCES workarounds --- include/boost/function/function_template.hpp | 16 +--------------- test/function_test.cpp | 3 --- test/rvalues_test.cpp | 4 ---- 3 files changed, 1 insertion(+), 22 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 289f5b66..dd698483 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -21,11 +21,7 @@ #define BOOST_FUNCTION_TEMPLATE_PARMS typename... T #define BOOST_FUNCTION_TEMPLATE_ARGS T... #define BOOST_FUNCTION_PARMS T... a -#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES -# define BOOST_FUNCTION_ARGS a... -#else -# define BOOST_FUNCTION_ARGS static_cast(a)... -#endif +#define BOOST_FUNCTION_ARGS static_cast(a)... // Always have commas (zero args case is handled with variadics too) #define BOOST_FUNCTION_COMMA , @@ -710,12 +706,10 @@ namespace boost { this->assign_to_own(f); } -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES BOOST_FUNCTION_FUNCTION(BOOST_FUNCTION_FUNCTION&& f) : function_base() { this->move_assign(f); } -#endif ~BOOST_FUNCTION_FUNCTION() { clear(); } @@ -785,7 +779,6 @@ namespace boost { return *this; } -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES // Move assignment from another BOOST_FUNCTION_FUNCTION BOOST_FUNCTION_FUNCTION& operator=(BOOST_FUNCTION_FUNCTION&& f) { @@ -802,7 +795,6 @@ namespace boost { BOOST_CATCH_END return *this; } -#endif void swap(BOOST_FUNCTION_FUNCTION& other) { @@ -1061,11 +1053,9 @@ class function function(const base_type& f) : base_type(static_cast(f)){} -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES // Move constructors function(self_type&& f): base_type(static_cast(f)){} function(base_type&& f): base_type(static_cast(f)){} -#endif self_type& operator=(const self_type& f) { @@ -1073,13 +1063,11 @@ class function return *this; } -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES self_type& operator=(self_type&& f) { self_type(static_cast(f)).swap(*this); return *this; } -#endif template typename boost::enable_if_< @@ -1103,13 +1091,11 @@ class function return *this; } -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES self_type& operator=(base_type&& f) { self_type(static_cast(f)).swap(*this); return *this; } -#endif }; #undef BOOST_FUNCTION_PARTIAL_SPEC diff --git a/test/function_test.cpp b/test/function_test.cpp index 75928374..03d6fe0f 100644 --- a/test/function_test.cpp +++ b/test/function_test.cpp @@ -754,7 +754,6 @@ static void test_move_semantics() BOOST_CHECK(!f1.empty()); BOOST_CHECK(global_int == 1); -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES // Testing rvalue constructors f1_type f2(static_cast(f1)); BOOST_CHECK(f1.empty()); @@ -796,8 +795,6 @@ static void test_move_semantics() BOOST_CHECK(global_int == 5); f4 = static_cast(f5); BOOST_CHECK(global_int == 4); - -#endif } int main() diff --git a/test/rvalues_test.cpp b/test/rvalues_test.cpp index 28545d53..0d21ec4e 100644 --- a/test/rvalues_test.cpp +++ b/test/rvalues_test.cpp @@ -59,10 +59,8 @@ struct sum_struct { } }; -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES int three(std::string&&) { return 1; } std::string&& four(std::string&& s) { return boost::move(s); } -#endif int main() { @@ -95,13 +93,11 @@ int main() BOOST_CHECK(om2_sum_2.get_value() == 3); } -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES function f3 = three; function f4 = four; f3(std::string("Hello")); BOOST_CHECK(f4(std::string("world")) == "world"); -#endif return boost::report_errors(); } From f898d3a1dd4bc56b6fd1f22c1ef52619f72486d3 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 27 Jan 2024 09:11:37 +0200 Subject: [PATCH 050/115] Remove BOOST_NO_CXX11_ALLOCATOR workarounds --- include/boost/function/function_base.hpp | 15 +-------------- include/boost/function/function_template.hpp | 13 +++---------- 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/include/boost/function/function_base.hpp b/include/boost/function/function_base.hpp index 42142d74..e8ffb06b 100644 --- a/include/boost/function/function_base.hpp +++ b/include/boost/function/function_base.hpp @@ -413,14 +413,9 @@ namespace boost { functor_manager_operation_type op, false_type) { typedef functor_wrapper functor_wrapper_type; -#if defined(BOOST_NO_CXX11_ALLOCATOR) - typedef typename Allocator::template rebind::other - wrapper_allocator_type; - typedef typename wrapper_allocator_type::pointer wrapper_allocator_pointer_type; -#else + using wrapper_allocator_type = typename std::allocator_traits::template rebind_alloc; using wrapper_allocator_pointer_type = typename std::allocator_traits::pointer; -#endif if (op == clone_functor_tag) { // Clone the functor @@ -430,11 +425,7 @@ namespace boost { static_cast(in_buffer.members.obj_ptr); wrapper_allocator_type wrapper_allocator(static_cast(*f)); wrapper_allocator_pointer_type copy = wrapper_allocator.allocate(1); -#if defined(BOOST_NO_CXX11_ALLOCATOR) - wrapper_allocator.construct(copy, *f); -#else std::allocator_traits::construct(wrapper_allocator, copy, *f); -#endif // Get back to the original pointer type functor_wrapper_type* new_f = static_cast(copy); @@ -447,11 +438,7 @@ namespace boost { functor_wrapper_type* victim = static_cast(in_buffer.members.obj_ptr); wrapper_allocator_type wrapper_allocator(static_cast(*victim)); -#if defined(BOOST_NO_CXX11_ALLOCATOR) - wrapper_allocator.destroy(victim); -#else std::allocator_traits::destroy(wrapper_allocator, victim); -#endif wrapper_allocator.deallocate(victim,1); out_buffer.members.obj_ptr = 0; } else if (op == check_functor_type_tag) { diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index dd698483..f3a524f2 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -552,21 +552,14 @@ namespace boost { assign_functor_a(FunctionObj f, function_buffer& functor, Allocator a, false_type) const { typedef functor_wrapper functor_wrapper_type; -#if defined(BOOST_NO_CXX11_ALLOCATOR) - typedef typename Allocator::template rebind::other - wrapper_allocator_type; - typedef typename wrapper_allocator_type::pointer wrapper_allocator_pointer_type; -#else + using wrapper_allocator_type = typename std::allocator_traits::template rebind_alloc; using wrapper_allocator_pointer_type = typename std::allocator_traits::pointer; -#endif + wrapper_allocator_type wrapper_allocator(a); wrapper_allocator_pointer_type copy = wrapper_allocator.allocate(1); -#if defined(BOOST_NO_CXX11_ALLOCATOR) - wrapper_allocator.construct(copy, functor_wrapper_type(f,a)); -#else std::allocator_traits::construct(wrapper_allocator, copy, functor_wrapper_type(f,a)); -#endif + functor_wrapper_type* new_f = static_cast(copy); functor.members.obj_ptr = new_f; } From af8e66d03b4366c7039a138306470567c2243130 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 27 Jan 2024 09:15:01 +0200 Subject: [PATCH 051/115] Replace operator safe_bool with explicit operator bool --- include/boost/function/function_template.hpp | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index f3a524f2..3991e36b 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -810,24 +810,7 @@ namespace boost { } } -#if (defined __SUNPRO_CC) && (__SUNPRO_CC <= 0x530) && !(defined BOOST_NO_COMPILER_CONFIG) - // Sun C++ 5.3 can't handle the safe_bool idiom, so don't use it - operator bool () const { return !this->empty(); } -#else - private: - struct dummy { - void nonnull() {} - }; - - typedef void (dummy::*safe_bool)(); - - public: - operator safe_bool () const - { return (this->empty())? 0 : &dummy::nonnull; } - - bool operator!() const - { return this->empty(); } -#endif + explicit operator bool () const { return !this->empty(); } private: void assign_to_own(const BOOST_FUNCTION_FUNCTION& f) From b13f8f6f20e8fef644c35b5d985449f88bbdc4dc Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 28 Jan 2024 02:29:30 +0200 Subject: [PATCH 052/115] Remove uses of BOOST_FUNCTION_FUNCTION --- include/boost/function/function_template.hpp | 60 ++++++++++---------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 3991e36b..af634ab6 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -27,7 +27,6 @@ #define BOOST_FUNCTION_COMMA , // Class names used in this version of the code -#define BOOST_FUNCTION_FUNCTION function_n #define BOOST_FUNCTION_FUNCTION_INVOKER function_invoker #define BOOST_FUNCTION_VOID_FUNCTION_INVOKER void_function_invoker #define BOOST_FUNCTION_FUNCTION_OBJ_INVOKER function_obj_invoker @@ -637,7 +636,7 @@ namespace boost { typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS > - class BOOST_FUNCTION_FUNCTION : public function_base + class function_n : public function_base , public detail::function::variadic_function_base { public: @@ -665,14 +664,14 @@ namespace boost { BOOST_STATIC_CONSTANT(int, arity = sizeof...(T)); - typedef BOOST_FUNCTION_FUNCTION self_type; + typedef function_n self_type; - BOOST_DEFAULTED_FUNCTION(BOOST_FUNCTION_FUNCTION(), : function_base() {}) + BOOST_DEFAULTED_FUNCTION(function_n(), : function_base() {}) // MSVC chokes if the following two constructors are collapsed into // one with a default parameter. template - BOOST_FUNCTION_FUNCTION(Functor f + function_n(Functor f ,typename boost::enable_if_< !(is_integral::value), int>::type = 0 @@ -682,7 +681,7 @@ namespace boost { this->assign_to(f); } template - BOOST_FUNCTION_FUNCTION(Functor f, Allocator a + function_n(Functor f, Allocator a ,typename boost::enable_if_< !(is_integral::value), int>::type = 0 @@ -692,19 +691,19 @@ namespace boost { this->assign_to_a(f,a); } - BOOST_FUNCTION_FUNCTION(clear_type*) : function_base() { } + function_n(clear_type*) : function_base() { } - BOOST_FUNCTION_FUNCTION(const BOOST_FUNCTION_FUNCTION& f) : function_base() + function_n(const function_n& f) : function_base() { this->assign_to_own(f); } - BOOST_FUNCTION_FUNCTION(BOOST_FUNCTION_FUNCTION&& f) : function_base() + function_n(function_n&& f) : function_base() { this->move_assign(f); } - ~BOOST_FUNCTION_FUNCTION() { clear(); } + ~function_n() { clear(); } result_type operator()(BOOST_FUNCTION_PARMS) const { @@ -715,15 +714,15 @@ namespace boost { (this->functor BOOST_FUNCTION_COMMA BOOST_FUNCTION_ARGS); } - // The distinction between when to use BOOST_FUNCTION_FUNCTION and + // The distinction between when to use function_n and // when to use self_type is obnoxious. MSVC cannot handle self_type as // the return type of these assignment operators, but Borland C++ cannot - // handle BOOST_FUNCTION_FUNCTION as the type of the temporary to + // handle function_n as the type of the temporary to // construct. template typename boost::enable_if_< !(is_integral::value), - BOOST_FUNCTION_FUNCTION&>::type + function_n&>::type operator=(Functor f) { this->clear(); @@ -749,14 +748,14 @@ namespace boost { BOOST_CATCH_END } - BOOST_FUNCTION_FUNCTION& operator=(clear_type*) + function_n& operator=(clear_type*) { this->clear(); return *this; } - // Assignment from another BOOST_FUNCTION_FUNCTION - BOOST_FUNCTION_FUNCTION& operator=(const BOOST_FUNCTION_FUNCTION& f) + // Assignment from another function_n + function_n& operator=(const function_n& f) { if (&f == this) return *this; @@ -772,8 +771,8 @@ namespace boost { return *this; } - // Move assignment from another BOOST_FUNCTION_FUNCTION - BOOST_FUNCTION_FUNCTION& operator=(BOOST_FUNCTION_FUNCTION&& f) + // Move assignment from another function_n + function_n& operator=(function_n&& f) { if (&f == this) return *this; @@ -789,12 +788,12 @@ namespace boost { return *this; } - void swap(BOOST_FUNCTION_FUNCTION& other) + void swap(function_n& other) { if (&other == this) return; - BOOST_FUNCTION_FUNCTION tmp; + function_n tmp; tmp.move_assign(*this); this->move_assign(other); other.move_assign(tmp); @@ -813,7 +812,7 @@ namespace boost { explicit operator bool () const { return !this->empty(); } private: - void assign_to_own(const BOOST_FUNCTION_FUNCTION& f) + void assign_to_own(const function_n& f) { if (!f.empty()) { this->vtable = f.vtable; @@ -911,7 +910,7 @@ namespace boost { // Moves the value from the specified argument to *this. If the argument // has its function object allocated on the heap, move_assign will pass // its buffer to *this, and set the argument's buffer pointer to NULL. - void move_assign(BOOST_FUNCTION_FUNCTION& f) + void move_assign(function_n& f) { if (&f == this) return; @@ -960,11 +959,11 @@ namespace boost { }; template - inline void swap(BOOST_FUNCTION_FUNCTION< + inline void swap(function_n< R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS >& f1, - BOOST_FUNCTION_FUNCTION< + function_n< R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS >& f2) @@ -974,17 +973,17 @@ namespace boost { // Poison comparisons between boost::function objects of the same type. template - void operator==(const BOOST_FUNCTION_FUNCTION< + void operator==(const function_n< R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS>&, - const BOOST_FUNCTION_FUNCTION< + const function_n< R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS>&); template - void operator!=(const BOOST_FUNCTION_FUNCTION< + void operator!=(const function_n< R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS>&, - const BOOST_FUNCTION_FUNCTION< + const function_n< R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS>& ); @@ -993,9 +992,9 @@ template template class function - : public BOOST_FUNCTION_FUNCTION + : public function_n { - typedef BOOST_FUNCTION_FUNCTION base_type; + typedef function_n base_type; typedef function self_type; struct clear_type {}; @@ -1081,7 +1080,6 @@ class function // Cleanup after ourselves... #undef BOOST_FUNCTION_VTABLE #undef BOOST_FUNCTION_COMMA -#undef BOOST_FUNCTION_FUNCTION #undef BOOST_FUNCTION_FUNCTION_INVOKER #undef BOOST_FUNCTION_VOID_FUNCTION_INVOKER #undef BOOST_FUNCTION_FUNCTION_OBJ_INVOKER From 4e6dda7364c39320d8d5236d289c41d68646a1d1 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 28 Jan 2024 02:30:44 +0200 Subject: [PATCH 053/115] Remove uses of BOOST_FUNCTION_FUNCTION_INVOKER --- include/boost/function/function_template.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index af634ab6..f6695f1e 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -27,7 +27,6 @@ #define BOOST_FUNCTION_COMMA , // Class names used in this version of the code -#define BOOST_FUNCTION_FUNCTION_INVOKER function_invoker #define BOOST_FUNCTION_VOID_FUNCTION_INVOKER void_function_invoker #define BOOST_FUNCTION_FUNCTION_OBJ_INVOKER function_obj_invoker #define BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER void_function_obj_invoker @@ -53,7 +52,7 @@ namespace boost { typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS > - struct BOOST_FUNCTION_FUNCTION_INVOKER + struct function_invoker { static R invoke(function_buffer& function_ptr BOOST_FUNCTION_COMMA BOOST_FUNCTION_PARMS) @@ -207,7 +206,7 @@ namespace boost { R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS >, - BOOST_FUNCTION_FUNCTION_INVOKER< + function_invoker< FunctionPtr, R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS @@ -1080,7 +1079,6 @@ class function // Cleanup after ourselves... #undef BOOST_FUNCTION_VTABLE #undef BOOST_FUNCTION_COMMA -#undef BOOST_FUNCTION_FUNCTION_INVOKER #undef BOOST_FUNCTION_VOID_FUNCTION_INVOKER #undef BOOST_FUNCTION_FUNCTION_OBJ_INVOKER #undef BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER From 4ba8c23ce4530c1d019680da6f52c24aa3c12fe4 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 28 Jan 2024 02:31:14 +0200 Subject: [PATCH 054/115] Remove uses of BOOST_FUNCTION_VOID_FUNCTION_INVOKER --- include/boost/function/function_template.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index f6695f1e..063798dc 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -27,7 +27,6 @@ #define BOOST_FUNCTION_COMMA , // Class names used in this version of the code -#define BOOST_FUNCTION_VOID_FUNCTION_INVOKER void_function_invoker #define BOOST_FUNCTION_FUNCTION_OBJ_INVOKER function_obj_invoker #define BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER void_function_obj_invoker #define BOOST_FUNCTION_FUNCTION_REF_INVOKER function_ref_invoker @@ -67,7 +66,7 @@ namespace boost { typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS > - struct BOOST_FUNCTION_VOID_FUNCTION_INVOKER + struct void_function_invoker { static BOOST_FUNCTION_VOID_RETURN_TYPE invoke(function_buffer& function_ptr BOOST_FUNCTION_COMMA @@ -201,7 +200,7 @@ namespace boost { struct BOOST_FUNCTION_GET_FUNCTION_INVOKER { typedef typename conditional<(is_void::value), - BOOST_FUNCTION_VOID_FUNCTION_INVOKER< + void_function_invoker< FunctionPtr, R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS @@ -1079,7 +1078,6 @@ class function // Cleanup after ourselves... #undef BOOST_FUNCTION_VTABLE #undef BOOST_FUNCTION_COMMA -#undef BOOST_FUNCTION_VOID_FUNCTION_INVOKER #undef BOOST_FUNCTION_FUNCTION_OBJ_INVOKER #undef BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER #undef BOOST_FUNCTION_FUNCTION_REF_INVOKER From 5803badc2093559ebd407fa7b42ac0ed17a82cfe Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 28 Jan 2024 02:31:56 +0200 Subject: [PATCH 055/115] Remove uses of BOOST_FUNCTION_FUNCTION_OBJ_INVOKER --- include/boost/function/function_template.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 063798dc..519e31fe 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -27,7 +27,6 @@ #define BOOST_FUNCTION_COMMA , // Class names used in this version of the code -#define BOOST_FUNCTION_FUNCTION_OBJ_INVOKER function_obj_invoker #define BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER void_function_obj_invoker #define BOOST_FUNCTION_FUNCTION_REF_INVOKER function_ref_invoker #define BOOST_FUNCTION_VOID_FUNCTION_REF_INVOKER void_function_ref_invoker @@ -83,7 +82,7 @@ namespace boost { typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS > - struct BOOST_FUNCTION_FUNCTION_OBJ_INVOKER + struct function_obj_invoker { static R invoke(function_buffer& function_obj_ptr BOOST_FUNCTION_COMMA BOOST_FUNCTION_PARMS) @@ -226,7 +225,7 @@ namespace boost { R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS >, - BOOST_FUNCTION_FUNCTION_OBJ_INVOKER< + function_obj_invoker< FunctionObj, R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS @@ -1078,7 +1077,6 @@ class function // Cleanup after ourselves... #undef BOOST_FUNCTION_VTABLE #undef BOOST_FUNCTION_COMMA -#undef BOOST_FUNCTION_FUNCTION_OBJ_INVOKER #undef BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER #undef BOOST_FUNCTION_FUNCTION_REF_INVOKER #undef BOOST_FUNCTION_VOID_FUNCTION_REF_INVOKER From 15a4f89d9cc26b4e3a743ae29780b6ab9d3ab023 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 28 Jan 2024 02:32:56 +0200 Subject: [PATCH 056/115] Remove uses of BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER --- include/boost/function/function_template.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 519e31fe..f8f9e8dd 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -27,7 +27,6 @@ #define BOOST_FUNCTION_COMMA , // Class names used in this version of the code -#define BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER void_function_obj_invoker #define BOOST_FUNCTION_FUNCTION_REF_INVOKER function_ref_invoker #define BOOST_FUNCTION_VOID_FUNCTION_REF_INVOKER void_function_ref_invoker #define BOOST_FUNCTION_MEMBER_INVOKER function_mem_invoker @@ -102,7 +101,7 @@ namespace boost { typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS > - struct BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER + struct void_function_obj_invoker { static BOOST_FUNCTION_VOID_RETURN_TYPE invoke(function_buffer& function_obj_ptr BOOST_FUNCTION_COMMA @@ -220,7 +219,7 @@ namespace boost { struct BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER { typedef typename conditional<(is_void::value), - BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER< + void_function_obj_invoker< FunctionObj, R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS @@ -1077,7 +1076,6 @@ class function // Cleanup after ourselves... #undef BOOST_FUNCTION_VTABLE #undef BOOST_FUNCTION_COMMA -#undef BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER #undef BOOST_FUNCTION_FUNCTION_REF_INVOKER #undef BOOST_FUNCTION_VOID_FUNCTION_REF_INVOKER #undef BOOST_FUNCTION_MEMBER_INVOKER From 692cf3d56ead7eb3ac72c4d31499a7431a6d865d Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 28 Jan 2024 02:34:11 +0200 Subject: [PATCH 057/115] Remove uses of BOOST_FUNCTION_FUNCTION_REF_INVOKER --- include/boost/function/function_template.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index f8f9e8dd..08fd3c1a 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -27,7 +27,6 @@ #define BOOST_FUNCTION_COMMA , // Class names used in this version of the code -#define BOOST_FUNCTION_FUNCTION_REF_INVOKER function_ref_invoker #define BOOST_FUNCTION_VOID_FUNCTION_REF_INVOKER void_function_ref_invoker #define BOOST_FUNCTION_MEMBER_INVOKER function_mem_invoker #define BOOST_FUNCTION_VOID_MEMBER_INVOKER function_void_mem_invoker @@ -122,7 +121,7 @@ namespace boost { typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS > - struct BOOST_FUNCTION_FUNCTION_REF_INVOKER + struct function_ref_invoker { static R invoke(function_buffer& function_obj_ptr BOOST_FUNCTION_COMMA BOOST_FUNCTION_PARMS) @@ -245,7 +244,7 @@ namespace boost { R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS >, - BOOST_FUNCTION_FUNCTION_REF_INVOKER< + function_ref_invoker< FunctionObj, R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS @@ -1076,7 +1075,6 @@ class function // Cleanup after ourselves... #undef BOOST_FUNCTION_VTABLE #undef BOOST_FUNCTION_COMMA -#undef BOOST_FUNCTION_FUNCTION_REF_INVOKER #undef BOOST_FUNCTION_VOID_FUNCTION_REF_INVOKER #undef BOOST_FUNCTION_MEMBER_INVOKER #undef BOOST_FUNCTION_VOID_MEMBER_INVOKER From 4cedf0bf3b61c572d46d4d87b440154db183b35a Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 28 Jan 2024 02:35:01 +0200 Subject: [PATCH 058/115] Remove uses of BOOST_FUNCTION_VOID_FUNCTION_REF_INVOKER --- include/boost/function/function_template.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 08fd3c1a..748770ef 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -27,7 +27,6 @@ #define BOOST_FUNCTION_COMMA , // Class names used in this version of the code -#define BOOST_FUNCTION_VOID_FUNCTION_REF_INVOKER void_function_ref_invoker #define BOOST_FUNCTION_MEMBER_INVOKER function_mem_invoker #define BOOST_FUNCTION_VOID_MEMBER_INVOKER function_void_mem_invoker #define BOOST_FUNCTION_GET_FUNCTION_INVOKER get_function_invoker @@ -138,7 +137,7 @@ namespace boost { typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS > - struct BOOST_FUNCTION_VOID_FUNCTION_REF_INVOKER + struct void_function_ref_invoker { static BOOST_FUNCTION_VOID_RETURN_TYPE invoke(function_buffer& function_obj_ptr BOOST_FUNCTION_COMMA @@ -239,7 +238,7 @@ namespace boost { struct BOOST_FUNCTION_GET_FUNCTION_REF_INVOKER { typedef typename conditional<(is_void::value), - BOOST_FUNCTION_VOID_FUNCTION_REF_INVOKER< + void_function_ref_invoker< FunctionObj, R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS @@ -1075,7 +1074,6 @@ class function // Cleanup after ourselves... #undef BOOST_FUNCTION_VTABLE #undef BOOST_FUNCTION_COMMA -#undef BOOST_FUNCTION_VOID_FUNCTION_REF_INVOKER #undef BOOST_FUNCTION_MEMBER_INVOKER #undef BOOST_FUNCTION_VOID_MEMBER_INVOKER #undef BOOST_FUNCTION_GET_FUNCTION_INVOKER From b241c83d43e23417f73f70a36cfc14b05a5ba64e Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 28 Jan 2024 02:38:32 +0200 Subject: [PATCH 059/115] Remove uses of BOOST_FUNCTION_MEMBER_INVOKER --- include/boost/function/function_template.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 748770ef..2f559224 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -27,7 +27,6 @@ #define BOOST_FUNCTION_COMMA , // Class names used in this version of the code -#define BOOST_FUNCTION_MEMBER_INVOKER function_mem_invoker #define BOOST_FUNCTION_VOID_MEMBER_INVOKER function_void_mem_invoker #define BOOST_FUNCTION_GET_FUNCTION_INVOKER get_function_invoker #define BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER get_function_obj_invoker @@ -157,7 +156,7 @@ namespace boost { typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS > - struct BOOST_FUNCTION_MEMBER_INVOKER + struct member_invoker { static R invoke(function_buffer& function_obj_ptr BOOST_FUNCTION_COMMA BOOST_FUNCTION_PARMS) @@ -266,7 +265,7 @@ namespace boost { R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS >, - BOOST_FUNCTION_MEMBER_INVOKER< + member_invoker< MemberPtr, R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS @@ -1074,7 +1073,6 @@ class function // Cleanup after ourselves... #undef BOOST_FUNCTION_VTABLE #undef BOOST_FUNCTION_COMMA -#undef BOOST_FUNCTION_MEMBER_INVOKER #undef BOOST_FUNCTION_VOID_MEMBER_INVOKER #undef BOOST_FUNCTION_GET_FUNCTION_INVOKER #undef BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER From 3380fc642f7e2612d14ce63d9476996081534692 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 28 Jan 2024 02:39:07 +0200 Subject: [PATCH 060/115] Remove uses of BOOST_FUNCTION_VOID_MEMBER_INVOKER --- include/boost/function/function_template.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 2f559224..d893eef2 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -27,7 +27,6 @@ #define BOOST_FUNCTION_COMMA , // Class names used in this version of the code -#define BOOST_FUNCTION_VOID_MEMBER_INVOKER function_void_mem_invoker #define BOOST_FUNCTION_GET_FUNCTION_INVOKER get_function_invoker #define BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER get_function_obj_invoker #define BOOST_FUNCTION_GET_FUNCTION_REF_INVOKER get_function_ref_invoker @@ -173,7 +172,7 @@ namespace boost { typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS > - struct BOOST_FUNCTION_VOID_MEMBER_INVOKER + struct void_member_invoker { static BOOST_FUNCTION_VOID_RETURN_TYPE invoke(function_buffer& function_obj_ptr BOOST_FUNCTION_COMMA @@ -260,7 +259,7 @@ namespace boost { struct BOOST_FUNCTION_GET_MEMBER_INVOKER { typedef typename conditional<(is_void::value), - BOOST_FUNCTION_VOID_MEMBER_INVOKER< + void_member_invoker< MemberPtr, R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS @@ -1073,7 +1072,6 @@ class function // Cleanup after ourselves... #undef BOOST_FUNCTION_VTABLE #undef BOOST_FUNCTION_COMMA -#undef BOOST_FUNCTION_VOID_MEMBER_INVOKER #undef BOOST_FUNCTION_GET_FUNCTION_INVOKER #undef BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER #undef BOOST_FUNCTION_GET_FUNCTION_REF_INVOKER From 7b8bdda461e6ef2a4505788c15fffe8e87aea611 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 28 Jan 2024 02:40:34 +0200 Subject: [PATCH 061/115] Remove uses of BOOST_FUNCTION_GET_FUNCTION_INVOKER --- include/boost/function/function_template.hpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index d893eef2..85963613 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -27,7 +27,6 @@ #define BOOST_FUNCTION_COMMA , // Class names used in this version of the code -#define BOOST_FUNCTION_GET_FUNCTION_INVOKER get_function_invoker #define BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER get_function_obj_invoker #define BOOST_FUNCTION_GET_FUNCTION_REF_INVOKER get_function_ref_invoker #define BOOST_FUNCTION_GET_MEMBER_INVOKER get_member_invoker @@ -191,7 +190,7 @@ namespace boost { typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS > - struct BOOST_FUNCTION_GET_FUNCTION_INVOKER + struct get_function_invoker { typedef typename conditional<(is_void::value), void_function_invoker< @@ -293,7 +292,7 @@ namespace boost { typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS> struct apply { - typedef typename BOOST_FUNCTION_GET_FUNCTION_INVOKER< + typedef typename get_function_invoker< FunctionPtr, R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS @@ -307,7 +306,7 @@ namespace boost { typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS> struct apply_a { - typedef typename BOOST_FUNCTION_GET_FUNCTION_INVOKER< + typedef typename get_function_invoker< FunctionPtr, R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS @@ -1072,7 +1071,6 @@ class function // Cleanup after ourselves... #undef BOOST_FUNCTION_VTABLE #undef BOOST_FUNCTION_COMMA -#undef BOOST_FUNCTION_GET_FUNCTION_INVOKER #undef BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER #undef BOOST_FUNCTION_GET_FUNCTION_REF_INVOKER #undef BOOST_FUNCTION_GET_MEM_FUNCTION_INVOKER From 691b7658273bc85ce5a1b9a2554658f89fa81443 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 28 Jan 2024 02:41:11 +0200 Subject: [PATCH 062/115] Remove uses of BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER --- include/boost/function/function_template.hpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 85963613..ac573cbd 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -27,7 +27,6 @@ #define BOOST_FUNCTION_COMMA , // Class names used in this version of the code -#define BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER get_function_obj_invoker #define BOOST_FUNCTION_GET_FUNCTION_REF_INVOKER get_function_ref_invoker #define BOOST_FUNCTION_GET_MEMBER_INVOKER get_member_invoker #define BOOST_FUNCTION_GET_INVOKER get_invoker @@ -211,7 +210,7 @@ namespace boost { typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS > - struct BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER + struct get_function_obj_invoker { typedef typename conditional<(is_void::value), void_function_obj_invoker< @@ -360,7 +359,7 @@ namespace boost { typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS> struct apply { - typedef typename BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER< + typedef typename get_function_obj_invoker< FunctionObj, R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS @@ -374,7 +373,7 @@ namespace boost { typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS> struct apply_a { - typedef typename BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER< + typedef typename get_function_obj_invoker< FunctionObj, R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS @@ -1071,7 +1070,6 @@ class function // Cleanup after ourselves... #undef BOOST_FUNCTION_VTABLE #undef BOOST_FUNCTION_COMMA -#undef BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER #undef BOOST_FUNCTION_GET_FUNCTION_REF_INVOKER #undef BOOST_FUNCTION_GET_MEM_FUNCTION_INVOKER #undef BOOST_FUNCTION_GET_INVOKER From 7efb3be04391293435f1827d329a9af604190185 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 28 Jan 2024 02:42:10 +0200 Subject: [PATCH 063/115] Remove uses of BOOST_FUNCTION_GET_FUNCTION_REF_INVOKER --- include/boost/function/function_template.hpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index ac573cbd..3cdbdc06 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -27,7 +27,6 @@ #define BOOST_FUNCTION_COMMA , // Class names used in this version of the code -#define BOOST_FUNCTION_GET_FUNCTION_REF_INVOKER get_function_ref_invoker #define BOOST_FUNCTION_GET_MEMBER_INVOKER get_member_invoker #define BOOST_FUNCTION_GET_INVOKER get_invoker #define BOOST_FUNCTION_VTABLE basic_vtable @@ -231,7 +230,7 @@ namespace boost { typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS > - struct BOOST_FUNCTION_GET_FUNCTION_REF_INVOKER + struct get_function_ref_invoker { typedef typename conditional<(is_void::value), void_function_ref_invoker< @@ -392,7 +391,7 @@ namespace boost { typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS> struct apply { - typedef typename BOOST_FUNCTION_GET_FUNCTION_REF_INVOKER< + typedef typename get_function_ref_invoker< typename RefWrapper::type, R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS @@ -406,7 +405,7 @@ namespace boost { typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS> struct apply_a { - typedef typename BOOST_FUNCTION_GET_FUNCTION_REF_INVOKER< + typedef typename get_function_ref_invoker< typename RefWrapper::type, R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS @@ -1070,7 +1069,6 @@ class function // Cleanup after ourselves... #undef BOOST_FUNCTION_VTABLE #undef BOOST_FUNCTION_COMMA -#undef BOOST_FUNCTION_GET_FUNCTION_REF_INVOKER #undef BOOST_FUNCTION_GET_MEM_FUNCTION_INVOKER #undef BOOST_FUNCTION_GET_INVOKER #undef BOOST_FUNCTION_TEMPLATE_PARMS From 87d8b29dc0fd612027abcb572479cb5127666ffb Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 28 Jan 2024 02:59:36 +0200 Subject: [PATCH 064/115] Remove uses of BOOST_FUNCTION_GET_MEMBER_INVOKER --- include/boost/function/function_template.hpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 3cdbdc06..2856485d 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -27,7 +27,6 @@ #define BOOST_FUNCTION_COMMA , // Class names used in this version of the code -#define BOOST_FUNCTION_GET_MEMBER_INVOKER get_member_invoker #define BOOST_FUNCTION_GET_INVOKER get_invoker #define BOOST_FUNCTION_VTABLE basic_vtable @@ -253,7 +252,7 @@ namespace boost { typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS > - struct BOOST_FUNCTION_GET_MEMBER_INVOKER + struct get_member_invoker { typedef typename conditional<(is_void::value), void_member_invoker< @@ -324,7 +323,7 @@ namespace boost { typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS> struct apply { - typedef typename BOOST_FUNCTION_GET_MEMBER_INVOKER< + typedef typename get_member_invoker< MemberPtr, R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS @@ -338,7 +337,7 @@ namespace boost { typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS> struct apply_a { - typedef typename BOOST_FUNCTION_GET_MEMBER_INVOKER< + typedef typename get_member_invoker< MemberPtr, R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS @@ -1069,7 +1068,6 @@ class function // Cleanup after ourselves... #undef BOOST_FUNCTION_VTABLE #undef BOOST_FUNCTION_COMMA -#undef BOOST_FUNCTION_GET_MEM_FUNCTION_INVOKER #undef BOOST_FUNCTION_GET_INVOKER #undef BOOST_FUNCTION_TEMPLATE_PARMS #undef BOOST_FUNCTION_TEMPLATE_ARGS From 916b44374dc7f46ca8dde9bc184df29d964f5ed8 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 28 Jan 2024 03:00:17 +0200 Subject: [PATCH 065/115] Remove uses of BOOST_FUNCTION_GET_INVOKER --- include/boost/function/function_template.hpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 2856485d..9b3af0de 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -27,7 +27,6 @@ #define BOOST_FUNCTION_COMMA , // Class names used in this version of the code -#define BOOST_FUNCTION_GET_INVOKER get_invoker #define BOOST_FUNCTION_VTABLE basic_vtable #define BOOST_FUNCTION_VOID_RETURN_TYPE void @@ -279,11 +278,11 @@ namespace boost { contains two typedefs, "invoker_type" and "manager_type", which correspond to the invoker and manager types. */ template - struct BOOST_FUNCTION_GET_INVOKER { }; + struct get_invoker { }; /* Retrieve the invoker for a function pointer. */ template<> - struct BOOST_FUNCTION_GET_INVOKER + struct get_invoker { template @@ -317,7 +316,7 @@ namespace boost { #if BOOST_FUNCTION_NUM_ARGS > 0 /* Retrieve the invoker for a member pointer. */ template<> - struct BOOST_FUNCTION_GET_INVOKER + struct get_invoker { template @@ -351,7 +350,7 @@ namespace boost { /* Retrieve the invoker for a function object. */ template<> - struct BOOST_FUNCTION_GET_INVOKER + struct get_invoker { template @@ -384,7 +383,7 @@ namespace boost { /* Retrieve the invoker for a reference to a function object. */ template<> - struct BOOST_FUNCTION_GET_INVOKER + struct get_invoker { template @@ -833,7 +832,7 @@ namespace boost { using boost::detail::function::vtable_base; typedef typename boost::detail::function::get_function_tag::type tag; - typedef boost::detail::function::BOOST_FUNCTION_GET_INVOKER get_invoker; + typedef boost::detail::function::get_invoker get_invoker; typedef typename get_invoker:: template apply @@ -867,7 +866,7 @@ namespace boost { using boost::detail::function::vtable_base; typedef typename boost::detail::function::get_function_tag::type tag; - typedef boost::detail::function::BOOST_FUNCTION_GET_INVOKER get_invoker; + typedef boost::detail::function::get_invoker get_invoker; typedef typename get_invoker:: template apply_a @@ -1068,7 +1067,6 @@ class function // Cleanup after ourselves... #undef BOOST_FUNCTION_VTABLE #undef BOOST_FUNCTION_COMMA -#undef BOOST_FUNCTION_GET_INVOKER #undef BOOST_FUNCTION_TEMPLATE_PARMS #undef BOOST_FUNCTION_TEMPLATE_ARGS #undef BOOST_FUNCTION_PARMS From 5b5b2de46176419daa7247d1bd211b7e56f33623 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 28 Jan 2024 03:01:14 +0200 Subject: [PATCH 066/115] Remove uses of BOOST_FUNCTION_VTABLE --- include/boost/function/function_template.hpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 9b3af0de..6d8e4d0f 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -26,9 +26,6 @@ // Always have commas (zero args case is handled with variadics too) #define BOOST_FUNCTION_COMMA , -// Class names used in this version of the code -#define BOOST_FUNCTION_VTABLE basic_vtable - #define BOOST_FUNCTION_VOID_RETURN_TYPE void #define BOOST_FUNCTION_RETURN(X) X @@ -423,7 +420,7 @@ namespace boost { * destructors, base classes, etc. */ template - struct BOOST_FUNCTION_VTABLE + struct basic_vtable { typedef R result_type; @@ -630,7 +627,7 @@ namespace boost { typedef R result_type; private: - typedef boost::detail::function::BOOST_FUNCTION_VTABLE< + typedef boost::detail::function::basic_vtable< R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS> vtable_type; @@ -1065,7 +1062,6 @@ class function } // end namespace boost // Cleanup after ourselves... -#undef BOOST_FUNCTION_VTABLE #undef BOOST_FUNCTION_COMMA #undef BOOST_FUNCTION_TEMPLATE_PARMS #undef BOOST_FUNCTION_TEMPLATE_ARGS From 52ff7423b7507c733298d13aabcef045dde15bb9 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 28 Jan 2024 03:02:55 +0200 Subject: [PATCH 067/115] Remove uses of BOOST_FUNCTION_COMMA --- include/boost/function/function_template.hpp | 130 +++++++++---------- 1 file changed, 63 insertions(+), 67 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 6d8e4d0f..796cf6c1 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -23,9 +23,6 @@ #define BOOST_FUNCTION_PARMS T... a #define BOOST_FUNCTION_ARGS static_cast(a)... -// Always have commas (zero args case is handled with variadics too) -#define BOOST_FUNCTION_COMMA , - #define BOOST_FUNCTION_VOID_RETURN_TYPE void #define BOOST_FUNCTION_RETURN(X) X @@ -34,12 +31,12 @@ namespace boost { namespace function { template< typename FunctionPtr, - typename R BOOST_FUNCTION_COMMA + typename R, BOOST_FUNCTION_TEMPLATE_PARMS > struct function_invoker { - static R invoke(function_buffer& function_ptr BOOST_FUNCTION_COMMA + static R invoke(function_buffer& function_ptr, BOOST_FUNCTION_PARMS) { FunctionPtr f = reinterpret_cast(function_ptr.members.func_ptr); @@ -49,13 +46,13 @@ namespace boost { template< typename FunctionPtr, - typename R BOOST_FUNCTION_COMMA + typename R, BOOST_FUNCTION_TEMPLATE_PARMS > struct void_function_invoker { static BOOST_FUNCTION_VOID_RETURN_TYPE - invoke(function_buffer& function_ptr BOOST_FUNCTION_COMMA + invoke(function_buffer& function_ptr, BOOST_FUNCTION_PARMS) { @@ -66,12 +63,12 @@ namespace boost { template< typename FunctionObj, - typename R BOOST_FUNCTION_COMMA + typename R, BOOST_FUNCTION_TEMPLATE_PARMS > struct function_obj_invoker { - static R invoke(function_buffer& function_obj_ptr BOOST_FUNCTION_COMMA + static R invoke(function_buffer& function_obj_ptr, BOOST_FUNCTION_PARMS) { @@ -86,13 +83,13 @@ namespace boost { template< typename FunctionObj, - typename R BOOST_FUNCTION_COMMA + typename R, BOOST_FUNCTION_TEMPLATE_PARMS > struct void_function_obj_invoker { static BOOST_FUNCTION_VOID_RETURN_TYPE - invoke(function_buffer& function_obj_ptr BOOST_FUNCTION_COMMA + invoke(function_buffer& function_obj_ptr, BOOST_FUNCTION_PARMS) { @@ -107,12 +104,12 @@ namespace boost { template< typename FunctionObj, - typename R BOOST_FUNCTION_COMMA + typename R, BOOST_FUNCTION_TEMPLATE_PARMS > struct function_ref_invoker { - static R invoke(function_buffer& function_obj_ptr BOOST_FUNCTION_COMMA + static R invoke(function_buffer& function_obj_ptr, BOOST_FUNCTION_PARMS) { @@ -124,13 +121,13 @@ namespace boost { template< typename FunctionObj, - typename R BOOST_FUNCTION_COMMA + typename R, BOOST_FUNCTION_TEMPLATE_PARMS > struct void_function_ref_invoker { static BOOST_FUNCTION_VOID_RETURN_TYPE - invoke(function_buffer& function_obj_ptr BOOST_FUNCTION_COMMA + invoke(function_buffer& function_obj_ptr, BOOST_FUNCTION_PARMS) { @@ -144,12 +141,12 @@ namespace boost { /* Handle invocation of member pointers. */ template< typename MemberPtr, - typename R BOOST_FUNCTION_COMMA + typename R, BOOST_FUNCTION_TEMPLATE_PARMS > struct member_invoker { - static R invoke(function_buffer& function_obj_ptr BOOST_FUNCTION_COMMA + static R invoke(function_buffer& function_obj_ptr, BOOST_FUNCTION_PARMS) { @@ -161,13 +158,13 @@ namespace boost { template< typename MemberPtr, - typename R BOOST_FUNCTION_COMMA + typename R, BOOST_FUNCTION_TEMPLATE_PARMS > struct void_member_invoker { static BOOST_FUNCTION_VOID_RETURN_TYPE - invoke(function_buffer& function_obj_ptr BOOST_FUNCTION_COMMA + invoke(function_buffer& function_obj_ptr, BOOST_FUNCTION_PARMS) { @@ -180,7 +177,7 @@ namespace boost { template< typename FunctionPtr, - typename R BOOST_FUNCTION_COMMA + typename R, BOOST_FUNCTION_TEMPLATE_PARMS > struct get_function_invoker @@ -188,12 +185,12 @@ namespace boost { typedef typename conditional<(is_void::value), void_function_invoker< FunctionPtr, - R BOOST_FUNCTION_COMMA + R, BOOST_FUNCTION_TEMPLATE_ARGS >, function_invoker< FunctionPtr, - R BOOST_FUNCTION_COMMA + R, BOOST_FUNCTION_TEMPLATE_ARGS > >::type type; @@ -201,7 +198,7 @@ namespace boost { template< typename FunctionObj, - typename R BOOST_FUNCTION_COMMA + typename R, BOOST_FUNCTION_TEMPLATE_PARMS > struct get_function_obj_invoker @@ -209,12 +206,12 @@ namespace boost { typedef typename conditional<(is_void::value), void_function_obj_invoker< FunctionObj, - R BOOST_FUNCTION_COMMA + R, BOOST_FUNCTION_TEMPLATE_ARGS >, function_obj_invoker< FunctionObj, - R BOOST_FUNCTION_COMMA + R, BOOST_FUNCTION_TEMPLATE_ARGS > >::type type; @@ -222,7 +219,7 @@ namespace boost { template< typename FunctionObj, - typename R BOOST_FUNCTION_COMMA + typename R, BOOST_FUNCTION_TEMPLATE_PARMS > struct get_function_ref_invoker @@ -230,12 +227,12 @@ namespace boost { typedef typename conditional<(is_void::value), void_function_ref_invoker< FunctionObj, - R BOOST_FUNCTION_COMMA + R, BOOST_FUNCTION_TEMPLATE_ARGS >, function_ref_invoker< FunctionObj, - R BOOST_FUNCTION_COMMA + R, BOOST_FUNCTION_TEMPLATE_ARGS > >::type type; @@ -245,7 +242,7 @@ namespace boost { /* Retrieve the appropriate invoker for a member pointer. */ template< typename MemberPtr, - typename R BOOST_FUNCTION_COMMA + typename R, BOOST_FUNCTION_TEMPLATE_PARMS > struct get_member_invoker @@ -253,12 +250,12 @@ namespace boost { typedef typename conditional<(is_void::value), void_member_invoker< MemberPtr, - R BOOST_FUNCTION_COMMA + R, BOOST_FUNCTION_TEMPLATE_ARGS >, member_invoker< MemberPtr, - R BOOST_FUNCTION_COMMA + R, BOOST_FUNCTION_TEMPLATE_ARGS > >::type type; @@ -282,12 +279,12 @@ namespace boost { struct get_invoker { template + typename R, BOOST_FUNCTION_TEMPLATE_PARMS> struct apply { typedef typename get_function_invoker< FunctionPtr, - R BOOST_FUNCTION_COMMA + R, BOOST_FUNCTION_TEMPLATE_ARGS >::type invoker_type; @@ -296,12 +293,12 @@ namespace boost { }; template + typename R, BOOST_FUNCTION_TEMPLATE_PARMS> struct apply_a { typedef typename get_function_invoker< FunctionPtr, - R BOOST_FUNCTION_COMMA + R, BOOST_FUNCTION_TEMPLATE_ARGS >::type invoker_type; @@ -316,12 +313,12 @@ namespace boost { struct get_invoker { template + typename R, BOOST_FUNCTION_TEMPLATE_PARMS> struct apply { typedef typename get_member_invoker< MemberPtr, - R BOOST_FUNCTION_COMMA + R, BOOST_FUNCTION_TEMPLATE_ARGS >::type invoker_type; @@ -330,12 +327,12 @@ namespace boost { }; template + typename R, BOOST_FUNCTION_TEMPLATE_PARMS> struct apply_a { typedef typename get_member_invoker< MemberPtr, - R BOOST_FUNCTION_COMMA + R, BOOST_FUNCTION_TEMPLATE_ARGS >::type invoker_type; @@ -350,12 +347,12 @@ namespace boost { struct get_invoker { template + typename R, BOOST_FUNCTION_TEMPLATE_PARMS> struct apply { typedef typename get_function_obj_invoker< FunctionObj, - R BOOST_FUNCTION_COMMA + R, BOOST_FUNCTION_TEMPLATE_ARGS >::type invoker_type; @@ -364,12 +361,12 @@ namespace boost { }; template + typename R, BOOST_FUNCTION_TEMPLATE_PARMS> struct apply_a { typedef typename get_function_obj_invoker< FunctionObj, - R BOOST_FUNCTION_COMMA + R, BOOST_FUNCTION_TEMPLATE_ARGS >::type invoker_type; @@ -383,12 +380,12 @@ namespace boost { struct get_invoker { template + typename R, BOOST_FUNCTION_TEMPLATE_PARMS> struct apply { typedef typename get_function_ref_invoker< typename RefWrapper::type, - R BOOST_FUNCTION_COMMA + R, BOOST_FUNCTION_TEMPLATE_ARGS >::type invoker_type; @@ -397,12 +394,12 @@ namespace boost { }; template + typename R, BOOST_FUNCTION_TEMPLATE_PARMS> struct apply_a { typedef typename get_function_ref_invoker< typename RefWrapper::type, - R BOOST_FUNCTION_COMMA + R, BOOST_FUNCTION_TEMPLATE_ARGS >::type invoker_type; @@ -419,13 +416,13 @@ namespace boost { * members. It therefore cannot have any constructors, * destructors, base classes, etc. */ - template + template struct basic_vtable { typedef R result_type; typedef result_type (*invoker_type)(function_buffer& - BOOST_FUNCTION_COMMA + , BOOST_FUNCTION_TEMPLATE_ARGS); template @@ -617,7 +614,7 @@ namespace boost { } // end namespace detail template< - typename R BOOST_FUNCTION_COMMA + typename R, BOOST_FUNCTION_TEMPLATE_PARMS > class function_n : public function_base @@ -628,7 +625,7 @@ namespace boost { private: typedef boost::detail::function::basic_vtable< - R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS> + R, BOOST_FUNCTION_TEMPLATE_ARGS> vtable_type; vtable_type* get_vtable() const { @@ -695,7 +692,7 @@ namespace boost { boost::throw_exception(bad_function_call()); return get_vtable()->invoker - (this->functor BOOST_FUNCTION_COMMA BOOST_FUNCTION_ARGS); + (this->functor, BOOST_FUNCTION_ARGS); } // The distinction between when to use function_n and @@ -831,7 +828,7 @@ namespace boost { typedef typename boost::detail::function::get_function_tag::type tag; typedef boost::detail::function::get_invoker get_invoker; typedef typename get_invoker:: - template apply handler_type; @@ -865,7 +862,7 @@ namespace boost { typedef typename boost::detail::function::get_function_tag::type tag; typedef boost::detail::function::get_invoker get_invoker; typedef typename get_invoker:: - template apply_a handler_type; @@ -942,13 +939,13 @@ namespace boost { } }; - template + template inline void swap(function_n< - R BOOST_FUNCTION_COMMA + R, BOOST_FUNCTION_TEMPLATE_ARGS >& f1, function_n< - R BOOST_FUNCTION_COMMA + R, BOOST_FUNCTION_TEMPLATE_ARGS >& f2) { @@ -956,29 +953,29 @@ namespace boost { } // Poison comparisons between boost::function objects of the same type. -template +template void operator==(const function_n< - R BOOST_FUNCTION_COMMA + R, BOOST_FUNCTION_TEMPLATE_ARGS>&, const function_n< - R BOOST_FUNCTION_COMMA + R, BOOST_FUNCTION_TEMPLATE_ARGS>&); -template +template void operator!=(const function_n< - R BOOST_FUNCTION_COMMA + R, BOOST_FUNCTION_TEMPLATE_ARGS>&, const function_n< - R BOOST_FUNCTION_COMMA + R, BOOST_FUNCTION_TEMPLATE_ARGS>& ); #define BOOST_FUNCTION_PARTIAL_SPEC R (BOOST_FUNCTION_TEMPLATE_ARGS) -template class function - : public function_n + : public function_n { - typedef function_n base_type; + typedef function_n base_type; typedef function self_type; struct clear_type {}; @@ -1062,7 +1059,6 @@ class function } // end namespace boost // Cleanup after ourselves... -#undef BOOST_FUNCTION_COMMA #undef BOOST_FUNCTION_TEMPLATE_PARMS #undef BOOST_FUNCTION_TEMPLATE_ARGS #undef BOOST_FUNCTION_PARMS From bf2b23d40f78f4d28db56420ab65a63ee7e607a1 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 28 Jan 2024 03:03:38 +0200 Subject: [PATCH 068/115] Remove uses of BOOST_FUNCTION_TEMPLATE_PARMS --- include/boost/function/function_template.hpp | 54 ++++++++++---------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 796cf6c1..032dd83c 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -18,7 +18,6 @@ # pragma warning( disable : 4127 ) // "conditional expression is constant" #endif -#define BOOST_FUNCTION_TEMPLATE_PARMS typename... T #define BOOST_FUNCTION_TEMPLATE_ARGS T... #define BOOST_FUNCTION_PARMS T... a #define BOOST_FUNCTION_ARGS static_cast(a)... @@ -32,7 +31,7 @@ namespace boost { template< typename FunctionPtr, typename R, - BOOST_FUNCTION_TEMPLATE_PARMS + typename... T > struct function_invoker { @@ -47,7 +46,7 @@ namespace boost { template< typename FunctionPtr, typename R, - BOOST_FUNCTION_TEMPLATE_PARMS + typename... T > struct void_function_invoker { @@ -64,7 +63,7 @@ namespace boost { template< typename FunctionObj, typename R, - BOOST_FUNCTION_TEMPLATE_PARMS + typename... T > struct function_obj_invoker { @@ -84,7 +83,7 @@ namespace boost { template< typename FunctionObj, typename R, - BOOST_FUNCTION_TEMPLATE_PARMS + typename... T > struct void_function_obj_invoker { @@ -105,7 +104,7 @@ namespace boost { template< typename FunctionObj, typename R, - BOOST_FUNCTION_TEMPLATE_PARMS + typename... T > struct function_ref_invoker { @@ -122,7 +121,7 @@ namespace boost { template< typename FunctionObj, typename R, - BOOST_FUNCTION_TEMPLATE_PARMS + typename... T > struct void_function_ref_invoker { @@ -142,7 +141,7 @@ namespace boost { template< typename MemberPtr, typename R, - BOOST_FUNCTION_TEMPLATE_PARMS + typename... T > struct member_invoker { @@ -159,7 +158,7 @@ namespace boost { template< typename MemberPtr, typename R, - BOOST_FUNCTION_TEMPLATE_PARMS + typename... T > struct void_member_invoker { @@ -178,7 +177,7 @@ namespace boost { template< typename FunctionPtr, typename R, - BOOST_FUNCTION_TEMPLATE_PARMS + typename... T > struct get_function_invoker { @@ -199,7 +198,7 @@ namespace boost { template< typename FunctionObj, typename R, - BOOST_FUNCTION_TEMPLATE_PARMS + typename... T > struct get_function_obj_invoker { @@ -220,7 +219,7 @@ namespace boost { template< typename FunctionObj, typename R, - BOOST_FUNCTION_TEMPLATE_PARMS + typename... T > struct get_function_ref_invoker { @@ -243,7 +242,7 @@ namespace boost { template< typename MemberPtr, typename R, - BOOST_FUNCTION_TEMPLATE_PARMS + typename... T > struct get_member_invoker { @@ -279,7 +278,7 @@ namespace boost { struct get_invoker { template + typename R, typename... T> struct apply { typedef typename get_function_invoker< @@ -293,7 +292,7 @@ namespace boost { }; template + typename R, typename... T> struct apply_a { typedef typename get_function_invoker< @@ -313,7 +312,7 @@ namespace boost { struct get_invoker { template + typename R, typename... T> struct apply { typedef typename get_member_invoker< @@ -327,7 +326,7 @@ namespace boost { }; template + typename R, typename... T> struct apply_a { typedef typename get_member_invoker< @@ -347,7 +346,7 @@ namespace boost { struct get_invoker { template + typename R, typename... T> struct apply { typedef typename get_function_obj_invoker< @@ -361,7 +360,7 @@ namespace boost { }; template + typename R, typename... T> struct apply_a { typedef typename get_function_obj_invoker< @@ -380,7 +379,7 @@ namespace boost { struct get_invoker { template + typename R, typename... T> struct apply { typedef typename get_function_ref_invoker< @@ -394,7 +393,7 @@ namespace boost { }; template + typename R, typename... T> struct apply_a { typedef typename get_function_ref_invoker< @@ -416,7 +415,7 @@ namespace boost { * members. It therefore cannot have any constructors, * destructors, base classes, etc. */ - template + template struct basic_vtable { typedef R result_type; @@ -615,7 +614,7 @@ namespace boost { template< typename R, - BOOST_FUNCTION_TEMPLATE_PARMS + typename... T > class function_n : public function_base , public detail::function::variadic_function_base @@ -939,7 +938,7 @@ namespace boost { } }; - template + template inline void swap(function_n< R, BOOST_FUNCTION_TEMPLATE_ARGS @@ -953,14 +952,14 @@ namespace boost { } // Poison comparisons between boost::function objects of the same type. -template +template void operator==(const function_n< R, BOOST_FUNCTION_TEMPLATE_ARGS>&, const function_n< R, BOOST_FUNCTION_TEMPLATE_ARGS>&); -template +template void operator!=(const function_n< R, BOOST_FUNCTION_TEMPLATE_ARGS>&, @@ -971,7 +970,7 @@ template #define BOOST_FUNCTION_PARTIAL_SPEC R (BOOST_FUNCTION_TEMPLATE_ARGS) template + typename... T> class function : public function_n { @@ -1059,7 +1058,6 @@ class function } // end namespace boost // Cleanup after ourselves... -#undef BOOST_FUNCTION_TEMPLATE_PARMS #undef BOOST_FUNCTION_TEMPLATE_ARGS #undef BOOST_FUNCTION_PARMS #undef BOOST_FUNCTION_PARM From fa845b2fe3d805fe416b2a64ad587a0cc0dca3de Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 28 Jan 2024 03:04:43 +0200 Subject: [PATCH 069/115] Remove uses of BOOST_FUNCTION_TEMPLATE_ARGS --- include/boost/function/function_template.hpp | 60 ++++++++++---------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 032dd83c..287110b2 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -18,7 +18,6 @@ # pragma warning( disable : 4127 ) // "conditional expression is constant" #endif -#define BOOST_FUNCTION_TEMPLATE_ARGS T... #define BOOST_FUNCTION_PARMS T... a #define BOOST_FUNCTION_ARGS static_cast(a)... @@ -185,12 +184,12 @@ namespace boost { void_function_invoker< FunctionPtr, R, - BOOST_FUNCTION_TEMPLATE_ARGS + T... >, function_invoker< FunctionPtr, R, - BOOST_FUNCTION_TEMPLATE_ARGS + T... > >::type type; }; @@ -206,12 +205,12 @@ namespace boost { void_function_obj_invoker< FunctionObj, R, - BOOST_FUNCTION_TEMPLATE_ARGS + T... >, function_obj_invoker< FunctionObj, R, - BOOST_FUNCTION_TEMPLATE_ARGS + T... > >::type type; }; @@ -227,12 +226,12 @@ namespace boost { void_function_ref_invoker< FunctionObj, R, - BOOST_FUNCTION_TEMPLATE_ARGS + T... >, function_ref_invoker< FunctionObj, R, - BOOST_FUNCTION_TEMPLATE_ARGS + T... > >::type type; }; @@ -250,12 +249,12 @@ namespace boost { void_member_invoker< MemberPtr, R, - BOOST_FUNCTION_TEMPLATE_ARGS + T... >, member_invoker< MemberPtr, R, - BOOST_FUNCTION_TEMPLATE_ARGS + T... > >::type type; }; @@ -284,7 +283,7 @@ namespace boost { typedef typename get_function_invoker< FunctionPtr, R, - BOOST_FUNCTION_TEMPLATE_ARGS + T... >::type invoker_type; @@ -298,7 +297,7 @@ namespace boost { typedef typename get_function_invoker< FunctionPtr, R, - BOOST_FUNCTION_TEMPLATE_ARGS + T... >::type invoker_type; @@ -318,7 +317,7 @@ namespace boost { typedef typename get_member_invoker< MemberPtr, R, - BOOST_FUNCTION_TEMPLATE_ARGS + T... >::type invoker_type; @@ -332,7 +331,7 @@ namespace boost { typedef typename get_member_invoker< MemberPtr, R, - BOOST_FUNCTION_TEMPLATE_ARGS + T... >::type invoker_type; @@ -352,7 +351,7 @@ namespace boost { typedef typename get_function_obj_invoker< FunctionObj, R, - BOOST_FUNCTION_TEMPLATE_ARGS + T... >::type invoker_type; @@ -366,7 +365,7 @@ namespace boost { typedef typename get_function_obj_invoker< FunctionObj, R, - BOOST_FUNCTION_TEMPLATE_ARGS + T... >::type invoker_type; @@ -385,7 +384,7 @@ namespace boost { typedef typename get_function_ref_invoker< typename RefWrapper::type, R, - BOOST_FUNCTION_TEMPLATE_ARGS + T... >::type invoker_type; @@ -399,7 +398,7 @@ namespace boost { typedef typename get_function_ref_invoker< typename RefWrapper::type, R, - BOOST_FUNCTION_TEMPLATE_ARGS + T... >::type invoker_type; @@ -422,7 +421,7 @@ namespace boost { typedef result_type (*invoker_type)(function_buffer& , - BOOST_FUNCTION_TEMPLATE_ARGS); + T...); template bool assign_to(F f, function_buffer& functor) const @@ -624,7 +623,7 @@ namespace boost { private: typedef boost::detail::function::basic_vtable< - R, BOOST_FUNCTION_TEMPLATE_ARGS> + R, T...> vtable_type; vtable_type* get_vtable() const { @@ -828,7 +827,7 @@ namespace boost { typedef boost::detail::function::get_invoker get_invoker; typedef typename get_invoker:: template apply + T...> handler_type; typedef typename handler_type::invoker_type invoker_type; @@ -862,7 +861,7 @@ namespace boost { typedef boost::detail::function::get_invoker get_invoker; typedef typename get_invoker:: template apply_a + T...> handler_type; typedef typename handler_type::invoker_type invoker_type; @@ -941,11 +940,11 @@ namespace boost { template inline void swap(function_n< R, - BOOST_FUNCTION_TEMPLATE_ARGS + T... >& f1, function_n< R, - BOOST_FUNCTION_TEMPLATE_ARGS + T... >& f2) { f1.swap(f2); @@ -955,26 +954,26 @@ namespace boost { template void operator==(const function_n< R, - BOOST_FUNCTION_TEMPLATE_ARGS>&, + T...>&, const function_n< R, - BOOST_FUNCTION_TEMPLATE_ARGS>&); + T...>&); template void operator!=(const function_n< R, - BOOST_FUNCTION_TEMPLATE_ARGS>&, + T...>&, const function_n< R, - BOOST_FUNCTION_TEMPLATE_ARGS>& ); + T...>& ); -#define BOOST_FUNCTION_PARTIAL_SPEC R (BOOST_FUNCTION_TEMPLATE_ARGS) +#define BOOST_FUNCTION_PARTIAL_SPEC R (T...) template class function - : public function_n + : public function_n { - typedef function_n base_type; + typedef function_n base_type; typedef function self_type; struct clear_type {}; @@ -1058,7 +1057,6 @@ class function } // end namespace boost // Cleanup after ourselves... -#undef BOOST_FUNCTION_TEMPLATE_ARGS #undef BOOST_FUNCTION_PARMS #undef BOOST_FUNCTION_PARM #ifdef BOOST_FUNCTION_ARG From a3249ce5dbe30c28697aaabd4358084c42a28064 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 28 Jan 2024 03:06:03 +0200 Subject: [PATCH 070/115] Remove uses of BOOST_FUNCTION_PARMS --- include/boost/function/function_template.hpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 287110b2..3a1d3f7e 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -18,7 +18,6 @@ # pragma warning( disable : 4127 ) // "conditional expression is constant" #endif -#define BOOST_FUNCTION_PARMS T... a #define BOOST_FUNCTION_ARGS static_cast(a)... #define BOOST_FUNCTION_VOID_RETURN_TYPE void @@ -35,7 +34,7 @@ namespace boost { struct function_invoker { static R invoke(function_buffer& function_ptr, - BOOST_FUNCTION_PARMS) + T... a) { FunctionPtr f = reinterpret_cast(function_ptr.members.func_ptr); return f(BOOST_FUNCTION_ARGS); @@ -51,7 +50,7 @@ namespace boost { { static BOOST_FUNCTION_VOID_RETURN_TYPE invoke(function_buffer& function_ptr, - BOOST_FUNCTION_PARMS) + T... a) { FunctionPtr f = reinterpret_cast(function_ptr.members.func_ptr); @@ -67,7 +66,7 @@ namespace boost { struct function_obj_invoker { static R invoke(function_buffer& function_obj_ptr, - BOOST_FUNCTION_PARMS) + T... a) { FunctionObj* f; @@ -88,7 +87,7 @@ namespace boost { { static BOOST_FUNCTION_VOID_RETURN_TYPE invoke(function_buffer& function_obj_ptr, - BOOST_FUNCTION_PARMS) + T... a) { FunctionObj* f; @@ -108,7 +107,7 @@ namespace boost { struct function_ref_invoker { static R invoke(function_buffer& function_obj_ptr, - BOOST_FUNCTION_PARMS) + T... a) { FunctionObj* f = @@ -126,7 +125,7 @@ namespace boost { { static BOOST_FUNCTION_VOID_RETURN_TYPE invoke(function_buffer& function_obj_ptr, - BOOST_FUNCTION_PARMS) + T... a) { FunctionObj* f = @@ -145,7 +144,7 @@ namespace boost { struct member_invoker { static R invoke(function_buffer& function_obj_ptr, - BOOST_FUNCTION_PARMS) + T... a) { MemberPtr* f = @@ -163,7 +162,7 @@ namespace boost { { static BOOST_FUNCTION_VOID_RETURN_TYPE invoke(function_buffer& function_obj_ptr, - BOOST_FUNCTION_PARMS) + T... a) { MemberPtr* f = @@ -684,7 +683,7 @@ namespace boost { ~function_n() { clear(); } - result_type operator()(BOOST_FUNCTION_PARMS) const + result_type operator()(T... a) const { if (this->empty()) boost::throw_exception(bad_function_call()); @@ -1057,7 +1056,6 @@ class function } // end namespace boost // Cleanup after ourselves... -#undef BOOST_FUNCTION_PARMS #undef BOOST_FUNCTION_PARM #ifdef BOOST_FUNCTION_ARG # undef BOOST_FUNCTION_ARG From 8ce457b1612d92f35920ef34e9c4e881e92fa3c5 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 28 Jan 2024 03:07:18 +0200 Subject: [PATCH 071/115] Remove uses of BOOST_FUNCTION_ARGS --- include/boost/function/function_template.hpp | 21 +++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 3a1d3f7e..444577d5 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -18,8 +18,6 @@ # pragma warning( disable : 4127 ) // "conditional expression is constant" #endif -#define BOOST_FUNCTION_ARGS static_cast(a)... - #define BOOST_FUNCTION_VOID_RETURN_TYPE void #define BOOST_FUNCTION_RETURN(X) X @@ -37,7 +35,7 @@ namespace boost { T... a) { FunctionPtr f = reinterpret_cast(function_ptr.members.func_ptr); - return f(BOOST_FUNCTION_ARGS); + return f(static_cast(a)...); } }; @@ -54,7 +52,7 @@ namespace boost { { FunctionPtr f = reinterpret_cast(function_ptr.members.func_ptr); - BOOST_FUNCTION_RETURN(f(BOOST_FUNCTION_ARGS)); + BOOST_FUNCTION_RETURN(f(static_cast(a)...)); } }; @@ -74,7 +72,7 @@ namespace boost { f = reinterpret_cast(function_obj_ptr.data); else f = reinterpret_cast(function_obj_ptr.members.obj_ptr); - return (*f)(BOOST_FUNCTION_ARGS); + return (*f)(static_cast(a)...); } }; @@ -95,7 +93,7 @@ namespace boost { f = reinterpret_cast(function_obj_ptr.data); else f = reinterpret_cast(function_obj_ptr.members.obj_ptr); - BOOST_FUNCTION_RETURN((*f)(BOOST_FUNCTION_ARGS)); + BOOST_FUNCTION_RETURN((*f)(static_cast(a)...)); } }; @@ -112,7 +110,7 @@ namespace boost { { FunctionObj* f = reinterpret_cast(function_obj_ptr.members.obj_ptr); - return (*f)(BOOST_FUNCTION_ARGS); + return (*f)(static_cast(a)...); } }; @@ -130,7 +128,7 @@ namespace boost { { FunctionObj* f = reinterpret_cast(function_obj_ptr.members.obj_ptr); - BOOST_FUNCTION_RETURN((*f)(BOOST_FUNCTION_ARGS)); + BOOST_FUNCTION_RETURN((*f)(static_cast(a)...)); } }; @@ -149,7 +147,7 @@ namespace boost { { MemberPtr* f = reinterpret_cast(function_obj_ptr.data); - return boost::mem_fn(*f)(BOOST_FUNCTION_ARGS); + return boost::mem_fn(*f)(static_cast(a)...); } }; @@ -167,7 +165,7 @@ namespace boost { { MemberPtr* f = reinterpret_cast(function_obj_ptr.data); - BOOST_FUNCTION_RETURN(boost::mem_fn(*f)(BOOST_FUNCTION_ARGS)); + BOOST_FUNCTION_RETURN(boost::mem_fn(*f)(static_cast(a)...)); } }; #endif @@ -689,7 +687,7 @@ namespace boost { boost::throw_exception(bad_function_call()); return get_vtable()->invoker - (this->functor, BOOST_FUNCTION_ARGS); + (this->functor, static_cast(a)...); } // The distinction between when to use function_n and @@ -1060,7 +1058,6 @@ class function #ifdef BOOST_FUNCTION_ARG # undef BOOST_FUNCTION_ARG #endif -#undef BOOST_FUNCTION_ARGS #undef BOOST_FUNCTION_ARG_TYPE #undef BOOST_FUNCTION_ARG_TYPES #undef BOOST_FUNCTION_VOID_RETURN_TYPE From a46646ecaa038bede9452b401e70fdb621fb2deb Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 28 Jan 2024 03:07:55 +0200 Subject: [PATCH 072/115] Remove uses of BOOST_FUNCTION_VOID_RETURN_TYPE --- include/boost/function/function_template.hpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 444577d5..7072ca73 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -18,7 +18,6 @@ # pragma warning( disable : 4127 ) // "conditional expression is constant" #endif -#define BOOST_FUNCTION_VOID_RETURN_TYPE void #define BOOST_FUNCTION_RETURN(X) X namespace boost { @@ -46,7 +45,7 @@ namespace boost { > struct void_function_invoker { - static BOOST_FUNCTION_VOID_RETURN_TYPE + static void invoke(function_buffer& function_ptr, T... a) @@ -83,7 +82,7 @@ namespace boost { > struct void_function_obj_invoker { - static BOOST_FUNCTION_VOID_RETURN_TYPE + static void invoke(function_buffer& function_obj_ptr, T... a) @@ -121,7 +120,7 @@ namespace boost { > struct void_function_ref_invoker { - static BOOST_FUNCTION_VOID_RETURN_TYPE + static void invoke(function_buffer& function_obj_ptr, T... a) @@ -158,7 +157,7 @@ namespace boost { > struct void_member_invoker { - static BOOST_FUNCTION_VOID_RETURN_TYPE + static void invoke(function_buffer& function_obj_ptr, T... a) @@ -1060,7 +1059,6 @@ class function #endif #undef BOOST_FUNCTION_ARG_TYPE #undef BOOST_FUNCTION_ARG_TYPES -#undef BOOST_FUNCTION_VOID_RETURN_TYPE #undef BOOST_FUNCTION_RETURN #if defined(BOOST_MSVC) From 0601af0be4fa66c268f91150e6882dfc3127c4f3 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 28 Jan 2024 03:09:43 +0200 Subject: [PATCH 073/115] Remove uses of BOOST_FUNCTION_RETURN --- include/boost/function/function_template.hpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 7072ca73..10188dbd 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -18,8 +18,6 @@ # pragma warning( disable : 4127 ) // "conditional expression is constant" #endif -#define BOOST_FUNCTION_RETURN(X) X - namespace boost { namespace detail { namespace function { @@ -51,7 +49,7 @@ namespace boost { { FunctionPtr f = reinterpret_cast(function_ptr.members.func_ptr); - BOOST_FUNCTION_RETURN(f(static_cast(a)...)); + f(static_cast(a)...); } }; @@ -92,7 +90,7 @@ namespace boost { f = reinterpret_cast(function_obj_ptr.data); else f = reinterpret_cast(function_obj_ptr.members.obj_ptr); - BOOST_FUNCTION_RETURN((*f)(static_cast(a)...)); + (*f)(static_cast(a)...); } }; @@ -127,7 +125,7 @@ namespace boost { { FunctionObj* f = reinterpret_cast(function_obj_ptr.members.obj_ptr); - BOOST_FUNCTION_RETURN((*f)(static_cast(a)...)); + (*f)(static_cast(a)...); } }; @@ -164,7 +162,7 @@ namespace boost { { MemberPtr* f = reinterpret_cast(function_obj_ptr.data); - BOOST_FUNCTION_RETURN(boost::mem_fn(*f)(static_cast(a)...)); + boost::mem_fn(*f)(static_cast(a)...); } }; #endif @@ -1059,7 +1057,6 @@ class function #endif #undef BOOST_FUNCTION_ARG_TYPE #undef BOOST_FUNCTION_ARG_TYPES -#undef BOOST_FUNCTION_RETURN #if defined(BOOST_MSVC) # pragma warning( pop ) From 1e3d46915562c9cf27ca095061765569c43232ba Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 28 Jan 2024 03:11:20 +0200 Subject: [PATCH 074/115] Remove unnecessary undefs --- include/boost/function/function_template.hpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 10188dbd..691a72cd 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -1050,14 +1050,6 @@ class function } // end namespace boost -// Cleanup after ourselves... -#undef BOOST_FUNCTION_PARM -#ifdef BOOST_FUNCTION_ARG -# undef BOOST_FUNCTION_ARG -#endif -#undef BOOST_FUNCTION_ARG_TYPE -#undef BOOST_FUNCTION_ARG_TYPES - #if defined(BOOST_MSVC) # pragma warning( pop ) #endif From 6de542f1bc74d3a86863463cb9dd3154c551fbc0 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 28 Jan 2024 03:12:09 +0200 Subject: [PATCH 075/115] Remove uses of BOOST_FUNCTION_PARTIAL_SPEC --- include/boost/function/function_template.hpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 691a72cd..848c1d41 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -960,11 +960,9 @@ template R, T...>& ); -#define BOOST_FUNCTION_PARTIAL_SPEC R (T...) - template -class function +class function : public function_n { typedef function_n base_type; @@ -1046,8 +1044,6 @@ class function } }; -#undef BOOST_FUNCTION_PARTIAL_SPEC - } // end namespace boost #if defined(BOOST_MSVC) From 50ac0b74c968e43edc1dbdeb1c6c5c1ff26983a8 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 28 Jan 2024 03:14:16 +0200 Subject: [PATCH 076/115] Remove unnecessary ifs --- include/boost/function/function_template.hpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 848c1d41..36e5f196 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -129,7 +129,6 @@ namespace boost { } }; -#if BOOST_FUNCTION_NUM_ARGS > 0 /* Handle invocation of member pointers. */ template< typename MemberPtr, @@ -165,7 +164,6 @@ namespace boost { boost::mem_fn(*f)(static_cast(a)...); } }; -#endif template< typename FunctionPtr, @@ -230,7 +228,6 @@ namespace boost { >::type type; }; -#if BOOST_FUNCTION_NUM_ARGS > 0 /* Retrieve the appropriate invoker for a member pointer. */ template< typename MemberPtr, @@ -252,7 +249,6 @@ namespace boost { > >::type type; }; -#endif /* Given the tag returned by get_function_tag, retrieve the actual invoker that will be used for the given function @@ -299,7 +295,6 @@ namespace boost { }; }; -#if BOOST_FUNCTION_NUM_ARGS > 0 /* Retrieve the invoker for a member pointer. */ template<> struct get_invoker @@ -332,7 +327,6 @@ namespace boost { typedef functor_manager manager_type; }; }; -#endif /* Retrieve the invoker for a function object. */ template<> @@ -468,7 +462,6 @@ namespace boost { } // Member pointers -#if BOOST_FUNCTION_NUM_ARGS > 0 template bool assign_to(MemberPtr f, function_buffer& functor, member_ptr_tag) const { @@ -495,7 +488,6 @@ namespace boost { return false; } } -#endif // BOOST_FUNCTION_NUM_ARGS > 0 // Function objects // Assign to a function object using the small object optimization From 88da3c6568aba2ec36147dc70cd11d13eb341930 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 28 Jan 2024 04:01:00 +0200 Subject: [PATCH 077/115] Remove obsolete files --- .../function/detail/function_iterate.hpp | 16 -------- .../function/detail/gen_maybe_include.pl | 39 ------------------- include/boost/function/gen_function_N.pl | 26 ------------- 3 files changed, 81 deletions(-) delete mode 100644 include/boost/function/detail/function_iterate.hpp delete mode 100644 include/boost/function/detail/gen_maybe_include.pl delete mode 100644 include/boost/function/gen_function_N.pl diff --git a/include/boost/function/detail/function_iterate.hpp b/include/boost/function/detail/function_iterate.hpp deleted file mode 100644 index 5370b36a..00000000 --- a/include/boost/function/detail/function_iterate.hpp +++ /dev/null @@ -1,16 +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 -#if !defined(BOOST_PP_IS_ITERATING) -# error Boost.Function - do not include this file! -#endif - -#define BOOST_FUNCTION_NUM_ARGS BOOST_PP_ITERATION() -#include -#undef BOOST_FUNCTION_NUM_ARGS - diff --git a/include/boost/function/detail/gen_maybe_include.pl b/include/boost/function/detail/gen_maybe_include.pl deleted file mode 100644 index bc409840..00000000 --- a/include/boost/function/detail/gen_maybe_include.pl +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/perl -w -# -# Boost.Function library -# -# Copyright (C) 2001-2003 Douglas Gregor (gregod@cs.rpi.edu) -# -# Permission to copy, use, sell and distribute this software is granted -# provided this copyright notice appears in all copies. -# Permission to modify the code and to distribute modified code is granted -# provided this copyright notice appears in all copies, and a notice -# that the code was modified is included with the copyright notice. -# -# This software is provided "as is" without express or implied warranty, -# and with no claim as to its suitability for any purpose. -# -# For more information, see http://www.boost.org -use English; - -$max_args = $ARGV[0]; - -open (OUT, ">maybe_include.hpp") or die("Cannot write to maybe_include.hpp"); -for($on_arg = 0; $on_arg <= $max_args; ++$on_arg) { - if ($on_arg == 0) { - print OUT "#if"; - } - else { - print OUT "#elif"; - } - print OUT " BOOST_FUNCTION_NUM_ARGS == $on_arg\n"; - print OUT "# undef BOOST_FUNCTION_MAX_ARGS_DEFINED\n"; - print OUT "# define BOOST_FUNCTION_MAX_ARGS_DEFINED $on_arg\n"; - print OUT "# ifndef BOOST_FUNCTION_$on_arg\n"; - print OUT "# define BOOST_FUNCTION_$on_arg\n"; - print OUT "# include \n"; - print OUT "# endif\n"; -} -print OUT "#else\n"; -print OUT "# error Cannot handle Boost.Function objects that accept more than $max_args arguments!\n"; -print OUT "#endif\n"; diff --git a/include/boost/function/gen_function_N.pl b/include/boost/function/gen_function_N.pl deleted file mode 100644 index d8f1249b..00000000 --- a/include/boost/function/gen_function_N.pl +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/perl -w -# -# Boost.Function library -# -# Copyright Douglas Gregor 2001-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 -use English; - -if ($#ARGV < 0) { - print "Usage: perl gen_function_N \n"; - exit; -} - - -$totalNumArgs = $ARGV[0]; -for ($numArgs = 0; $numArgs <= $totalNumArgs; ++$numArgs) { - open OUT, ">function$numArgs.hpp"; - print OUT "#define BOOST_FUNCTION_NUM_ARGS $numArgs\n"; - print OUT "#include \n"; - print OUT "#undef BOOST_FUNCTION_NUM_ARGS\n"; - close OUT; -} From 6876969bfca3b83c90480f7e276b23f6f5a9310c Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 28 Jan 2024 05:13:54 +0200 Subject: [PATCH 078/115] Add include guards, move prologue/epilogue into function_template, remove unnecessary headers --- include/boost/function.hpp | 19 +++------ include/boost/function/detail/epilogue.hpp | 35 ---------------- .../boost/function/detail/maybe_include.hpp | 17 -------- include/boost/function/detail/prologue.hpp | 20 --------- include/boost/function/function0.hpp | 4 +- include/boost/function/function1.hpp | 4 +- include/boost/function/function10.hpp | 4 +- include/boost/function/function2.hpp | 4 +- include/boost/function/function3.hpp | 4 +- include/boost/function/function4.hpp | 4 +- include/boost/function/function5.hpp | 4 +- include/boost/function/function6.hpp | 4 +- include/boost/function/function7.hpp | 4 +- include/boost/function/function8.hpp | 4 +- include/boost/function/function9.hpp | 4 +- include/boost/function/function_template.hpp | 41 +++++++++++++++++-- 16 files changed, 54 insertions(+), 122 deletions(-) delete mode 100644 include/boost/function/detail/epilogue.hpp delete mode 100644 include/boost/function/detail/maybe_include.hpp delete mode 100644 include/boost/function/detail/prologue.hpp diff --git a/include/boost/function.hpp b/include/boost/function.hpp index d71264c5..6fd7388b 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 - -#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 +#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 03cc3aec..00000000 --- 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 e34e8256..00000000 --- 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 b0303fd6..00000000 --- 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 65a02e5f..b0275b26 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 90897151..b0275b26 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 65627248..b0275b26 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 dc8bf975..b0275b26 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 19d1a49d..b0275b26 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 f3349e2d..b0275b26 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 a1305eb5..b0275b26 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 1f609149..b0275b26 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 68542ed4..b0275b26 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 cf2c3766..b0275b26 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 590e0883..b0275b26 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 36e5f196..0746921a 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 @@ class function #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 From 3b48732773ed2381bd8003d876722a2fe3fa5dcc Mon Sep 17 00:00:00 2001 From: Brian Weed Date: Sun, 4 Feb 2024 14:25:58 -0500 Subject: [PATCH 079/115] Performance improvement Move functors where possible to reduce the number of copies (Lambdas with expensive-to-copy captures can be a bottleneck when copied) --- include/boost/function/function_base.hpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/boost/function/function_base.hpp b/include/boost/function/function_base.hpp index e8ffb06b..7f78e36e 100644 --- a/include/boost/function/function_base.hpp +++ b/include/boost/function/function_base.hpp @@ -262,16 +262,15 @@ namespace boost { manage_small(const function_buffer& in_buffer, function_buffer& out_buffer, functor_manager_operation_type op) { - if (op == clone_functor_tag || op == move_functor_tag) { + if (op == clone_functor_tag) { const functor_type* in_functor = reinterpret_cast(in_buffer.data); new (reinterpret_cast(out_buffer.data)) functor_type(*in_functor); - if (op == move_functor_tag) { + } else if (op == move_functor_tag) { functor_type* f = reinterpret_cast(in_buffer.data); - (void)f; // suppress warning about the value of f not being used (MSVC) + new (reinterpret_cast(out_buffer.data)) functor_type(std::move(*f)); f->~Functor(); - } } else if (op == destroy_functor_tag) { // Some compilers (Borland, vc6, ...) are unhappy with ~functor_type. functor_type* f = reinterpret_cast(out_buffer.data); From 7350f9b354ac1e7aac2877992a59b842d35ec27b Mon Sep 17 00:00:00 2001 From: Brian Weed Date: Sun, 4 Feb 2024 14:28:10 -0500 Subject: [PATCH 080/115] Performance Improvement Move functors where possible to reduce the number of copies (Lambdas with expensive-to-copy captures can be a bottleneck when copied) --- include/boost/function/function_template.hpp | 30 ++++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 0746921a..a33904b9 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -423,13 +423,13 @@ namespace boost { bool assign_to(F f, function_buffer& functor) const { typedef typename get_function_tag::type tag; - return assign_to(f, functor, tag()); + return assign_to(std::move(f), functor, tag()); } template bool assign_to_a(F f, function_buffer& functor, Allocator a) const { typedef typename get_function_tag::type tag; - return assign_to_a(f, functor, a, tag()); + return assign_to_a(std::move(f), functor, a, tag()); } void clear(function_buffer& functor) const @@ -456,7 +456,7 @@ namespace boost { if (f) { // should be a reinterpret cast, but some compilers insist // on giving cv-qualifiers to free functions - functor.members.func_ptr = reinterpret_cast(f); + functor.members.func_ptr = reinterpret_cast(f); return true; } else { return false; @@ -466,7 +466,7 @@ namespace boost { bool assign_to_a(FunctionPtr f, function_buffer& functor, Allocator, function_ptr_tag) const { - return assign_to(f,functor,function_ptr_tag()); + return assign_to(std::move(f),functor,function_ptr_tag()); } // Member pointers @@ -503,13 +503,13 @@ namespace boost { void assign_functor(FunctionObj f, function_buffer& functor, true_type) const { - new (reinterpret_cast(functor.data)) FunctionObj(f); + new (reinterpret_cast(functor.data)) FunctionObj(std::move(f)); } template void assign_functor_a(FunctionObj f, function_buffer& functor, Allocator, true_type) const { - assign_functor(f,functor,true_type()); + assign_functor(std::move(f),functor,true_type()); } // Assign to a function object allocated on the heap. @@ -517,7 +517,7 @@ namespace boost { void assign_functor(FunctionObj f, function_buffer& functor, false_type) const { - functor.members.obj_ptr = new FunctionObj(f); + functor.members.obj_ptr = new FunctionObj(std::move(f)); } template void @@ -541,7 +541,7 @@ namespace boost { assign_to(FunctionObj f, function_buffer& functor, function_obj_tag) const { if (!boost::detail::function::has_empty_target(boost::addressof(f))) { - assign_functor(f, functor, + assign_functor(std::move(f), functor, integral_constant::value)>()); return true; } else { @@ -553,7 +553,7 @@ namespace boost { assign_to_a(FunctionObj f, function_buffer& functor, Allocator a, function_obj_tag) const { if (!boost::detail::function::has_empty_target(boost::addressof(f))) { - assign_functor_a(f, functor, a, + assign_functor_a(std::move(f), functor, a, integral_constant::value)>()); return true; } else { @@ -651,7 +651,7 @@ namespace boost { ) : function_base() { - this->assign_to(f); + this->assign_to(std::move(f)); } template function_n(Functor f, Allocator a @@ -661,7 +661,7 @@ namespace boost { ) : function_base() { - this->assign_to_a(f,a); + this->assign_to_a(std::move(f),a); } function_n(clear_type*) : function_base() { } @@ -834,7 +834,7 @@ namespace boost { static const vtable_type stored_vtable = { { &manager_type::manage }, &invoker_type::invoke }; - if (stored_vtable.assign_to(f, functor)) { + if (stored_vtable.assign_to(std::move(f), functor)) { std::size_t value = reinterpret_cast(&stored_vtable.base); // coverity[pointless_expression]: suppress coverity warnings on apparant if(const). if (boost::has_trivial_copy_constructor::value && @@ -868,7 +868,7 @@ namespace boost { static const vtable_type stored_vtable = { { &manager_type::manage }, &invoker_type::invoke }; - if (stored_vtable.assign_to_a(f, functor, a)) { + if (stored_vtable.assign_to_a(std::move(f), functor, a)) { std::size_t value = reinterpret_cast(&stored_vtable.base); // coverity[pointless_expression]: suppress coverity warnings on apparant if(const). if (boost::has_trivial_copy_constructor::value && @@ -980,7 +980,7 @@ class function !(is_integral::value), int>::type = 0 ) : - base_type(f) + base_type(std::move(f)) { } template @@ -989,7 +989,7 @@ class function !(is_integral::value), int>::type = 0 ) : - base_type(f,a) + base_type(std::move(f),a) { } From 28b88d07bb4807445462c3f5dab0efde6f532d32 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 6 Feb 2024 08:57:58 +0200 Subject: [PATCH 081/115] Fix indentation; remove obsolete comment --- include/boost/function/function_template.hpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index a33904b9..ee3fc7ab 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -454,9 +454,7 @@ namespace boost { { this->clear(functor); if (f) { - // should be a reinterpret cast, but some compilers insist - // on giving cv-qualifiers to free functions - functor.members.func_ptr = reinterpret_cast(f); + functor.members.func_ptr = reinterpret_cast(f); return true; } else { return false; From 7248975133f086802219f0fa1625c527e94d240f Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Mon, 11 Mar 2024 08:38:17 -0500 Subject: [PATCH 082/115] Make the library modular usable. --- build.jam | 27 +++++++++++++++++++++++++++ example/Jamfile | 4 +++- test/Jamfile.v2 | 4 ++-- 3 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 build.jam diff --git a/build.jam b/build.jam new file mode 100644 index 00000000..8321dabd --- /dev/null +++ b/build.jam @@ -0,0 +1,27 @@ +# Copyright René Ferdinand Rivera Morell 2023 +# 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) + +import project ; + +project /boost/function + : common-requirements + /boost/assert//boost_assert + /boost/bind//boost_bind + /boost/config//boost_config + /boost/core//boost_core + /boost/preprocessor//boost_preprocessor + /boost/throw_exception//boost_throw_exception + /boost/type_traits//boost_type_traits + /boost/typeof//boost_typeof + include + ; + +explicit + [ alias boost_function ] + [ alias all : boost_function example test ] + ; + +call-if : boost-library function + ; diff --git a/example/Jamfile b/example/Jamfile index 671cc1da..f5b77bb9 100644 --- a/example/Jamfile +++ b/example/Jamfile @@ -6,7 +6,9 @@ # See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt -import ../../config/checks/config : requires ; +require-b2 5.0.1 ; +import-search /boost/config/checks ; +import config : requires ; import testing ; run bind1st.cpp : : : [ requires cxx98_binders ] ; diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 717a163e..20cee057 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -24,7 +24,7 @@ run function_test.cpp : : : off gcc-4.4,0x:no : fu run function_n_test.cpp ; run allocator_test.cpp ; run stateless_test.cpp ; -run lambda_test.cpp ; +run lambda_test.cpp : : : /boost/lambda//boost_lambda ; compile-fail function_test_fail1.cpp ; compile-fail function_test_fail2.cpp ; compile function_30.cpp ; @@ -42,7 +42,7 @@ run function_ref_portable.cpp ; run contains_test.cpp ; run contains2_test.cpp ; run nothrow_swap.cpp ; -run rvalues_test.cpp ; +run rvalues_test.cpp : : : /boost/move//boost_move ; compile function_typeof_test.cpp : 03:no 98:no 0x:no ; run result_arg_types_test.cpp ; From 13407f5e3e6a44a6f3c39ec4588523d7701500d0 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 29 Mar 2024 21:15:58 -0500 Subject: [PATCH 083/115] Switch to library requirements instead of source. As source puts extra source in install targets. --- build.jam | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/build.jam b/build.jam index 8321dabd..70c60f2b 100644 --- a/build.jam +++ b/build.jam @@ -7,14 +7,14 @@ import project ; project /boost/function : common-requirements - /boost/assert//boost_assert - /boost/bind//boost_bind - /boost/config//boost_config - /boost/core//boost_core - /boost/preprocessor//boost_preprocessor - /boost/throw_exception//boost_throw_exception - /boost/type_traits//boost_type_traits - /boost/typeof//boost_typeof + /boost/assert//boost_assert + /boost/bind//boost_bind + /boost/config//boost_config + /boost/core//boost_core + /boost/preprocessor//boost_preprocessor + /boost/throw_exception//boost_throw_exception + /boost/type_traits//boost_type_traits + /boost/typeof//boost_typeof include ; From b2fdb206908f83121c86a8e659f7c9bf3958ae93 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 5 May 2024 09:00:01 -0500 Subject: [PATCH 084/115] Add requires-b2 check to top-level build file. --- build.jam | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.jam b/build.jam index 70c60f2b..15c6a53f 100644 --- a/build.jam +++ b/build.jam @@ -3,6 +3,8 @@ # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) +require-b2 5.1 ; + import project ; project /boost/function From 38a2ab7646bb6e040ad40755bae6eabfcb1365f5 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 11 May 2024 21:26:24 +0300 Subject: [PATCH 085/115] Remove dependency on Boost.TypeTraits --- include/boost/function/function_base.hpp | 56 +++++++----------- include/boost/function/function_template.hpp | 61 ++++++++++---------- 2 files changed, 52 insertions(+), 65 deletions(-) diff --git a/include/boost/function/function_base.hpp b/include/boost/function/function_base.hpp index 7f78e36e..ca15b7b7 100644 --- a/include/boost/function/function_base.hpp +++ b/include/boost/function/function_base.hpp @@ -15,17 +15,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include #include @@ -33,6 +22,7 @@ #include #include #include +#include #if defined(BOOST_MSVC) # pragma warning( push ) @@ -43,10 +33,8 @@ // retained because used in a test #define BOOST_FUNCTION_TARGET_FIX(x) -# define BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor,Type) \ - typename ::boost::enable_if_< \ - !(::boost::is_integral::value), \ - Type>::type +#define BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor,Type) \ + typename std::enable_if< !std::is_integral::value, Type>::type namespace boost { namespace detail { @@ -131,15 +119,15 @@ namespace boost { template class get_function_tag { - typedef typename conditional<(is_pointer::value), + typedef typename std::conditional::value, function_ptr_tag, function_obj_tag>::type ptr_or_obj_tag; - typedef typename conditional<(is_member_pointer::value), + typedef typename std::conditional::value, member_ptr_tag, ptr_or_obj_tag>::type ptr_or_obj_or_mem_tag; - typedef typename conditional<(is_reference_wrapper::value), + typedef typename std::conditional::value, function_obj_ref_tag, ptr_or_obj_or_mem_tag>::type or_ref_tag; @@ -204,8 +192,8 @@ namespace boost { BOOST_STATIC_CONSTANT (bool, value = ((sizeof(F) <= sizeof(function_buffer) && - (alignment_of::value - % alignment_of::value == 0)))); + (std::alignment_of::value + % std::alignment_of::value == 0)))); }; template @@ -306,7 +294,7 @@ namespace boost { // Function objects that fit in the small-object buffer. static inline void manager(const function_buffer& in_buffer, function_buffer& out_buffer, - functor_manager_operation_type op, true_type) + functor_manager_operation_type op, std::true_type) { functor_manager_common::manage_small(in_buffer,out_buffer,op); } @@ -314,7 +302,7 @@ namespace boost { // Function objects that require heap allocation static inline void manager(const function_buffer& in_buffer, function_buffer& out_buffer, - functor_manager_operation_type op, false_type) + functor_manager_operation_type op, std::false_type) { if (op == clone_functor_tag) { // Clone the functor @@ -355,7 +343,7 @@ namespace boost { functor_manager_operation_type op, function_obj_tag) { manager(in_buffer, out_buffer, op, - integral_constant::value)>()); + std::integral_constant::value)>()); } // For member pointers, we use the small-object optimization buffer. @@ -363,7 +351,7 @@ namespace boost { manager(const function_buffer& in_buffer, function_buffer& out_buffer, functor_manager_operation_type op, member_ptr_tag) { - manager(in_buffer, out_buffer, op, true_type()); + manager(in_buffer, out_buffer, op, std::true_type()); } public: @@ -401,7 +389,7 @@ namespace boost { // Function objects that fit in the small-object buffer. static inline void manager(const function_buffer& in_buffer, function_buffer& out_buffer, - functor_manager_operation_type op, true_type) + functor_manager_operation_type op, std::true_type) { functor_manager_common::manage_small(in_buffer,out_buffer,op); } @@ -409,7 +397,7 @@ namespace boost { // Function objects that require heap allocation static inline void manager(const function_buffer& in_buffer, function_buffer& out_buffer, - functor_manager_operation_type op, false_type) + functor_manager_operation_type op, std::false_type) { typedef functor_wrapper functor_wrapper_type; @@ -460,7 +448,7 @@ namespace boost { functor_manager_operation_type op, function_obj_tag) { manager(in_buffer, out_buffer, op, - integral_constant::value)>()); + std::integral_constant::value)>()); } public: @@ -529,8 +517,8 @@ class function_base detail::function::function_buffer type_result; type_result.members.type.type = &BOOST_CORE_TYPEID(Functor); - type_result.members.type.const_qualified = is_const::value; - type_result.members.type.volatile_qualified = is_volatile::value; + type_result.members.type.const_qualified = std::is_const::value; + type_result.members.type.volatile_qualified = std::is_volatile::value; get_vtable()->manager(functor, type_result, detail::function::check_functor_type_tag); return static_cast(type_result.members.obj_ptr); @@ -544,7 +532,7 @@ class function_base detail::function::function_buffer type_result; type_result.members.type.type = &BOOST_CORE_TYPEID(Functor); type_result.members.type.const_qualified = true; - type_result.members.type.volatile_qualified = is_volatile::value; + type_result.members.type.volatile_qualified = std::is_volatile::value; get_vtable()->manager(functor, type_result, detail::function::check_functor_type_tag); // GCC 2.95.3 gets the CV qualifiers wrong here, so we @@ -553,8 +541,8 @@ class function_base } template - typename boost::enable_if_< !boost::is_function::value, bool >::type - contains(const F& f) const + typename std::enable_if< !std::is_function::value, bool >::type + contains(const F& f) const { if (const F* fp = this->template target()) { @@ -565,8 +553,8 @@ class function_base } template - typename boost::enable_if_< boost::is_function::value, bool >::type - contains(Fn& f) const + typename std::enable_if< std::is_function::value, bool >::type + contains(Fn& f) const { typedef Fn* F; if (const F* fp = this->template target()) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index ee3fc7ab..0ee0cce0 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -15,11 +15,10 @@ #include #include #include -#include -#include #include #include #include +#include #if defined(BOOST_MSVC) # pragma warning( push ) @@ -180,7 +179,7 @@ namespace boost { > struct get_function_invoker { - typedef typename conditional<(is_void::value), + typedef typename std::conditional::value, void_function_invoker< FunctionPtr, R, @@ -201,7 +200,7 @@ namespace boost { > struct get_function_obj_invoker { - typedef typename conditional<(is_void::value), + typedef typename std::conditional::value, void_function_obj_invoker< FunctionObj, R, @@ -222,7 +221,7 @@ namespace boost { > struct get_function_ref_invoker { - typedef typename conditional<(is_void::value), + typedef typename std::conditional::value, void_function_ref_invoker< FunctionObj, R, @@ -244,7 +243,7 @@ namespace boost { > struct get_member_invoker { - typedef typename conditional<(is_void::value), + typedef typename std::conditional::value, void_member_invoker< MemberPtr, R, @@ -499,27 +498,27 @@ namespace boost { // Assign to a function object using the small object optimization template void - assign_functor(FunctionObj f, function_buffer& functor, true_type) const + assign_functor(FunctionObj f, function_buffer& functor, std::true_type) const { new (reinterpret_cast(functor.data)) FunctionObj(std::move(f)); } template void - assign_functor_a(FunctionObj f, function_buffer& functor, Allocator, true_type) const + assign_functor_a(FunctionObj f, function_buffer& functor, Allocator, std::true_type) const { - assign_functor(std::move(f),functor,true_type()); + assign_functor(std::move(f),functor,std::true_type()); } // Assign to a function object allocated on the heap. template void - assign_functor(FunctionObj f, function_buffer& functor, false_type) const + assign_functor(FunctionObj f, function_buffer& functor, std::false_type) const { functor.members.obj_ptr = new FunctionObj(std::move(f)); } template void - assign_functor_a(FunctionObj f, function_buffer& functor, Allocator a, false_type) const + assign_functor_a(FunctionObj f, function_buffer& functor, Allocator a, std::false_type) const { typedef functor_wrapper functor_wrapper_type; @@ -540,7 +539,7 @@ namespace boost { { if (!boost::detail::function::has_empty_target(boost::addressof(f))) { assign_functor(std::move(f), functor, - integral_constant::value)>()); + std::integral_constant::value)>()); return true; } else { return false; @@ -552,7 +551,7 @@ namespace boost { { if (!boost::detail::function::has_empty_target(boost::addressof(f))) { assign_functor_a(std::move(f), functor, a, - integral_constant::value)>()); + std::integral_constant::value)>()); return true; } else { return false; @@ -566,8 +565,8 @@ namespace boost { function_buffer& functor, function_obj_ref_tag) const { functor.members.obj_ref.obj_ptr = (void *)(f.get_pointer()); - functor.members.obj_ref.is_const_qualified = is_const::value; - functor.members.obj_ref.is_volatile_qualified = is_volatile::value; + functor.members.obj_ref.is_const_qualified = std::is_const::value; + functor.members.obj_ref.is_volatile_qualified = std::is_volatile::value; return true; } template @@ -643,8 +642,8 @@ namespace boost { // one with a default parameter. template function_n(Functor f - ,typename boost::enable_if_< - !(is_integral::value), + ,typename std::enable_if< + !std::is_integral::value, int>::type = 0 ) : function_base() @@ -653,8 +652,8 @@ namespace boost { } template function_n(Functor f, Allocator a - ,typename boost::enable_if_< - !(is_integral::value), + ,typename std::enable_if< + !std::is_integral::value, int>::type = 0 ) : function_base() @@ -691,8 +690,8 @@ namespace boost { // handle function_n as the type of the temporary to // construct. template - typename boost::enable_if_< - !(is_integral::value), + typename std::enable_if< + !std::is_integral::value, function_n&>::type operator=(Functor f) { @@ -835,8 +834,8 @@ namespace boost { if (stored_vtable.assign_to(std::move(f), functor)) { std::size_t value = reinterpret_cast(&stored_vtable.base); // coverity[pointless_expression]: suppress coverity warnings on apparant if(const). - if (boost::has_trivial_copy_constructor::value && - boost::has_trivial_destructor::value && + if (std::is_trivially_copy_constructible::value && + std::is_trivially_destructible::value && boost::detail::function::function_allows_small_object_optimization::value) value |= static_cast(0x01); vtable = reinterpret_cast(value); @@ -869,8 +868,8 @@ namespace boost { if (stored_vtable.assign_to_a(std::move(f), functor, a)) { std::size_t value = reinterpret_cast(&stored_vtable.base); // coverity[pointless_expression]: suppress coverity warnings on apparant if(const). - if (boost::has_trivial_copy_constructor::value && - boost::has_trivial_destructor::value && + if (std::is_trivially_copy_constructible::value && + std::is_trivially_destructible::value && boost::detail::function::function_allows_small_object_optimization::value) value |= static_cast(0x01); vtable = reinterpret_cast(value); @@ -974,8 +973,8 @@ class function template function(Functor f - ,typename boost::enable_if_< - !(is_integral::value), + ,typename std::enable_if< + !std::is_integral::value, int>::type = 0 ) : base_type(std::move(f)) @@ -983,8 +982,8 @@ class function } template function(Functor f, Allocator a - ,typename boost::enable_if_< - !(is_integral::value), + ,typename std::enable_if< + !std::is_integral::value, int>::type = 0 ) : base_type(std::move(f),a) @@ -1014,8 +1013,8 @@ class function } template - typename boost::enable_if_< - !(is_integral::value), + typename std::enable_if< + !std::is_integral::value, self_type&>::type operator=(Functor f) { From 4f89a283fd221618861814078954f9885ca61812 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 11 May 2024 21:38:42 +0300 Subject: [PATCH 086/115] Fix GCC 4.8 in .drone.jsonnet --- .drone.jsonnet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index 26999e64..a42cce00 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -106,7 +106,7 @@ local windows_pipeline(name, image, environment, arch = "amd64") = linux_pipeline( "Linux 16.04 GCC 4.8 32/64", "cppalliance/droneubuntu1604:1", - { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11', ADDRMD: '32,64' }, + { TOOLSET: 'gcc', COMPILER: 'g++-4.8', CXXSTD: '11', ADDRMD: '32,64' }, "g++-4.8-multilib", ), From 35f0c2a6818e0f14c157c807d56cc80dbcd80252 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 11 May 2024 21:51:45 +0300 Subject: [PATCH 087/115] GCC 4.x doesn't have std::is_trivially_copy_constructible --- include/boost/function/function_template.hpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 0ee0cce0..07cf9927 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -599,6 +599,18 @@ namespace boost { typedef T1 second_argument_type; }; +#if defined( BOOST_LIBSTDCXX_VERSION ) && BOOST_LIBSTDCXX_VERSION < 50000 + + template struct is_trivially_copy_constructible: std::integral_constant::value && std::has_trivial_copy_constructor::value> + { + }; + +#else + + using std::is_trivially_copy_constructible; + +#endif + } // end namespace function } // end namespace detail @@ -834,7 +846,7 @@ namespace boost { if (stored_vtable.assign_to(std::move(f), functor)) { std::size_t value = reinterpret_cast(&stored_vtable.base); // coverity[pointless_expression]: suppress coverity warnings on apparant if(const). - if (std::is_trivially_copy_constructible::value && + if (boost::detail::function::is_trivially_copy_constructible::value && std::is_trivially_destructible::value && boost::detail::function::function_allows_small_object_optimization::value) value |= static_cast(0x01); @@ -868,7 +880,7 @@ namespace boost { if (stored_vtable.assign_to_a(std::move(f), functor, a)) { std::size_t value = reinterpret_cast(&stored_vtable.base); // coverity[pointless_expression]: suppress coverity warnings on apparant if(const). - if (std::is_trivially_copy_constructible::value && + if (boost::detail::function::is_trivially_copy_constructible::value && std::is_trivially_destructible::value && boost::detail::function::function_allows_small_object_optimization::value) value |= static_cast(0x01); From 694b253086b7595bd22048c52d3908c9d41e43b7 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 11 May 2024 22:14:19 +0300 Subject: [PATCH 088/115] Use std::is_trivially_copyable instead of is_trivially_copy_constructible + is_trivially_destructible --- include/boost/function/function_template.hpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 07cf9927..48329c2d 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -601,13 +601,12 @@ namespace boost { #if defined( BOOST_LIBSTDCXX_VERSION ) && BOOST_LIBSTDCXX_VERSION < 50000 - template struct is_trivially_copy_constructible: std::integral_constant::value && std::has_trivial_copy_constructor::value> - { - }; + template struct is_trivially_copyable: std::integral_constant {}; #else - using std::is_trivially_copy_constructible; + using std::is_trivially_copyable; #endif @@ -846,8 +845,7 @@ namespace boost { if (stored_vtable.assign_to(std::move(f), functor)) { std::size_t value = reinterpret_cast(&stored_vtable.base); // coverity[pointless_expression]: suppress coverity warnings on apparant if(const). - if (boost::detail::function::is_trivially_copy_constructible::value && - std::is_trivially_destructible::value && + if (boost::detail::function::is_trivially_copyable::value && boost::detail::function::function_allows_small_object_optimization::value) value |= static_cast(0x01); vtable = reinterpret_cast(value); @@ -880,8 +878,7 @@ namespace boost { if (stored_vtable.assign_to_a(std::move(f), functor, a)) { std::size_t value = reinterpret_cast(&stored_vtable.base); // coverity[pointless_expression]: suppress coverity warnings on apparant if(const). - if (boost::detail::function::is_trivially_copy_constructible::value && - std::is_trivially_destructible::value && + if (boost::detail::function::is_trivially_copyable::value && boost::detail::function::function_allows_small_object_optimization::value) value |= static_cast(0x01); vtable = reinterpret_cast(value); From 9788bb6ceace45fea7c5e0dff85b60d42c4d0f4a Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 11 May 2024 22:22:56 +0300 Subject: [PATCH 089/115] Update ci.yml --- .github/workflows/ci.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 424af4f1..e5570032 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,6 +83,12 @@ jobs: os: ubuntu-latest install: g++-13-multilib address-model: 32,64 + - toolset: gcc-14 + cxxstd: "11,14,17,20,2b" + container: ubuntu:24.04 + os: ubuntu-latest + install: g++-14-multilib + address-model: 32,64 - toolset: clang compiler: clang++-3.9 cxxstd: "11,14" @@ -163,6 +169,12 @@ jobs: container: ubuntu:23.10 os: ubuntu-latest install: clang-17 + - toolset: clang + compiler: clang++-18 + cxxstd: "11,14,17,20,2b" + container: ubuntu:24.04 + os: ubuntu-latest + install: clang-18 - toolset: clang cxxstd: "11,14,17,2a" os: macos-11 @@ -172,6 +184,9 @@ jobs: - toolset: clang cxxstd: "11,14,17,20,2b" os: macos-13 + - toolset: clang + cxxstd: "11,14,17,20,2b" + os: macos-14 runs-on: ${{matrix.os}} container: ${{matrix.container}} From bd181fdf898ccf405a69be6fff3e0e4c02240432 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 11 May 2024 22:39:29 +0300 Subject: [PATCH 090/115] Update .drone.jsonnet --- .drone.jsonnet | 52 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index a42cce00..a0bb4417 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -150,16 +150,23 @@ local windows_pipeline(name, image, environment, arch = "amd64") = ), linux_pipeline( - "Linux 20.04 GCC 9* ARM64", + "Linux 20.04 GCC 9* ARM64 ASAN", "cppalliance/droneubuntu2004:multiarch", - { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14,17,2a' }, + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14,17,2a' } + asan, arch="arm64", ), linux_pipeline( - "Linux 20.04 GCC 9* S390x", + "Linux 20.04 GCC 9* ARM64 UBSAN", "cppalliance/droneubuntu2004:multiarch", - { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14,17,2a' }, + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14,17,2a' } + ubsan, + arch="arm64", + ), + + linux_pipeline( + "Linux 20.04 GCC 9* S390x UBSAN", + "cppalliance/droneubuntu2004:multiarch", + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14,17,2a' } + ubsan, arch="s390x", ), @@ -184,31 +191,24 @@ local windows_pipeline(name, image, environment, arch = "amd64") = ), linux_pipeline( - "Linux 23.04 GCC 13 32 ASAN", - "cppalliance/droneubuntu2304:1", - { TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '11,14,17,20,2b', ADDRMD: '32' } + asan, - "g++-13-multilib", - ), - - linux_pipeline( - "Linux 23.04 GCC 13 64 ASAN", + "Linux 23.04 GCC 13 32/64 ASAN", "cppalliance/droneubuntu2304:1", - { TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '11,14,17,20,2b', ADDRMD: '64' } + asan, + { TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '11,14,17,20,2b', ADDRMD: '32,64' } + asan, "g++-13-multilib", ), linux_pipeline( - "Linux 23.04 GCC 13 32 UBSAN", + "Linux 23.04 GCC 13 32/64 UBSAN", "cppalliance/droneubuntu2304:1", - { TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '11,14,17,20,2b', ADDRMD: '32' } + ubsan, + { TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '11,14,17,20,2b', ADDRMD: '32,64' } + ubsan, "g++-13-multilib", ), linux_pipeline( - "Linux 23.04 GCC 13 64 UBSAN", - "cppalliance/droneubuntu2304:1", - { TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '11,14,17,20,2b', ADDRMD: '64' } + ubsan, - "g++-13-multilib", + "Linux 24.04 GCC 14 32/64", + "cppalliance/droneubuntu2404:1", + { TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '11,14,17,20,2b', ADDRMD: '32,64' }, + "g++-14-multilib", ), linux_pipeline( @@ -351,6 +351,20 @@ local windows_pipeline(name, image, environment, arch = "amd64") = "clang-17", ), + linux_pipeline( + "Linux 24.04 Clang 18 UBSAN", + "cppalliance/droneubuntu2404:1", + { TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '11,14,17,20,2b' } + ubsan, + "clang-18", + ), + + linux_pipeline( + "Linux 24.04 Clang 18 ASAN", + "cppalliance/droneubuntu2404:1", + { TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '11,14,17,20,2b' } + asan, + "clang-18", + ), + macos_pipeline( "MacOS 10.15 Xcode 12.2 UBSAN", { TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '11,14,17,2a' } + ubsan, From d9647610ffeaac0d5a8d86485e160e2e79085515 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Mon, 13 May 2024 21:45:46 -0500 Subject: [PATCH 091/115] Update dependencies. --- build.jam | 2 -- 1 file changed, 2 deletions(-) diff --git a/build.jam b/build.jam index 15c6a53f..c9ef04fa 100644 --- a/build.jam +++ b/build.jam @@ -13,10 +13,8 @@ project /boost/function /boost/bind//boost_bind /boost/config//boost_config /boost/core//boost_core - /boost/preprocessor//boost_preprocessor /boost/throw_exception//boost_throw_exception /boost/type_traits//boost_type_traits - /boost/typeof//boost_typeof include ; From c7ca5cc828d1b42cdc9ef8d8138b442c74783cb8 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 14 May 2024 07:33:12 -0500 Subject: [PATCH 092/115] Add missing test deps. --- test/Jamfile.v2 | 1 + 1 file changed, 1 insertion(+) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 20cee057..4f54b36c 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -16,6 +16,7 @@ project msvc:on gcc:on clang:on + /boost/typeof//boost_typeof ; run function_test.cpp ; From a39d5404d67ca2f23055f7494ce8806da4b84420 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 5 Jun 2024 16:33:38 +0300 Subject: [PATCH 093/115] Add result_arg_n_types_test. Refs #51. --- test/Jamfile.v2 | 1 + test/result_arg_n_types_test.cpp | 146 +++++++++++++++++++++++++++++++ 2 files changed, 147 insertions(+) create mode 100644 test/result_arg_n_types_test.cpp diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 717a163e..13f411e6 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -46,6 +46,7 @@ run rvalues_test.cpp ; compile function_typeof_test.cpp : 03:no 98:no 0x:no ; run result_arg_types_test.cpp ; +run result_arg_n_types_test.cpp ; lib throw_bad_function_call : throw_bad_function_call.cpp : shared:THROW_BAD_FUNCTION_CALL_DYN_LINK=1 ; diff --git a/test/result_arg_n_types_test.cpp b/test/result_arg_n_types_test.cpp new file mode 100644 index 00000000..c7e5780f --- /dev/null +++ b/test/result_arg_n_types_test.cpp @@ -0,0 +1,146 @@ +// Copyright 2024 Peter Dimov +// Use, modification and distribution is subject to +// the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt + +#include +#include + +struct R {}; + +struct A1 {}; +struct A2 {}; +struct A3 {}; +struct A4 {}; +struct A5 {}; +struct A6 {}; +struct A7 {}; +struct A8 {}; +struct A9 {}; +struct A10 {}; + +int main() +{ + { + typedef boost::function F; + + BOOST_TEST_TRAIT_SAME(F::result_type, R); + } + + { + typedef boost::function F; + + BOOST_TEST_TRAIT_SAME(F::result_type, R); + BOOST_TEST_TRAIT_SAME(F::arg1_type, A1); + } + + { + typedef boost::function F; + + BOOST_TEST_TRAIT_SAME(F::result_type, R); + BOOST_TEST_TRAIT_SAME(F::arg1_type, A1); + BOOST_TEST_TRAIT_SAME(F::arg2_type, A2); + } + + { + typedef boost::function F; + + BOOST_TEST_TRAIT_SAME(F::result_type, R); + BOOST_TEST_TRAIT_SAME(F::arg1_type, A1); + BOOST_TEST_TRAIT_SAME(F::arg2_type, A2); + BOOST_TEST_TRAIT_SAME(F::arg3_type, A3); + } + + { + typedef boost::function F; + + BOOST_TEST_TRAIT_SAME(F::result_type, R); + BOOST_TEST_TRAIT_SAME(F::arg1_type, A1); + BOOST_TEST_TRAIT_SAME(F::arg2_type, A2); + BOOST_TEST_TRAIT_SAME(F::arg3_type, A3); + BOOST_TEST_TRAIT_SAME(F::arg4_type, A4); + } + + { + typedef boost::function F; + + BOOST_TEST_TRAIT_SAME(F::result_type, R); + BOOST_TEST_TRAIT_SAME(F::arg1_type, A1); + BOOST_TEST_TRAIT_SAME(F::arg2_type, A2); + BOOST_TEST_TRAIT_SAME(F::arg3_type, A3); + BOOST_TEST_TRAIT_SAME(F::arg4_type, A4); + BOOST_TEST_TRAIT_SAME(F::arg5_type, A5); + } + + { + typedef boost::function F; + + BOOST_TEST_TRAIT_SAME(F::result_type, R); + BOOST_TEST_TRAIT_SAME(F::arg1_type, A1); + BOOST_TEST_TRAIT_SAME(F::arg2_type, A2); + BOOST_TEST_TRAIT_SAME(F::arg3_type, A3); + BOOST_TEST_TRAIT_SAME(F::arg4_type, A4); + BOOST_TEST_TRAIT_SAME(F::arg5_type, A5); + BOOST_TEST_TRAIT_SAME(F::arg6_type, A6); + } + + { + typedef boost::function F; + + BOOST_TEST_TRAIT_SAME(F::result_type, R); + BOOST_TEST_TRAIT_SAME(F::arg1_type, A1); + BOOST_TEST_TRAIT_SAME(F::arg2_type, A2); + BOOST_TEST_TRAIT_SAME(F::arg3_type, A3); + BOOST_TEST_TRAIT_SAME(F::arg4_type, A4); + BOOST_TEST_TRAIT_SAME(F::arg5_type, A5); + BOOST_TEST_TRAIT_SAME(F::arg6_type, A6); + BOOST_TEST_TRAIT_SAME(F::arg7_type, A7); + } + + { + typedef boost::function F; + + BOOST_TEST_TRAIT_SAME(F::result_type, R); + BOOST_TEST_TRAIT_SAME(F::arg1_type, A1); + BOOST_TEST_TRAIT_SAME(F::arg2_type, A2); + BOOST_TEST_TRAIT_SAME(F::arg3_type, A3); + BOOST_TEST_TRAIT_SAME(F::arg4_type, A4); + BOOST_TEST_TRAIT_SAME(F::arg5_type, A5); + BOOST_TEST_TRAIT_SAME(F::arg6_type, A6); + BOOST_TEST_TRAIT_SAME(F::arg7_type, A7); + BOOST_TEST_TRAIT_SAME(F::arg8_type, A8); + } + + { + typedef boost::function F; + + BOOST_TEST_TRAIT_SAME(F::result_type, R); + BOOST_TEST_TRAIT_SAME(F::arg1_type, A1); + BOOST_TEST_TRAIT_SAME(F::arg2_type, A2); + BOOST_TEST_TRAIT_SAME(F::arg3_type, A3); + BOOST_TEST_TRAIT_SAME(F::arg4_type, A4); + BOOST_TEST_TRAIT_SAME(F::arg5_type, A5); + BOOST_TEST_TRAIT_SAME(F::arg6_type, A6); + BOOST_TEST_TRAIT_SAME(F::arg7_type, A7); + BOOST_TEST_TRAIT_SAME(F::arg8_type, A8); + BOOST_TEST_TRAIT_SAME(F::arg9_type, A9); + } + + { + typedef boost::function F; + + BOOST_TEST_TRAIT_SAME(F::result_type, R); + BOOST_TEST_TRAIT_SAME(F::arg1_type, A1); + BOOST_TEST_TRAIT_SAME(F::arg2_type, A2); + BOOST_TEST_TRAIT_SAME(F::arg3_type, A3); + BOOST_TEST_TRAIT_SAME(F::arg4_type, A4); + BOOST_TEST_TRAIT_SAME(F::arg5_type, A5); + BOOST_TEST_TRAIT_SAME(F::arg6_type, A6); + BOOST_TEST_TRAIT_SAME(F::arg7_type, A7); + BOOST_TEST_TRAIT_SAME(F::arg8_type, A8); + BOOST_TEST_TRAIT_SAME(F::arg9_type, A9); + BOOST_TEST_TRAIT_SAME(F::arg10_type, A10); + } + + return boost::report_errors(); +} From 1204b7d20091c1ac65fb02a1d5991a82098e4f77 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 5 Jun 2024 16:48:43 +0300 Subject: [PATCH 094/115] Add missing argN_type typedefs. Fixes #51. --- include/boost/function/function_template.hpp | 109 +++++++++++++++++-- 1 file changed, 102 insertions(+), 7 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 48329c2d..f21a395b 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -586,17 +586,112 @@ namespace boost { struct variadic_function_base {}; - template - struct variadic_function_base + template + struct variadic_function_base { - typedef T argument_type; + typedef T1 argument_type; + typedef T1 arg1_type; }; - template - struct variadic_function_base + template + struct variadic_function_base { - typedef T0 first_argument_type; - typedef T1 second_argument_type; + typedef T1 first_argument_type; + typedef T2 second_argument_type; + typedef T1 arg1_type; + typedef T2 arg2_type; + }; + + template + struct variadic_function_base + { + typedef T1 arg1_type; + typedef T2 arg2_type; + typedef T3 arg3_type; + }; + + template + struct variadic_function_base + { + typedef T1 arg1_type; + typedef T2 arg2_type; + typedef T3 arg3_type; + typedef T4 arg4_type; + }; + + template + struct variadic_function_base + { + typedef T1 arg1_type; + typedef T2 arg2_type; + typedef T3 arg3_type; + typedef T4 arg4_type; + typedef T5 arg5_type; + }; + + template + struct variadic_function_base + { + typedef T1 arg1_type; + typedef T2 arg2_type; + typedef T3 arg3_type; + typedef T4 arg4_type; + typedef T5 arg5_type; + typedef T6 arg6_type; + }; + + template + struct variadic_function_base + { + typedef T1 arg1_type; + typedef T2 arg2_type; + typedef T3 arg3_type; + typedef T4 arg4_type; + typedef T5 arg5_type; + typedef T6 arg6_type; + typedef T7 arg7_type; + }; + + template + struct variadic_function_base + { + typedef T1 arg1_type; + typedef T2 arg2_type; + typedef T3 arg3_type; + typedef T4 arg4_type; + typedef T5 arg5_type; + typedef T6 arg6_type; + typedef T7 arg7_type; + typedef T8 arg8_type; + }; + + template + struct variadic_function_base + { + typedef T1 arg1_type; + typedef T2 arg2_type; + typedef T3 arg3_type; + typedef T4 arg4_type; + typedef T5 arg5_type; + typedef T6 arg6_type; + typedef T7 arg7_type; + typedef T8 arg8_type; + typedef T9 arg9_type; + }; + + template + struct variadic_function_base + { + typedef T1 arg1_type; + typedef T2 arg2_type; + typedef T3 arg3_type; + typedef T4 arg4_type; + typedef T5 arg5_type; + typedef T6 arg6_type; + typedef T7 arg7_type; + typedef T8 arg8_type; + typedef T9 arg9_type; + typedef T10 arg10_type; }; #if defined( BOOST_LIBSTDCXX_VERSION ) && BOOST_LIBSTDCXX_VERSION < 50000 From 92b9a12c67b970cf7760d1709d96db8cf3f90617 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 14 Jun 2024 11:33:55 -0500 Subject: [PATCH 095/115] Bump B2 require to 5.2 --- build.jam | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/build.jam b/build.jam index c9ef04fa..1139bfa4 100644 --- a/build.jam +++ b/build.jam @@ -3,9 +3,7 @@ # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) -require-b2 5.1 ; - -import project ; +require-b2 5.2 ; project /boost/function : common-requirements From b397ad461efdc1736f5d1ec9d9c56369bb09a21a Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 20 Jul 2024 19:38:32 -0500 Subject: [PATCH 096/115] Change all references to . --- test/Jamfile.v2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index a31045d5..3ac8620b 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -25,7 +25,7 @@ run function_test.cpp : : : off gcc-4.4,0x:no : fu run function_n_test.cpp ; run allocator_test.cpp ; run stateless_test.cpp ; -run lambda_test.cpp : : : /boost/lambda//boost_lambda ; +run lambda_test.cpp : : : /boost/lambda//boost_lambda ; compile-fail function_test_fail1.cpp ; compile-fail function_test_fail2.cpp ; compile function_30.cpp ; @@ -43,7 +43,7 @@ run function_ref_portable.cpp ; run contains_test.cpp ; run contains2_test.cpp ; run nothrow_swap.cpp ; -run rvalues_test.cpp : : : /boost/move//boost_move ; +run rvalues_test.cpp : : : /boost/move//boost_move ; compile function_typeof_test.cpp : 03:no 98:no 0x:no ; run result_arg_types_test.cpp ; From edd5bc27ed3d7c0203798ff9c7545b8e0a49ea98 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 20 Jul 2024 22:52:04 -0500 Subject: [PATCH 097/115] Update copyright dates. --- build.jam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.jam b/build.jam index 1139bfa4..92f989e9 100644 --- a/build.jam +++ b/build.jam @@ -1,4 +1,4 @@ -# Copyright René Ferdinand Rivera Morell 2023 +# Copyright René Ferdinand Rivera Morell 2023-2024 # 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) From 0daa9f439e3e68e8a52ee7a5be4d3d7a9e43a024 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 23 Jul 2024 22:34:22 -0500 Subject: [PATCH 098/115] Move inter-lib dependencies to a project variable and into the build targets. --- build.jam | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/build.jam b/build.jam index 92f989e9..55fe90ae 100644 --- a/build.jam +++ b/build.jam @@ -5,21 +5,24 @@ require-b2 5.2 ; +constant boost_dependencies : + /boost/assert//boost_assert + /boost/bind//boost_bind + /boost/config//boost_config + /boost/core//boost_core + /boost/throw_exception//boost_throw_exception + /boost/type_traits//boost_type_traits ; + project /boost/function : common-requirements - /boost/assert//boost_assert - /boost/bind//boost_bind - /boost/config//boost_config - /boost/core//boost_core - /boost/throw_exception//boost_throw_exception - /boost/type_traits//boost_type_traits include ; explicit - [ alias boost_function ] + [ alias boost_function : : : : $(boost_dependencies) ] [ alias all : boost_function example test ] ; call-if : boost-library function ; + From e198ea3bc17f93ee4d77f4a80999b2f6be9cf90a Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sat, 3 Aug 2024 12:06:25 -0500 Subject: [PATCH 099/115] Update build deps. --- example/Jamfile | 2 ++ test/Jamfile.v2 | 1 + 2 files changed, 3 insertions(+) diff --git a/example/Jamfile b/example/Jamfile index f5b77bb9..15d8f3c4 100644 --- a/example/Jamfile +++ b/example/Jamfile @@ -11,6 +11,8 @@ import-search /boost/config/checks ; import config : requires ; import testing ; +project : requirements /boost/function//boost_function ; + run bind1st.cpp : : : [ requires cxx98_binders ] ; run int_div.cpp ; run sum_avg.cpp ; diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 3ac8620b..d4f62797 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -17,6 +17,7 @@ project gcc:on clang:on /boost/typeof//boost_typeof + /boost/function//boost_function ; run function_test.cpp ; From b4ce38b1a0731853bd9d626160e0a626e5a5ef96 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 22 Aug 2024 13:04:04 +0300 Subject: [PATCH 100/115] Update ci.yml --- .github/workflows/ci.yml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e5570032..67270350 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: matrix: include: - toolset: gcc-4.7 - cxxstd: "0x" + cxxstd: "11" container: ubuntu:16.04 os: ubuntu-latest install: g++-4.7-multilib @@ -175,9 +175,6 @@ jobs: container: ubuntu:24.04 os: ubuntu-latest install: clang-18 - - toolset: clang - cxxstd: "11,14,17,2a" - os: macos-11 - toolset: clang cxxstd: "11,14,17,20,2b" os: macos-12 @@ -196,6 +193,10 @@ jobs: shell: bash steps: + - name: Enable Node 16 + run: | + echo "ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true" >> $GITHUB_ENV + - uses: actions/checkout@v3 - name: Setup container environment @@ -272,7 +273,7 @@ jobs: runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Boost shell: cmd @@ -309,14 +310,14 @@ jobs: include: - os: ubuntu-20.04 - os: ubuntu-22.04 - - os: macos-11 - os: macos-12 - os: macos-13 + - os: macos-14 runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install packages if: matrix.install @@ -357,14 +358,14 @@ jobs: include: - os: ubuntu-20.04 - os: ubuntu-22.04 - - os: macos-11 - os: macos-12 - os: macos-13 + - os: macos-14 runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install packages if: matrix.install @@ -415,14 +416,14 @@ jobs: include: - os: ubuntu-20.04 - os: ubuntu-22.04 - - os: macos-11 - os: macos-12 - os: macos-13 + - os: macos-14 runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install packages if: matrix.install @@ -475,7 +476,7 @@ jobs: runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Boost shell: cmd @@ -524,7 +525,7 @@ jobs: runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Boost shell: cmd @@ -591,7 +592,7 @@ jobs: runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Boost shell: cmd From 7e4d90c87d2928ddddb171308735eaf6edef9f85 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 22 Aug 2024 13:11:58 +0300 Subject: [PATCH 101/115] Update .drone.jsonnet --- .drone.jsonnet | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index a0bb4417..5d50b1f7 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -32,6 +32,8 @@ local linux_pipeline(name, image, environment, packages = "", sources = [], arch commands: [ 'set -e', + 'uname -a', + 'echo $DRONE_STAGE_MACHINE', 'wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -', ] + (if sources != [] then [ ('apt-add-repository "' + source + '"') for source in sources ] else []) + @@ -150,16 +152,16 @@ local windows_pipeline(name, image, environment, arch = "amd64") = ), linux_pipeline( - "Linux 20.04 GCC 9* ARM64 ASAN", + "Linux 20.04 GCC 9* ARM64 UBSAN", "cppalliance/droneubuntu2004:multiarch", - { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14,17,2a' } + asan, + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14,17,2a' } + ubsan, arch="arm64", ), linux_pipeline( - "Linux 20.04 GCC 9* ARM64 UBSAN", + "Linux 20.04 GCC 9* ARM64 ASAN", "cppalliance/droneubuntu2004:multiarch", - { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14,17,2a' } + ubsan, + { TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14,17,2a' } + asan, arch="arm64", ), @@ -191,23 +193,23 @@ local windows_pipeline(name, image, environment, arch = "amd64") = ), linux_pipeline( - "Linux 23.04 GCC 13 32/64 ASAN", + "Linux 23.04 GCC 13 32/64", "cppalliance/droneubuntu2304:1", - { TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '11,14,17,20,2b', ADDRMD: '32,64' } + asan, + { TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '11,14,17,20,2b', ADDRMD: '32,64' }, "g++-13-multilib", ), linux_pipeline( - "Linux 23.04 GCC 13 32/64 UBSAN", - "cppalliance/droneubuntu2304:1", - { TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '11,14,17,20,2b', ADDRMD: '32,64' } + ubsan, - "g++-13-multilib", + "Linux 24.04 GCC 14 32/64 UBSAN", + "cppalliance/droneubuntu2404:1", + { TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '11,14,17,20,2b', ADDRMD: '32,64' } + ubsan, + "g++-14-multilib", ), linux_pipeline( - "Linux 24.04 GCC 14 32/64", + "Linux 24.04 GCC 14 32/64 ASAN", "cppalliance/droneubuntu2404:1", - { TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '11,14,17,20,2b', ADDRMD: '32,64' }, + { TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '11,14,17,20,2b', ADDRMD: '32,64' } + asan, "g++-14-multilib", ), From 55567d812899730af3a655f5f0a3e8b207b74e34 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 22 Aug 2024 13:41:09 +0300 Subject: [PATCH 102/115] Regenerate CMakeLists.txt --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 050ad37f..56bc47be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,6 @@ target_link_libraries(boost_function Boost::config Boost::core Boost::throw_exception - Boost::type_traits ) target_compile_features(boost_function INTERFACE cxx_std_11) From bc78cd0f3db62cd41fc5459e0fbe2b51511789ec Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 22 Aug 2024 14:21:16 +0300 Subject: [PATCH 103/115] Update build.jam, test/Jamfile --- build.jam | 16 ++++++---------- test/Jamfile.v2 | 10 ++++++---- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/build.jam b/build.jam index 55fe90ae..fa276be4 100644 --- a/build.jam +++ b/build.jam @@ -1,7 +1,7 @@ -# Copyright René Ferdinand Rivera Morell 2023-2024 +# Copyright 2023-2024 René Ferdinand Rivera Morell +# Copyright 2024 Peter Dimov # 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) +# https://www.boost.org/LICENSE_1_0.txt require-b2 5.2 ; @@ -11,18 +11,14 @@ constant boost_dependencies : /boost/config//boost_config /boost/core//boost_core /boost/throw_exception//boost_throw_exception - /boost/type_traits//boost_type_traits ; - -project /boost/function - : common-requirements - include ; +project /boost/function ; + explicit - [ alias boost_function : : : : $(boost_dependencies) ] + [ alias boost_function : : : : include $(boost_dependencies) ] [ alias all : boost_function example test ] ; call-if : boost-library function ; - diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index d4f62797..67bbe1f9 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -16,8 +16,8 @@ project msvc:on gcc:on clang:on - /boost/typeof//boost_typeof /boost/function//boost_function + /boost/typeof//boost_typeof ; run function_test.cpp ; @@ -26,7 +26,8 @@ run function_test.cpp : : : off gcc-4.4,0x:no : fu run function_n_test.cpp ; run allocator_test.cpp ; run stateless_test.cpp ; -run lambda_test.cpp : : : /boost/lambda//boost_lambda ; +run lambda_test.cpp + : : : /boost/lambda//boost_lambda ; compile-fail function_test_fail1.cpp ; compile-fail function_test_fail2.cpp ; compile function_30.cpp ; @@ -44,9 +45,10 @@ run function_ref_portable.cpp ; run contains_test.cpp ; run contains2_test.cpp ; run nothrow_swap.cpp ; -run rvalues_test.cpp : : : /boost/move//boost_move ; +run rvalues_test.cpp + : : : /boost/move//boost_move ; compile function_typeof_test.cpp - : 03:no 98:no 0x:no ; + : 03:no 98:no 0x:no ; run result_arg_types_test.cpp ; run result_arg_n_types_test.cpp ; From bd668a0d9cd2d9c226c13454e03b4c4ff7296d5a Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 22 Aug 2024 14:25:24 +0300 Subject: [PATCH 104/115] Add VERBATIM to add_custom_target --- test/cmake_install_test/CMakeLists.txt | 2 +- test/cmake_subdir_test/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/cmake_install_test/CMakeLists.txt b/test/cmake_install_test/CMakeLists.txt index c317bbab..c8ebe9c5 100644 --- a/test/cmake_install_test/CMakeLists.txt +++ b/test/cmake_install_test/CMakeLists.txt @@ -14,4 +14,4 @@ target_link_libraries(main Boost::function) enable_testing() add_test(main main) -add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $) +add_custom_target(check VERBATIM COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $) diff --git a/test/cmake_subdir_test/CMakeLists.txt b/test/cmake_subdir_test/CMakeLists.txt index f3ef5393..09b912bd 100644 --- a/test/cmake_subdir_test/CMakeLists.txt +++ b/test/cmake_subdir_test/CMakeLists.txt @@ -40,4 +40,4 @@ target_link_libraries(quick Boost::function Boost::core) enable_testing() add_test(quick quick) -add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $) +add_custom_target(check VERBATIM COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $) From e46566bc895ecafb15c5e33f3c19824ae7370b06 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 22 Aug 2024 14:25:59 +0300 Subject: [PATCH 105/115] Update dependency list in cmake_subdir_test --- test/cmake_subdir_test/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/cmake_subdir_test/CMakeLists.txt b/test/cmake_subdir_test/CMakeLists.txt index 09b912bd..3d404555 100644 --- a/test/cmake_subdir_test/CMakeLists.txt +++ b/test/cmake_subdir_test/CMakeLists.txt @@ -16,10 +16,7 @@ assert bind config core -preprocessor throw_exception -type_traits -typeof # Secondary dependencies From 620c01266f524ae0fb101e8383203e0d3502b15d Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 7 Oct 2024 22:32:25 +0300 Subject: [PATCH 106/115] Remove macos-12 from ci.yml, add macos-15 and ubuntu-24.04 --- .github/workflows/ci.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67270350..e7ed3b8e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -175,15 +175,15 @@ jobs: container: ubuntu:24.04 os: ubuntu-latest install: clang-18 - - toolset: clang - cxxstd: "11,14,17,20,2b" - os: macos-12 - toolset: clang cxxstd: "11,14,17,20,2b" os: macos-13 - toolset: clang cxxstd: "11,14,17,20,2b" os: macos-14 + - toolset: clang + cxxstd: "11,14,17,20,2b" + os: macos-15 runs-on: ${{matrix.os}} container: ${{matrix.container}} @@ -310,9 +310,10 @@ jobs: include: - os: ubuntu-20.04 - os: ubuntu-22.04 - - os: macos-12 + - os: ubuntu-24.04 - os: macos-13 - os: macos-14 + - os: macos-15 runs-on: ${{matrix.os}} @@ -358,9 +359,10 @@ jobs: include: - os: ubuntu-20.04 - os: ubuntu-22.04 - - os: macos-12 + - os: ubuntu-24.04 - os: macos-13 - os: macos-14 + - os: macos-15 runs-on: ${{matrix.os}} @@ -416,9 +418,10 @@ jobs: include: - os: ubuntu-20.04 - os: ubuntu-22.04 - - os: macos-12 + - os: ubuntu-24.04 - os: macos-13 - os: macos-14 + - os: macos-15 runs-on: ${{matrix.os}} From f3a164eaeb4b343cae077a5036daedc070a07a86 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 7 Oct 2024 22:36:22 +0300 Subject: [PATCH 107/115] Update test/CMakeLists.txt --- test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 8d1ddd6e..329e1ac9 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -6,6 +6,6 @@ include(BoostTestJamfile OPTIONAL RESULT_VARIABLE HAVE_BOOST_TEST) if(HAVE_BOOST_TEST) -boost_test_jamfile(FILE Jamfile.v2 LINK_LIBRARIES Boost::function Boost::core Boost::lambda) +boost_test_jamfile(FILE Jamfile.v2 LINK_LIBRARIES Boost::function Boost::core Boost::lambda Boost::move) endif() From ac731c96bbabc8537a3c1276caa41499b5274d70 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 12 Oct 2024 21:32:25 +0300 Subject: [PATCH 108/115] Add test for #53. Refs #53. --- test/Jamfile.v2 | 2 ++ test/issue_53.cpp | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 test/issue_53.cpp diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 67bbe1f9..22c3ebfe 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -93,3 +93,5 @@ run contains2_test.cpp : : : off gcc-4.4,0x:no : c run contains3_test.cpp ; run contains3_test.cpp : : : off gcc-4.4,0x:no : contains3_test_no_rtti ; + +compile issue_53.cpp ; diff --git a/test/issue_53.cpp b/test/issue_53.cpp new file mode 100644 index 00000000..45e00d9a --- /dev/null +++ b/test/issue_53.cpp @@ -0,0 +1,20 @@ +// Copyright 2024 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt +// +// https://github.com/boostorg/function/issues/53 + +#include +#include +#include + +int TestArg( int, double ) +{ + return 0; +} + + +void f() +{ + boost::function fn = boost::bind( &TestArg, boost::placeholders::_1, 1.0 ); +} From 89dfb032f29931358d57819edca15a7f02f10bb6 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 12 Oct 2024 21:58:15 +0300 Subject: [PATCH 109/115] Rename `apply` to `apply_` to avoid msvc-14.3 conflict. Fixes #53. --- include/boost/function/function_template.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index f21a395b..ac4a5b24 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -261,9 +261,9 @@ namespace boost { actual invoker that will be used for the given function object. - Each specialization contains an "apply" nested class template + Each specialization contains an "apply_" nested class template that accepts the function object, return type, function - argument types, and allocator. The resulting "apply" class + argument types, and allocator. The resulting "apply_" class contains two typedefs, "invoker_type" and "manager_type", which correspond to the invoker and manager types. */ template @@ -275,7 +275,7 @@ namespace boost { { template - struct apply + struct apply_ { typedef typename get_function_invoker< FunctionPtr, @@ -308,7 +308,7 @@ namespace boost { { template - struct apply + struct apply_ { typedef typename get_member_invoker< MemberPtr, @@ -341,7 +341,7 @@ namespace boost { { template - struct apply + struct apply_ { typedef typename get_function_obj_invoker< FunctionObj, @@ -374,7 +374,7 @@ namespace boost { { template - struct apply + struct apply_ { typedef typename get_function_ref_invoker< typename RefWrapper::type, @@ -923,7 +923,7 @@ namespace boost { typedef typename boost::detail::function::get_function_tag::type tag; typedef boost::detail::function::get_invoker get_invoker; typedef typename get_invoker:: - template apply handler_type; From 7dd7abec65e9620aa2918f23f2c485bc36ef0ca3 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 14 Dec 2024 04:36:32 +0200 Subject: [PATCH 110/115] Update ci.yml --- .github/workflows/ci.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e7ed3b8e..17ed15e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: address-model: 32,64 - toolset: gcc-13 cxxstd: "11,14,17,20,2b" - container: ubuntu:23.04 + container: ubuntu:24.04 os: ubuntu-latest install: g++-13-multilib address-model: 32,64 @@ -160,13 +160,13 @@ jobs: - toolset: clang compiler: clang++-16 cxxstd: "11,14,17,20,2b" - container: ubuntu:23.04 + container: ubuntu:24.04 os: ubuntu-latest install: clang-16 - toolset: clang compiler: clang++-17 cxxstd: "11,14,17,20,2b" - container: ubuntu:23.10 + container: ubuntu:24.04 os: ubuntu-latest install: clang-17 - toolset: clang @@ -175,6 +175,12 @@ jobs: container: ubuntu:24.04 os: ubuntu-latest install: clang-18 + - toolset: clang + compiler: clang++-19 + cxxstd: "11,14,17,20,2b" + container: ubuntu:24.10 + os: ubuntu-latest + install: clang-19 - toolset: clang cxxstd: "11,14,17,20,2b" os: macos-13 From 69c3b8968af570bcab0cbf46f7976101c2ba9cde Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 14 Dec 2024 04:37:24 +0200 Subject: [PATCH 111/115] Apply Node20 workaround --- .github/workflows/ci.yml | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 17ed15e8..3bb06299 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -192,24 +192,32 @@ jobs: os: macos-15 runs-on: ${{matrix.os}} - container: ${{matrix.container}} + + container: + image: ${{matrix.container}} + volumes: + - /node20217:/node20217:rw,rshared + - ${{ startsWith(matrix.container, 'ubuntu:1') && '/node20217:/__e/node20:ro,rshared' || ' ' }} defaults: run: shell: bash steps: - - name: Enable Node 16 - run: | - echo "ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true" >> $GITHUB_ENV - - - uses: actions/checkout@v3 - - name: Setup container environment if: matrix.container run: | apt-get update - apt-get -y install sudo python3 git g++ + apt-get -y install sudo python3 git g++ curl xz-utils + + - name: Install nodejs20glibc2.17 + if: ${{ startsWith( matrix.container, 'ubuntu:1' ) }} + run: | + curl -LO https://archives.boost.io/misc/node/node-v20.9.0-linux-x64-glibc-217.tar.xz + tar -xf node-v20.9.0-linux-x64-glibc-217.tar.xz --strip-components 1 -C /node20217 + ldd /__e/node20/bin/node + + - uses: actions/checkout@v4 - name: Install packages if: matrix.install From f6b538dbed2e3047dcbd09eb3f5c7f1ffa90d0a9 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 14 Dec 2024 04:39:29 +0200 Subject: [PATCH 112/115] Update .drone.jsonnet --- .drone.jsonnet | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index 5d50b1f7..dd5fd9ac 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -193,8 +193,8 @@ local windows_pipeline(name, image, environment, arch = "amd64") = ), linux_pipeline( - "Linux 23.04 GCC 13 32/64", - "cppalliance/droneubuntu2304:1", + "Linux 24.04 GCC 13 32/64", + "cppalliance/droneubuntu2404:1", { TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '11,14,17,20,2b', ADDRMD: '32,64' }, "g++-13-multilib", ), @@ -333,22 +333,22 @@ local windows_pipeline(name, image, environment, arch = "amd64") = ), linux_pipeline( - "Linux 23.04 Clang 16", - "cppalliance/droneubuntu2304:1", + "Linux 24.04 Clang 16", + "cppalliance/droneubuntu2404:1", { TOOLSET: 'clang', COMPILER: 'clang++-16', CXXSTD: '11,14,17,20,2b' }, "clang-16", ), linux_pipeline( - "Linux 23.10 Clang 17 UBSAN", - "cppalliance/droneubuntu2310:1", + "Linux 24.04 Clang 17 UBSAN", + "cppalliance/droneubuntu2404:1", { TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '11,14,17,20,2b' } + ubsan, "clang-17", ), linux_pipeline( - "Linux 23.10 Clang 17 ASAN", - "cppalliance/droneubuntu2310:1", + "Linux 24.04 Clang 17 ASAN", + "cppalliance/droneubuntu2404:1", { TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '11,14,17,20,2b' } + asan, "clang-17", ), @@ -367,6 +367,13 @@ local windows_pipeline(name, image, environment, arch = "amd64") = "clang-18", ), + linux_pipeline( + "Linux 24.10 Clang 19", + "cppalliance/droneubuntu2410:1", + { TOOLSET: 'clang', COMPILER: 'clang++-19', CXXSTD: '11,14,17,20,2b' }, + "clang-19", + ), + macos_pipeline( "MacOS 10.15 Xcode 12.2 UBSAN", { TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '11,14,17,2a' } + ubsan, From a2eb32cbcdc6208d01a874763106c2da285d883b Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Thu, 22 Jan 2026 19:29:06 +0300 Subject: [PATCH 113/115] Remove dependencies on Boost.StaticAssert. Boost.StaticAssert has been merged into Boost.Config, so remove the dependency. --- test/cmake_subdir_test/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/test/cmake_subdir_test/CMakeLists.txt b/test/cmake_subdir_test/CMakeLists.txt index 3d404555..dd92879b 100644 --- a/test/cmake_subdir_test/CMakeLists.txt +++ b/test/cmake_subdir_test/CMakeLists.txt @@ -20,7 +20,6 @@ throw_exception # Secondary dependencies -static_assert ) foreach(dep IN LISTS deps) From b811c7a36de7eedfd4a6d089c98ab30aa3f26ad8 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 22 Jan 2026 21:00:07 +0200 Subject: [PATCH 114/115] Update ci.yml --- .github/workflows/ci.yml | 107 +++++++++++++++++++++------------------ 1 file changed, 58 insertions(+), 49 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3bb06299..655c4b3e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,22 +49,26 @@ jobs: address-model: 32,64 - toolset: gcc-7 cxxstd: "11,14,17" - os: ubuntu-20.04 + container: ubuntu:20.04 + os: ubuntu-latest install: g++-7-multilib address-model: 32,64 - toolset: gcc-8 cxxstd: "11,14,17,2a" - os: ubuntu-20.04 + container: ubuntu:20.04 + os: ubuntu-latest install: g++-8-multilib address-model: 32,64 - toolset: gcc-9 cxxstd: "11,14,17,2a" - os: ubuntu-20.04 + container: ubuntu:20.04 + os: ubuntu-latest install: g++-9-multilib address-model: 32,64 - toolset: gcc-10 cxxstd: "11,14,17,2a" - os: ubuntu-20.04 + container: ubuntu:20.04 + os: ubuntu-latest install: g++-10-multilib address-model: 32,64 - toolset: gcc-11 @@ -89,6 +93,12 @@ jobs: os: ubuntu-latest install: g++-14-multilib address-model: 32,64 + - toolset: gcc-15 + cxxstd: "11,14,17,20,23,2c" + container: ubuntu:25.10 + os: ubuntu-latest + install: g++-15-multilib + address-model: 32,64 - toolset: clang compiler: clang++-3.9 cxxstd: "11,14" @@ -110,35 +120,45 @@ jobs: - toolset: clang compiler: clang++-6.0 cxxstd: "11,14,17" - os: ubuntu-20.04 + container: ubuntu:20.04 + os: ubuntu-latest install: clang-6.0 - toolset: clang compiler: clang++-7 cxxstd: "11,14,17" - os: ubuntu-20.04 + container: ubuntu:20.04 + os: ubuntu-latest install: clang-7 - toolset: clang compiler: clang++-8 cxxstd: "11,14,17" - os: ubuntu-20.04 + container: ubuntu:20.04 + os: ubuntu-latest install: clang-8 - toolset: clang compiler: clang++-9 cxxstd: "11,14,17" - os: ubuntu-20.04 + container: ubuntu:20.04 + os: ubuntu-latest install: clang-9 - toolset: clang compiler: clang++-10 cxxstd: "11,14,17,2a" - os: ubuntu-20.04 + container: ubuntu:20.04 + os: ubuntu-latest + install: clang-10 - toolset: clang compiler: clang++-11 cxxstd: "11,14,17,2a" - os: ubuntu-20.04 + container: ubuntu:20.04 + os: ubuntu-latest + install: clang-11 - toolset: clang compiler: clang++-12 cxxstd: "11,14,17,20" - os: ubuntu-20.04 + container: ubuntu:20.04 + os: ubuntu-latest + install: clang-12 - toolset: clang compiler: clang++-13 cxxstd: "11,14,17,20" @@ -178,18 +198,30 @@ jobs: - toolset: clang compiler: clang++-19 cxxstd: "11,14,17,20,2b" - container: ubuntu:24.10 + container: ubuntu:24.04 os: ubuntu-latest install: clang-19 - toolset: clang - cxxstd: "11,14,17,20,2b" - os: macos-13 + compiler: clang++-20 + cxxstd: "11,14,17,20,23,2c" + container: ubuntu:24.04 + os: ubuntu-latest + install: clang-20 + - toolset: clang + compiler: clang++-21 + cxxstd: "11,14,17,20,23,2c" + container: ubuntu:25.10 + os: ubuntu-latest + install: clang-21 - toolset: clang cxxstd: "11,14,17,20,2b" os: macos-14 - toolset: clang cxxstd: "11,14,17,20,2b" os: macos-15 + - toolset: clang + cxxstd: "11,14,17,20,23,2c" + os: macos-26 runs-on: ${{matrix.os}} @@ -263,26 +295,18 @@ jobs: fail-fast: false matrix: include: - - toolset: msvc-14.0 - cxxstd: 14,latest - addrmd: 32,64 - os: windows-2019 - - toolset: msvc-14.2 - cxxstd: "14,17,20,latest" - addrmd: 32,64 - os: windows-2019 - toolset: msvc-14.3 cxxstd: "14,17,20,latest" addrmd: 32,64 os: windows-2022 - toolset: clang-win - cxxstd: "14,17,latest" + cxxstd: "14,17,20,latest" addrmd: 32,64 - os: windows-2022 + os: windows-2025 - toolset: gcc cxxstd: "11,14,17,2a" addrmd: 64 - os: windows-2019 + os: windows-2022 runs-on: ${{matrix.os}} @@ -322,12 +346,8 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-20.04 - - os: ubuntu-22.04 - - os: ubuntu-24.04 - - os: macos-13 - - os: macos-14 - - os: macos-15 + - os: ubuntu-latest + - os: macos-latest runs-on: ${{matrix.os}} @@ -371,12 +391,8 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-20.04 - - os: ubuntu-22.04 - - os: ubuntu-24.04 - - os: macos-13 - - os: macos-14 - - os: macos-15 + - os: ubuntu-latest + - os: macos-latest runs-on: ${{matrix.os}} @@ -430,12 +446,8 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-20.04 - - os: ubuntu-22.04 - - os: ubuntu-24.04 - - os: macos-13 - - os: macos-14 - - os: macos-15 + - os: ubuntu-latest + - os: macos-latest runs-on: ${{matrix.os}} @@ -487,8 +499,7 @@ jobs: fail-fast: false matrix: include: - - os: windows-2019 - - os: windows-2022 + - os: windows-latest runs-on: ${{matrix.os}} @@ -536,8 +547,7 @@ jobs: fail-fast: false matrix: include: - - os: windows-2019 - - os: windows-2022 + - os: windows-latest runs-on: ${{matrix.os}} @@ -603,8 +613,7 @@ jobs: fail-fast: false matrix: include: - - os: windows-2019 - - os: windows-2022 + - os: windows-latest runs-on: ${{matrix.os}} From 18650af5175ea247aebc60ff12db1b477123d5dc Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 23 Jan 2026 05:06:26 +0200 Subject: [PATCH 115/115] Update .drone.jsonnet --- .drone.jsonnet | 49 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index dd5fd9ac..c07dd21b 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -34,7 +34,6 @@ local linux_pipeline(name, image, environment, packages = "", sources = [], arch 'set -e', 'uname -a', 'echo $DRONE_STAGE_MACHINE', - 'wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -', ] + (if sources != [] then [ ('apt-add-repository "' + source + '"') for source in sources ] else []) + (if packages != "" then [ 'apt-get update', 'apt-get -y install ' + packages ] else []) + @@ -213,6 +212,13 @@ local windows_pipeline(name, image, environment, arch = "amd64") = "g++-14-multilib", ), + linux_pipeline( + "Linux 25.10 GCC 15 32/64", + "cppalliance/droneubuntu2510:1", + { TOOLSET: 'gcc', COMPILER: 'g++-15', CXXSTD: '11,14,17,20,23,2c', ADDRMD: '32,64' }, + "g++-15-multilib", + ), + linux_pipeline( "Linux 16.04 Clang 3.5", "cppalliance/droneubuntu1604:1", @@ -340,38 +346,45 @@ local windows_pipeline(name, image, environment, arch = "amd64") = ), linux_pipeline( - "Linux 24.04 Clang 17 UBSAN", + "Linux 24.04 Clang 17", "cppalliance/droneubuntu2404:1", - { TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '11,14,17,20,2b' } + ubsan, + { TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '11,14,17,20,2b' }, "clang-17", ), linux_pipeline( - "Linux 24.04 Clang 17 ASAN", + "Linux 24.04 Clang 18", "cppalliance/droneubuntu2404:1", - { TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '11,14,17,20,2b' } + asan, - "clang-17", + { TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '11,14,17,20,2b' }, + "clang-18", ), linux_pipeline( - "Linux 24.04 Clang 18 UBSAN", + "Linux 24.04 Clang 19", "cppalliance/droneubuntu2404:1", - { TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '11,14,17,20,2b' } + ubsan, + { TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '11,14,17,20,2b' }, "clang-18", ), linux_pipeline( - "Linux 24.04 Clang 18 ASAN", + "Linux 24.04 Clang 20 UBSAN", "cppalliance/droneubuntu2404:1", - { TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '11,14,17,20,2b' } + asan, - "clang-18", + { TOOLSET: 'clang', COMPILER: 'clang++-20', CXXSTD: '11,14,17,20,2b' } + ubsan, + "clang-20", ), linux_pipeline( - "Linux 24.10 Clang 19", - "cppalliance/droneubuntu2410:1", - { TOOLSET: 'clang', COMPILER: 'clang++-19', CXXSTD: '11,14,17,20,2b' }, - "clang-19", + "Linux 24.04 Clang 20 ASAN", + "cppalliance/droneubuntu2404:1", + { TOOLSET: 'clang', COMPILER: 'clang++-20', CXXSTD: '11,14,17,20,2b' } + asan, + "clang-20", + ), + + linux_pipeline( + "Linux 25.10 Clang 21", + "cppalliance/droneubuntu2510:1", + { TOOLSET: 'clang', COMPILER: 'clang++-21', CXXSTD: '11,14,17,20,23,2c' }, + "clang-21", ), macos_pipeline( @@ -419,4 +432,10 @@ local windows_pipeline(name, image, environment, arch = "amd64") = "cppalliance/dronevs2022:1", { TOOLSET: 'msvc-14.3', CXXSTD: '14,17,20,latest' }, ), + + windows_pipeline( + "Windows VS2026 msvc-14.5", + "cppalliance/dronevs2026:1", + { TOOLSET: 'msvc-14.5', CXXSTD: '14,17,20,latest' }, + ), ]