mirror of
https://github.com/boostorg/bind.git
synced 2026-08-17 19:01:44 +02:00
Compare commits
25
Commits
boost-1.75.0
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
edc56d8442 | ||
|
|
57d26f5ab3 | ||
|
|
f50916d0e1 | ||
|
|
a5491d988a | ||
|
|
536721c41d | ||
|
|
f75413b14a | ||
|
|
988a8707b4 | ||
|
|
f6026ae53f | ||
|
|
5599f2210f | ||
|
|
24bd5e7e5b | ||
|
|
b0b2ed2814 | ||
|
|
b719777942 | ||
|
|
5b1fe62dbb | ||
|
|
34a3ee580c | ||
|
|
ebc0c07e96 | ||
|
|
12e2ca325d | ||
|
|
1e3efb361b | ||
|
|
bb50844171 | ||
|
|
ee25007a9f | ||
|
|
c85b31e3d2 | ||
|
|
6c84518748 | ||
|
|
725fc8f73f | ||
|
|
a373d662b4 | ||
|
|
df4e0530e8 | ||
|
|
dbd3d09ede |
+281
@@ -0,0 +1,281 @@
|
|||||||
|
# Copyright 2022 Peter Dimov
|
||||||
|
# Distributed under the Boost Software License, Version 1.0.
|
||||||
|
# https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
local library = "bind";
|
||||||
|
|
||||||
|
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",
|
||||||
|
"cppalliance/droneubuntu1404:1",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++-4.6', CXXSTD: '98,0x' },
|
||||||
|
"g++-4.6",
|
||||||
|
[ "ppa:ubuntu-toolchain-r/test" ],
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 14.04 GCC 4.7",
|
||||||
|
"cppalliance/droneubuntu1404:1",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++-4.7', CXXSTD: '98,0x' },
|
||||||
|
"g++-4.7",
|
||||||
|
[ "ppa:ubuntu-toolchain-r/test" ],
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 14.04 GCC 4.8*",
|
||||||
|
"cppalliance/droneubuntu1404:1",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11' },
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 14.04 GCC 4.9",
|
||||||
|
"cppalliance/droneubuntu1404:1",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++-4.9', CXXSTD: '03,11' },
|
||||||
|
"g++-4.9",
|
||||||
|
[ "ppa:ubuntu-toolchain-r/test" ],
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 16.04 GCC 5*",
|
||||||
|
"cppalliance/droneubuntu1604:1",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14' },
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 18.04 GCC 6",
|
||||||
|
"cppalliance/droneubuntu1804:1",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++-6', CXXSTD: '03,11,14' },
|
||||||
|
"g++-6",
|
||||||
|
),
|
||||||
|
|
||||||
|
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",
|
||||||
|
"cppalliance/droneubuntu1804:1",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++-8', CXXSTD: '03,11,14,17' },
|
||||||
|
"g++-8",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 20.04 GCC 9* 32",
|
||||||
|
"cppalliance/droneubuntu2004:1",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a', ADDRMD: '32' },
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 20.04 GCC 9* 64",
|
||||||
|
"cppalliance/droneubuntu2004:1",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a', ADDRMD: '64' },
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 20.04 GCC 9 ARM64 32/64",
|
||||||
|
"cppalliance/droneubuntu2004:multiarch",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a', ADDRMD: '32,64' },
|
||||||
|
arch="arm64",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 20.04 GCC 10 32 ASAN",
|
||||||
|
"cppalliance/droneubuntu2004:1",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++-10', CXXSTD: '03,11,14,17,20', ADDRMD: '32' } + asan,
|
||||||
|
"g++-10-multilib",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 20.04 GCC 10 64 ASAN",
|
||||||
|
"cppalliance/droneubuntu2004:1",
|
||||||
|
{ TOOLSET: 'gcc', COMPILER: 'g++-10', CXXSTD: '03,11,14,17,20', ADDRMD: '64' } + asan,
|
||||||
|
"g++-10-multilib",
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 16.04 Clang 3.5",
|
||||||
|
"cppalliance/droneubuntu1604:1",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++-3.5', CXXSTD: '03,11,14' },
|
||||||
|
"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 20.04 Clang 13",
|
||||||
|
"cppalliance/droneubuntu2004:1",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++-13', CXXSTD: '03,11,14,17,20' },
|
||||||
|
"clang-13",
|
||||||
|
["deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main"],
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 20.04 Clang 14 UBSAN",
|
||||||
|
"cppalliance/droneubuntu2004:1",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++-14', CXXSTD: '03,11,14,17,20' } + ubsan,
|
||||||
|
"clang-14",
|
||||||
|
["deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main"],
|
||||||
|
),
|
||||||
|
|
||||||
|
linux_pipeline(
|
||||||
|
"Linux 20.04 Clang 14 ASAN",
|
||||||
|
"cppalliance/droneubuntu2004:1",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++-14', CXXSTD: '03,11,14,17,20' } + asan,
|
||||||
|
"clang-14",
|
||||||
|
["deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main"],
|
||||||
|
),
|
||||||
|
|
||||||
|
macos_pipeline(
|
||||||
|
"MacOS 10.15 Xcode 12.2 UBSAN",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,1z' } + ubsan,
|
||||||
|
),
|
||||||
|
|
||||||
|
macos_pipeline(
|
||||||
|
"MacOS 10.15 Xcode 12.2 ASAN",
|
||||||
|
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,1z' } + asan,
|
||||||
|
),
|
||||||
|
|
||||||
|
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' },
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -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 %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
|
||||||
Executable
+24
@@ -0,0 +1,24 @@
|
|||||||
|
#!/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
|
||||||
|
|
||||||
|
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 $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}
|
||||||
@@ -0,0 +1,206 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- develop
|
||||||
|
- feature/**
|
||||||
|
|
||||||
|
env:
|
||||||
|
UBSAN_OPTIONS: print_stacktrace=1
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
posix:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- toolset: gcc-4.8
|
||||||
|
cxxstd: "03,11"
|
||||||
|
os: ubuntu-18.04
|
||||||
|
install: g++-4.8
|
||||||
|
- toolset: gcc-5
|
||||||
|
cxxstd: "03,11,14,1z"
|
||||||
|
os: ubuntu-18.04
|
||||||
|
install: g++-5
|
||||||
|
- toolset: gcc-6
|
||||||
|
cxxstd: "03,11,14,1z"
|
||||||
|
os: ubuntu-18.04
|
||||||
|
install: g++-6
|
||||||
|
- toolset: gcc-7
|
||||||
|
cxxstd: "03,11,14,17"
|
||||||
|
os: ubuntu-18.04
|
||||||
|
- toolset: gcc-8
|
||||||
|
cxxstd: "03,11,14,17,2a"
|
||||||
|
os: ubuntu-18.04
|
||||||
|
install: g++-8
|
||||||
|
- toolset: gcc-9
|
||||||
|
cxxstd: "03,11,14,17,2a"
|
||||||
|
os: ubuntu-20.04
|
||||||
|
- toolset: gcc-10
|
||||||
|
cxxstd: "03,11,14,17,2a"
|
||||||
|
os: ubuntu-20.04
|
||||||
|
install: g++-10
|
||||||
|
- toolset: gcc-11
|
||||||
|
cxxstd: "03,11,14,17,2a"
|
||||||
|
os: ubuntu-20.04
|
||||||
|
install: g++-11
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-3.9
|
||||||
|
cxxstd: "03,11,14"
|
||||||
|
os: ubuntu-18.04
|
||||||
|
install: clang-3.9
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-4.0
|
||||||
|
cxxstd: "03,11,14"
|
||||||
|
os: ubuntu-18.04
|
||||||
|
install: clang-4.0
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-5.0
|
||||||
|
cxxstd: "03,11,14,1z"
|
||||||
|
os: ubuntu-18.04
|
||||||
|
install: clang-5.0
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-6.0
|
||||||
|
cxxstd: "03,11,14,17"
|
||||||
|
os: ubuntu-18.04
|
||||||
|
install: clang-6.0
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-7
|
||||||
|
cxxstd: "03,11,14,17"
|
||||||
|
os: ubuntu-18.04
|
||||||
|
install: clang-7
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-8
|
||||||
|
cxxstd: "03,11,14,17"
|
||||||
|
os: ubuntu-20.04
|
||||||
|
install: clang-8
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-9
|
||||||
|
cxxstd: "03,11,14,17,2a"
|
||||||
|
os: ubuntu-20.04
|
||||||
|
install: clang-9
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-10
|
||||||
|
cxxstd: "03,11,14,17,2a"
|
||||||
|
os: ubuntu-20.04
|
||||||
|
install: clang-10
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-11
|
||||||
|
cxxstd: "03,11,14,17,2a"
|
||||||
|
os: ubuntu-20.04
|
||||||
|
install: clang-11
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-12
|
||||||
|
cxxstd: "03,11,14,17,2a"
|
||||||
|
os: ubuntu-20.04
|
||||||
|
install: clang-12
|
||||||
|
- toolset: clang
|
||||||
|
cxxstd: "03,11,14,17,2a"
|
||||||
|
os: macos-10.15
|
||||||
|
|
||||||
|
runs-on: ${{matrix.os}}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Install packages
|
||||||
|
if: matrix.install
|
||||||
|
run: sudo apt install ${{matrix.install}}
|
||||||
|
|
||||||
|
- name: Setup Boost
|
||||||
|
run: |
|
||||||
|
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
|
||||||
|
LIBRARY=${GITHUB_REPOSITORY#*/}
|
||||||
|
echo LIBRARY: $LIBRARY
|
||||||
|
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
|
||||||
|
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
|
||||||
|
echo GITHUB_REF: $GITHUB_REF
|
||||||
|
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
|
||||||
|
REF=${REF#refs/heads/}
|
||||||
|
echo REF: $REF
|
||||||
|
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
|
||||||
|
echo BOOST_BRANCH: $BOOST_BRANCH
|
||||||
|
cd ..
|
||||||
|
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||||
|
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
|
||||||
|
./bootstrap.sh
|
||||||
|
./b2 -d0 headers
|
||||||
|
|
||||||
|
- name: Create user-config.jam
|
||||||
|
if: matrix.compiler
|
||||||
|
run: |
|
||||||
|
echo "using ${{matrix.toolset}} : : ${{matrix.compiler}} ;" > ~/user-config.jam
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: |
|
||||||
|
cd ../boost-root
|
||||||
|
./b2 -j3 libs/$LIBRARY/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} variant=debug,release
|
||||||
|
|
||||||
|
windows:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- toolset: msvc-14.0
|
||||||
|
cxxstd: "14,latest"
|
||||||
|
addrmd: 32,64
|
||||||
|
os: windows-2019
|
||||||
|
- toolset: msvc-14.1
|
||||||
|
cxxstd: "14,17,latest"
|
||||||
|
addrmd: 32,64
|
||||||
|
os: windows-2016
|
||||||
|
- 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"
|
||||||
|
addrmd: 32,64
|
||||||
|
os: windows-2022
|
||||||
|
- toolset: gcc
|
||||||
|
cxxstd: "03,11,14,17,2a"
|
||||||
|
addrmd: 64
|
||||||
|
os: windows-2019
|
||||||
|
|
||||||
|
runs-on: ${{matrix.os}}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- 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%
|
||||||
|
cmd /c bootstrap
|
||||||
|
b2 -d0 headers
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
cd ../boost-root
|
||||||
|
b2 -j3 libs/%LIBRARY%/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} address-model=${{matrix.addrmd}} variant=debug,release embed-manifest-via=linker
|
||||||
+1
-1
@@ -311,7 +311,7 @@ matrix:
|
|||||||
env: CMAKE_TEST=1
|
env: CMAKE_TEST=1
|
||||||
script:
|
script:
|
||||||
- mkdir __build__ && cd __build__
|
- mkdir __build__ && cd __build__
|
||||||
- cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 -DBOOST_INCLUDE_LIBRARIES=bind ..
|
- cmake -DBOOST_ENABLE_CMAKE=1 -DBUILD_TESTING=ON -DBoost_VERBOSE=1 -DBOOST_INCLUDE_LIBRARIES=bind ..
|
||||||
- ctest --output-on-failure -R boost_bind
|
- ctest --output-on-failure -R boost_bind
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
|
|||||||
+6
-9
@@ -16,17 +16,14 @@ environment:
|
|||||||
matrix:
|
matrix:
|
||||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||||
TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0
|
TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0
|
||||||
|
ADDRMD: 32
|
||||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||||
TOOLSET: msvc-12.0,msvc-14.0
|
TOOLSET: msvc-12.0
|
||||||
ADDRESS_MODEL: 32,64
|
ADDRMD: 32,64
|
||||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||||
TOOLSET: msvc-14.1,clang-win
|
TOOLSET: msvc-14.1,clang-win
|
||||||
CXXSTD: 14,17
|
CXXSTD: 14,17
|
||||||
ADDRESS_MODEL: 32,64
|
ADDRMD: 32,64
|
||||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
|
||||||
TOOLSET: msvc-14.2
|
|
||||||
CXXSTD: 14,17,latest
|
|
||||||
ADDRESS_MODEL: 32,64
|
|
||||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||||
ADDPATH: C:\cygwin\bin;
|
ADDPATH: C:\cygwin\bin;
|
||||||
TOOLSET: gcc
|
TOOLSET: gcc
|
||||||
@@ -61,5 +58,5 @@ build: off
|
|||||||
test_script:
|
test_script:
|
||||||
- PATH=%ADDPATH%%PATH%
|
- PATH=%ADDPATH%%PATH%
|
||||||
- if not "%CXXSTD%" == "" set CXXSTD=cxxstd=%CXXSTD%
|
- if not "%CXXSTD%" == "" set CXXSTD=cxxstd=%CXXSTD%
|
||||||
- if not "%ADDRESS_MODEL%" == "" set ADDRESS_MODEL=address-model=%ADDRESS_MODEL%
|
- if not "%ADDRMD%" == "" set ADDRMD=address-model=%ADDRMD%
|
||||||
- b2 -j3 libs/bind/test toolset=%TOOLSET% %CXXSTD% %ADDRESS_MODEL% variant=debug,release
|
- b2 -j3 libs/bind/test toolset=%TOOLSET% %CXXSTD% %ADDRMD% variant=debug,release
|
||||||
|
|||||||
@@ -11,6 +11,8 @@
|
|||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -18,6 +20,15 @@ template<class R> struct apply
|
|||||||
{
|
{
|
||||||
typedef R result_type;
|
typedef R result_type;
|
||||||
|
|
||||||
|
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||||
|
|
||||||
|
template<class F, class... A> result_type operator()( F&& f, A&&... a ) const
|
||||||
|
{
|
||||||
|
return static_cast<F&&>( f )( static_cast<A&&>( a )... );
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
template<class F> result_type operator()(F & f) const
|
template<class F> result_type operator()(F & f) const
|
||||||
{
|
{
|
||||||
return f();
|
return f();
|
||||||
@@ -67,6 +78,8 @@ template<class R> struct apply
|
|||||||
{
|
{
|
||||||
return f(a1, a2, a3, a4, a5, a6, a7, a8, a9);
|
return f(a1, a2, a3, a4, a5, a6, a7, a8, a9);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
#include <boost/is_placeholder.hpp>
|
#include <boost/is_placeholder.hpp>
|
||||||
#include <boost/bind/arg.hpp>
|
#include <boost/bind/arg.hpp>
|
||||||
#include <boost/bind/detail/result_traits.hpp>
|
#include <boost/bind/detail/result_traits.hpp>
|
||||||
|
#include <boost/bind/std_placeholders.hpp>
|
||||||
#include <boost/detail/workaround.hpp>
|
#include <boost/detail/workaround.hpp>
|
||||||
#include <boost/visit_each.hpp>
|
#include <boost/visit_each.hpp>
|
||||||
#include <boost/core/enable_if.hpp>
|
#include <boost/core/enable_if.hpp>
|
||||||
@@ -843,7 +844,7 @@ public:
|
|||||||
|
|
||||||
// bind_t
|
// bind_t
|
||||||
|
|
||||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !(defined(BOOST_GCC) && BOOST_GCC < 40600)
|
||||||
|
|
||||||
template< class A1 > class rrlist1
|
template< class A1 > class rrlist1
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -21,7 +21,9 @@
|
|||||||
// See http://www.boost.org/libs/bind/bind.html for documentation.
|
// See http://www.boost.org/libs/bind/bind.html for documentation.
|
||||||
//
|
//
|
||||||
|
|
||||||
#if defined(_MSVC_LANG) && _MSVC_LANG >= 17
|
#include <boost/config.hpp>
|
||||||
|
|
||||||
|
#if BOOST_CXX_VERSION >= 201700L
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -48,7 +50,7 @@ template<class F> struct result_traits< unspecified, reference_wrapper<F> >
|
|||||||
typedef typename F::result_type type;
|
typedef typename F::result_type type;
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(_MSVC_LANG) && _MSVC_LANG >= 17
|
#if BOOST_CXX_VERSION >= 201700L
|
||||||
|
|
||||||
template<class T> struct result_traits< unspecified, std::plus<T> >
|
template<class T> struct result_traits< unspecified, std::plus<T> >
|
||||||
{
|
{
|
||||||
@@ -140,6 +142,12 @@ template<class T> struct result_traits< unspecified, std::bit_xor<T> >
|
|||||||
typedef T type;
|
typedef T type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if defined(BOOST_LIBSTDCXX_VERSION) && BOOST_LIBSTDCXX_VERSION < 40900
|
||||||
|
|
||||||
|
// libstdc++ 4.8 and below don't have std::bit_not
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
template<class T> struct result_traits< unspecified, std::bit_not<T> >
|
template<class T> struct result_traits< unspecified, std::bit_not<T> >
|
||||||
{
|
{
|
||||||
typedef T type;
|
typedef T type;
|
||||||
@@ -147,6 +155,8 @@ template<class T> struct result_traits< unspecified, std::bit_not<T> >
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
} // namespace _bi
|
} // namespace _bi
|
||||||
|
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace boost
|
|||||||
namespace _bi
|
namespace _bi
|
||||||
{
|
{
|
||||||
|
|
||||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_DECLTYPE)
|
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_DECLTYPE) && !(defined(BOOST_GCC) && BOOST_GCC < 40600)
|
||||||
|
|
||||||
template<class T> struct protect_make_void
|
template<class T> struct protect_make_void
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
#ifndef BOOST_BIND_STD_PLACEHOLDERS_HPP_INCLUDED
|
||||||
|
#define BOOST_BIND_STD_PLACEHOLDERS_HPP_INCLUDED
|
||||||
|
|
||||||
|
// MS compatible compilers support #pragma once
|
||||||
|
|
||||||
|
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||||
|
# pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Copyright 2021 Peter Dimov
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
#include <boost/is_placeholder.hpp>
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
|
||||||
|
#if !defined(BOOST_NO_CXX11_HDR_FUNCTIONAL) && !defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
#include <type_traits>
|
||||||
|
|
||||||
|
namespace boost
|
||||||
|
{
|
||||||
|
|
||||||
|
template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_1)>::type > { enum _vt { value = 1 }; };
|
||||||
|
template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_2)>::type > { enum _vt { value = 2 }; };
|
||||||
|
template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_3)>::type > { enum _vt { value = 3 }; };
|
||||||
|
template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_4)>::type > { enum _vt { value = 4 }; };
|
||||||
|
template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_5)>::type > { enum _vt { value = 5 }; };
|
||||||
|
template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_6)>::type > { enum _vt { value = 6 }; };
|
||||||
|
template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_7)>::type > { enum _vt { value = 7 }; };
|
||||||
|
template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_8)>::type > { enum _vt { value = 8 }; };
|
||||||
|
template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_9)>::type > { enum _vt { value = 9 }; };
|
||||||
|
|
||||||
|
} // namespace boost
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // #ifndef BOOST_BIND_STD_PLACEHOLDERS_HPP_INCLUDED
|
||||||
+5
-3
@@ -13,8 +13,9 @@
|
|||||||
"Function-objects"
|
"Function-objects"
|
||||||
],
|
],
|
||||||
"maintainers": [
|
"maintainers": [
|
||||||
"Peter Dimov <pdimov -at- pdimov.com>"
|
"Peter Dimov <pdimov -at- gmail.com>"
|
||||||
]
|
],
|
||||||
|
"cxxstd": "03"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "bind/mem_fn",
|
"key": "bind/mem_fn",
|
||||||
@@ -29,6 +30,7 @@
|
|||||||
],
|
],
|
||||||
"category": [
|
"category": [
|
||||||
"Function-objects"
|
"Function-objects"
|
||||||
]
|
],
|
||||||
|
"cxxstd": "03"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -78,3 +78,8 @@ run bind_cpp20_test.cpp ;
|
|||||||
run protect_test2.cpp ;
|
run protect_test2.cpp ;
|
||||||
run protect_cpp20_test.cpp ;
|
run protect_cpp20_test.cpp ;
|
||||||
run bind_noexcept_mf2_test.cpp ;
|
run bind_noexcept_mf2_test.cpp ;
|
||||||
|
run std_placeholders_test.cpp ;
|
||||||
|
run apply_test.cpp ;
|
||||||
|
run apply_test2.cpp ;
|
||||||
|
run apply_rv_test.cpp ;
|
||||||
|
run apply_rv_test2.cpp ;
|
||||||
|
|||||||
@@ -0,0 +1,77 @@
|
|||||||
|
// Copyright 2021 Peter Dimov
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
#include<boost/bind/apply.hpp>
|
||||||
|
#include<boost/bind/bind.hpp>
|
||||||
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
#include <boost/config/pragma_message.hpp>
|
||||||
|
|
||||||
|
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||||
|
|
||||||
|
BOOST_PRAGMA_MESSAGE("Skipping test because BOOST_NO_CXX11_RVALUE_REFERENCES is defined")
|
||||||
|
int main() {}
|
||||||
|
|
||||||
|
#elif defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||||
|
|
||||||
|
BOOST_PRAGMA_MESSAGE("Skipping test because BOOST_NO_CXX11_VARIADIC_TEMPLATES is defined")
|
||||||
|
int main() {}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
struct F
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
int operator()( int & x ) const
|
||||||
|
{
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
int operator()( int && x ) const
|
||||||
|
{
|
||||||
|
return -x;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
int& get_lvalue_arg()
|
||||||
|
{
|
||||||
|
static int a = 1;
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
|
||||||
|
int get_prvalue_arg()
|
||||||
|
{
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
F& get_lvalue_f()
|
||||||
|
{
|
||||||
|
static F f;
|
||||||
|
return f;
|
||||||
|
}
|
||||||
|
|
||||||
|
F get_prvalue_f()
|
||||||
|
{
|
||||||
|
return F();
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
using namespace boost::placeholders;
|
||||||
|
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(get_lvalue_f), boost::bind(get_lvalue_arg))(), 1 );
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(get_lvalue_f), boost::bind(get_prvalue_arg))(), -2 );
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(get_prvalue_f), boost::bind(get_lvalue_arg))(), 1 );
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(get_prvalue_f), boost::bind(get_prvalue_arg))(), -2 );
|
||||||
|
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(boost::apply<F&>(), _1), boost::bind(boost::apply<int&>(), _2))(get_lvalue_f, get_lvalue_arg), 1 );
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(boost::apply<F&>(), _1), boost::bind(boost::apply<int>(), _2))(get_lvalue_f, get_prvalue_arg), -2 );
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(boost::apply<F>(), _1), boost::bind(boost::apply<int&>(), _2))(get_prvalue_f, get_lvalue_arg), 1 );
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(boost::apply<F>(), _1), boost::bind(boost::apply<int>(), _2))(get_prvalue_f, get_prvalue_arg), -2 );
|
||||||
|
|
||||||
|
return boost::report_errors();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
// Copyright 2021 Peter Dimov
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
#include<boost/bind/apply.hpp>
|
||||||
|
#include<boost/bind/bind.hpp>
|
||||||
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
#include <boost/config/pragma_message.hpp>
|
||||||
|
|
||||||
|
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||||
|
|
||||||
|
BOOST_PRAGMA_MESSAGE("Skipping test because BOOST_NO_CXX11_RVALUE_REFERENCES is defined")
|
||||||
|
int main() {}
|
||||||
|
|
||||||
|
#elif defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||||
|
|
||||||
|
BOOST_PRAGMA_MESSAGE("Skipping test because BOOST_NO_CXX11_VARIADIC_TEMPLATES is defined")
|
||||||
|
int main() {}
|
||||||
|
|
||||||
|
#elif defined(BOOST_NO_CXX11_REF_QUALIFIERS)
|
||||||
|
|
||||||
|
BOOST_PRAGMA_MESSAGE("Skipping test because BOOST_NO_CXX11_REF_QUALIFIERS is defined")
|
||||||
|
int main() {}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
struct F
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
int operator()( int & x ) &
|
||||||
|
{
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
int operator()( int && x ) &
|
||||||
|
{
|
||||||
|
return -x;
|
||||||
|
}
|
||||||
|
|
||||||
|
int operator()( int & x ) &&
|
||||||
|
{
|
||||||
|
return x + 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
int operator()( int && x ) &&
|
||||||
|
{
|
||||||
|
return -x - 10;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
int& get_lvalue_arg()
|
||||||
|
{
|
||||||
|
static int a = 1;
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
|
||||||
|
int get_prvalue_arg()
|
||||||
|
{
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
F& get_lvalue_f()
|
||||||
|
{
|
||||||
|
static F f;
|
||||||
|
return f;
|
||||||
|
}
|
||||||
|
|
||||||
|
F get_prvalue_f()
|
||||||
|
{
|
||||||
|
return F();
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
using namespace boost::placeholders;
|
||||||
|
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(get_lvalue_f), boost::bind(get_lvalue_arg))(), 1 );
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(get_lvalue_f), boost::bind(get_prvalue_arg))(), -2 );
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(get_prvalue_f), boost::bind(get_lvalue_arg))(), 11 );
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(get_prvalue_f), boost::bind(get_prvalue_arg))(), -12 );
|
||||||
|
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(boost::apply<F&>(), _1), boost::bind(boost::apply<int&>(), _2))(get_lvalue_f, get_lvalue_arg), 1 );
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(boost::apply<F&>(), _1), boost::bind(boost::apply<int>(), _2))(get_lvalue_f, get_prvalue_arg), -2 );
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(boost::apply<F>(), _1), boost::bind(boost::apply<int&>(), _2))(get_prvalue_f, get_lvalue_arg), 11 );
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(boost::apply<F>(), _1), boost::bind(boost::apply<int>(), _2))(get_prvalue_f, get_prvalue_arg), -12 );
|
||||||
|
|
||||||
|
return boost::report_errors();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
// Copyright 2021 Peter Dimov
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
#include <boost/bind/apply.hpp>
|
||||||
|
#include <boost/bind/protect.hpp>
|
||||||
|
#include <boost/bind/bind.hpp>
|
||||||
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
|
||||||
|
using namespace boost::placeholders;
|
||||||
|
|
||||||
|
int f( int x )
|
||||||
|
{
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
BOOST_TEST_EQ( boost::bind( boost::apply<int>(), boost::protect( boost::bind( f, _1 ) ), 1 )(), 1 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( boost::apply<int>(), boost::protect( boost::bind( f, _2 ) ), 1, 2 )(), 2 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( boost::apply<int>(), boost::protect( boost::bind( f, _3 ) ), 1, 2, 3 )(), 3 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( boost::apply<int>(), boost::protect( boost::bind( f, _4 ) ), 1, 2, 3, 4 )(), 4 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( boost::apply<int>(), boost::protect( boost::bind( f, _5 ) ), 1, 2, 3, 4, 5 )(), 5 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( boost::apply<int>(), boost::protect( boost::bind( f, _6 ) ), 1, 2, 3, 4, 5, 6 )(), 6 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( boost::apply<int>(), boost::protect( boost::bind( f, _7 ) ), 1, 2, 3, 4, 5, 6, 7 )(), 7 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( boost::apply<int>(), boost::protect( boost::bind( f, _8 ) ), 1, 2, 3, 4, 5, 6, 7, 8 )(), 8 );
|
||||||
|
|
||||||
|
return boost::report_errors();
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
// Copyright 2021 Peter Dimov
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
#include <boost/bind/apply.hpp>
|
||||||
|
#include <boost/core/lightweight_test_trait.hpp>
|
||||||
|
#include <boost/core/is_same.hpp>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
BOOST_TEST_TRAIT_TRUE((boost::core::is_same<void, boost::apply<void>::result_type>));
|
||||||
|
BOOST_TEST_TRAIT_TRUE((boost::core::is_same<int&, boost::apply<int&>::result_type>));
|
||||||
|
|
||||||
|
return boost::report_errors();
|
||||||
|
}
|
||||||
@@ -1,4 +1,12 @@
|
|||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
|
#include <boost/config/pragma_message.hpp>
|
||||||
|
|
||||||
|
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && ( defined(BOOST_GCC) && BOOST_GCC < 40600 )
|
||||||
|
|
||||||
|
BOOST_PRAGMA_MESSAGE( "Skipping test for GCC 4.4 -std=c++0x" )
|
||||||
|
int main() {}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
//
|
//
|
||||||
// bind_function2_test.cpp - regression test
|
// bind_function2_test.cpp - regression test
|
||||||
@@ -118,3 +126,5 @@ int main()
|
|||||||
function_test();
|
function_test();
|
||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
|
#include <boost/config/pragma_message.hpp>
|
||||||
|
|
||||||
//
|
//
|
||||||
// bind_function_ap_test.cpp - regression test
|
// bind_function_ap_test.cpp - regression test
|
||||||
@@ -10,11 +11,15 @@
|
|||||||
// http://www.boost.org/LICENSE_1_0.txt
|
// http://www.boost.org/LICENSE_1_0.txt
|
||||||
//
|
//
|
||||||
|
|
||||||
#if defined( BOOST_NO_AUTO_PTR )
|
#if defined(BOOST_NO_AUTO_PTR)
|
||||||
|
|
||||||
int main()
|
BOOST_PRAGMA_MESSAGE( "Skipping test because BOOST_NO_AUTO_PTR is defined" )
|
||||||
{
|
int main() {}
|
||||||
}
|
|
||||||
|
#elif !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && ( defined(BOOST_GCC) && BOOST_GCC < 40600 )
|
||||||
|
|
||||||
|
BOOST_PRAGMA_MESSAGE( "Skipping test for GCC 4.4 -std=c++0x" )
|
||||||
|
int main() {}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
@@ -233,4 +238,4 @@ int main()
|
|||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // #if defined( BOOST_NO_AUTO_PTR )
|
#endif
|
||||||
|
|||||||
@@ -1,10 +1,20 @@
|
|||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
|
#include <boost/config/pragma_message.hpp>
|
||||||
|
|
||||||
#if defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) || defined( BOOST_NO_CXX11_SMART_PTR )
|
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||||
|
|
||||||
int main()
|
BOOST_PRAGMA_MESSAGE( "Skipping test because BOOST_NO_CXX11_RVALUE_REFERENCES is defined" )
|
||||||
{
|
int main() {}
|
||||||
}
|
|
||||||
|
#elif defined(BOOST_NO_CXX11_SMART_PTR)
|
||||||
|
|
||||||
|
BOOST_PRAGMA_MESSAGE( "Skipping test because BOOST_NO_CXX11_SMART_PTR is defined" )
|
||||||
|
int main() {}
|
||||||
|
|
||||||
|
#elif defined(BOOST_GCC) && BOOST_GCC < 40600
|
||||||
|
|
||||||
|
BOOST_PRAGMA_MESSAGE( "Skipping test because BOOST_GCC is less than 40600" )
|
||||||
|
int main() {}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
@@ -206,4 +216,4 @@ int main()
|
|||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // #if defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) || defined( BOOST_NO_CXX11_SMART_PTR )
|
#endif
|
||||||
|
|||||||
@@ -9,12 +9,17 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
|
#include <boost/config/pragma_message.hpp>
|
||||||
|
|
||||||
#if defined( BOOST_NO_CXX11_HDR_FUNCTIONAL )
|
#if defined(BOOST_NO_CXX11_HDR_FUNCTIONAL)
|
||||||
|
|
||||||
int main()
|
BOOST_PRAGMA_MESSAGE( "Skipping test because BOOST_NO_CXX11_HDR_FUNCTIONAL is defined" )
|
||||||
{
|
int main() {}
|
||||||
}
|
|
||||||
|
#elif defined(BOOST_GCC) && BOOST_GCC < 40600
|
||||||
|
|
||||||
|
BOOST_PRAGMA_MESSAGE( "Skipping test because BOOST_GCC is less than 40600" )
|
||||||
|
int main() {}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ int main()
|
|||||||
{
|
{
|
||||||
test<X>( boost::protect( X() ) );
|
test<X>( boost::protect( X() ) );
|
||||||
|
|
||||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_DECLTYPE)
|
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_DECLTYPE) && !(defined(BOOST_GCC) && BOOST_GCC < 40600)
|
||||||
|
|
||||||
test2( boost::protect( Y() ) );
|
test2( boost::protect( Y() ) );
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
// Copyright 2021 Peter Dimov
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
#include <boost/bind/bind.hpp>
|
||||||
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
#include <functional>
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
#include <boost/config/pragma_message.hpp>
|
||||||
|
|
||||||
|
#if defined(BOOST_NO_CXX11_HDR_FUNCTIONAL)
|
||||||
|
|
||||||
|
BOOST_PRAGMA_MESSAGE( "Skipping test due to BOOST_NO_CXX11_HDR_FUNCTIONAL being defined" )
|
||||||
|
int main() {}
|
||||||
|
|
||||||
|
#elif defined(BOOST_NO_CXX11_DECLTYPE)
|
||||||
|
|
||||||
|
BOOST_PRAGMA_MESSAGE( "Skipping test due to BOOST_NO_CXX11_DECLTYPE being defined" )
|
||||||
|
int main() {}
|
||||||
|
|
||||||
|
#elif defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
|
||||||
|
|
||||||
|
BOOST_PRAGMA_MESSAGE( "Skipping test due to BOOST_NO_CXX11_HDR_TYPE_TRAITS being defined" )
|
||||||
|
int main() {}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
int f( int x )
|
||||||
|
{
|
||||||
|
return -x;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
using namespace std::placeholders;
|
||||||
|
|
||||||
|
BOOST_TEST_EQ( boost::bind( f, _1 )( 1 ), -1 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( f, _2 )( 1, 2 ), -2 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( f, _3 )( 1, 2, 3 ), -3 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( f, _4 )( 1, 2, 3, 4 ), -4 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( f, _5 )( 1, 2, 3, 4, 5 ), -5 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( f, _6 )( 1, 2, 3, 4, 5, 6 ), -6 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( f, _7 )( 1, 2, 3, 4, 5, 6, 7 ), -7 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( f, _8 )( 1, 2, 3, 4, 5, 6, 7, 8 ), -8 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( f, _9 )( 1, 2, 3, 4, 5, 6, 7, 8, 9 ), -9 );
|
||||||
|
|
||||||
|
return boost::report_errors();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user