mirror of
https://github.com/boostorg/parameter.git
synced 2026-01-27 19:12:12 +00:00
Compare commits
36 Commits
boost-1.78
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9984eff746 | ||
|
|
2592296b41 | ||
|
|
923aedf577 | ||
|
|
67861ef6ad | ||
|
|
a526242486 | ||
|
|
c86e3e4dec | ||
|
|
253b11d0df | ||
|
|
248b911831 | ||
|
|
530564aa2a | ||
|
|
e67ba43bc9 | ||
|
|
782f1b14a9 | ||
|
|
1e842b3f34 | ||
|
|
a5a7e548db | ||
|
|
c142f7bdc2 | ||
|
|
dadb7c1222 | ||
|
|
ea493c7cd7 | ||
|
|
f31a7acfcc | ||
|
|
c07f2b8d37 | ||
|
|
c540c03077 | ||
|
|
40a1a578a0 | ||
|
|
d830d33246 | ||
|
|
0915736af0 | ||
|
|
5db4ec8318 | ||
|
|
9328dbb7c3 | ||
|
|
c4a9b94080 | ||
|
|
8fe5cf5d0d | ||
|
|
6538609cf5 | ||
|
|
02e1c566f7 | ||
|
|
b35192723c | ||
|
|
e1f75be395 | ||
|
|
fae4c2dacc | ||
|
|
665cdbc94c | ||
|
|
df9ea43b66 | ||
|
|
0376be4112 | ||
|
|
c82f2ec688 | ||
|
|
9780d8338f |
372
.github/workflows/ci.yml
vendored
372
.github/workflows/ci.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
# Copyright 2021 Andrey Semashev
|
# Copyright 2021-2025 Andrey Semashev
|
||||||
#
|
#
|
||||||
# Distributed under the Boost Software License, Version 1.0.
|
# Distributed under the Boost Software License, Version 1.0.
|
||||||
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
|
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
|
||||||
@@ -33,209 +33,284 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
# Linux, gcc
|
# Linux, gcc
|
||||||
- toolset: gcc-4.4
|
|
||||||
cxxstd: "98,0x"
|
|
||||||
os: ubuntu-20.04
|
|
||||||
container: ubuntu:16.04
|
|
||||||
install:
|
|
||||||
- g++-4.4
|
|
||||||
sources:
|
|
||||||
- "ppa:ubuntu-toolchain-r/test"
|
|
||||||
- toolset: gcc-4.6
|
|
||||||
cxxstd: "03,0x"
|
|
||||||
os: ubuntu-20.04
|
|
||||||
container: ubuntu:16.04
|
|
||||||
install:
|
|
||||||
- g++-4.6
|
|
||||||
sources:
|
|
||||||
- "ppa:ubuntu-toolchain-r/test"
|
|
||||||
- toolset: gcc-4.7
|
|
||||||
cxxstd: "03,11"
|
|
||||||
os: ubuntu-20.04
|
|
||||||
container: ubuntu:16.04
|
|
||||||
install:
|
|
||||||
- g++-4.7
|
|
||||||
- toolset: gcc-4.8
|
- toolset: gcc-4.8
|
||||||
cxxstd: "03,11"
|
cxxstd: "11"
|
||||||
os: ubuntu-18.04
|
os: ubuntu-latest
|
||||||
|
container: ubuntu:18.04
|
||||||
install:
|
install:
|
||||||
- g++-4.8
|
- g++-4.8
|
||||||
- toolset: gcc-4.9
|
- toolset: gcc-4.9
|
||||||
cxxstd: "03,11"
|
cxxstd: "11"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-latest
|
||||||
container: ubuntu:16.04
|
container: ubuntu:16.04
|
||||||
install:
|
install:
|
||||||
- g++-4.9
|
- g++-4.9
|
||||||
- toolset: gcc-5
|
- toolset: gcc-5
|
||||||
cxxstd: "03,11,14,1z"
|
cxxstd: "11,14,1z"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-latest
|
||||||
container: ubuntu:16.04
|
container: ubuntu:16.04
|
||||||
install:
|
install:
|
||||||
- g++-5
|
- g++-5
|
||||||
- toolset: gcc-6
|
- toolset: gcc-6
|
||||||
cxxstd: "03,11,14,1z"
|
cxxstd: "11,14,1z"
|
||||||
os: ubuntu-18.04
|
os: ubuntu-latest
|
||||||
|
container: ubuntu:18.04
|
||||||
install:
|
install:
|
||||||
- g++-6
|
- g++-6
|
||||||
- toolset: gcc-7
|
- toolset: gcc-7
|
||||||
cxxstd: "03,11,14,17"
|
cxxstd: "11,14,17"
|
||||||
os: ubuntu-18.04
|
os: ubuntu-latest
|
||||||
|
container: ubuntu:18.04
|
||||||
install:
|
install:
|
||||||
- g++-7
|
- g++-7
|
||||||
- toolset: gcc-8
|
- toolset: gcc-8
|
||||||
cxxstd: "03,11,14,17,2a"
|
cxxstd: "11,14,17,2a"
|
||||||
os: ubuntu-18.04
|
os: ubuntu-latest
|
||||||
|
container: ubuntu:18.04
|
||||||
install:
|
install:
|
||||||
- g++-8
|
- g++-8
|
||||||
- toolset: gcc-9
|
- toolset: gcc-9
|
||||||
cxxstd: "03,11,14,17,2a"
|
cxxstd: "11,14,17,2a"
|
||||||
os: ubuntu-18.04
|
os: ubuntu-latest
|
||||||
|
container: ubuntu:20.04
|
||||||
install:
|
install:
|
||||||
- g++-9
|
- g++-9
|
||||||
- toolset: gcc-10
|
- toolset: gcc-10
|
||||||
cxxstd: "03,11,14,17,20"
|
cxxstd: "11,14,17,20"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-latest
|
||||||
|
container: ubuntu:20.04
|
||||||
install:
|
install:
|
||||||
- g++-10
|
- g++-10
|
||||||
- toolset: gcc-11
|
- toolset: gcc-11
|
||||||
cxxstd: "03,11,14,17,20"
|
cxxstd: "11,14,17,20,23"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-22.04
|
||||||
install:
|
install:
|
||||||
- g++-11
|
- g++-11
|
||||||
sources:
|
- toolset: gcc-12
|
||||||
- "ppa:ubuntu-toolchain-r/test"
|
cxxstd: "11,14,17,20,23"
|
||||||
|
os: ubuntu-22.04
|
||||||
|
install:
|
||||||
|
- g++-12
|
||||||
|
- toolset: gcc-13
|
||||||
|
cxxstd: "11,14,17,20,23"
|
||||||
|
os: ubuntu-24.04
|
||||||
|
install:
|
||||||
|
- g++-13
|
||||||
|
- toolset: gcc-14
|
||||||
|
cxxstd: "11,14,17,20,23,26"
|
||||||
|
os: ubuntu-24.04
|
||||||
|
install:
|
||||||
|
- g++-14
|
||||||
|
- toolset: gcc-15
|
||||||
|
cxxstd: "11,14,17,20,23,26"
|
||||||
|
os: ubuntu-latest
|
||||||
|
container: ubuntu:25.04
|
||||||
|
install:
|
||||||
|
- g++-15
|
||||||
- name: UBSAN
|
- name: UBSAN
|
||||||
toolset: gcc-11
|
toolset: gcc-13
|
||||||
cxxstd: "03,11,14,17,20"
|
cxxstd: "11,14,17,20,23"
|
||||||
ubsan: 1
|
ubsan: 1
|
||||||
build_variant: debug
|
build_variant: debug
|
||||||
os: ubuntu-20.04
|
os: ubuntu-24.04
|
||||||
install:
|
install:
|
||||||
- g++-11
|
- g++-13
|
||||||
sources:
|
|
||||||
- "ppa:ubuntu-toolchain-r/test"
|
|
||||||
|
|
||||||
# Linux, clang
|
# Linux, clang
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-3.5
|
compiler: clang++-3.5
|
||||||
cxxstd: "03,11"
|
cxxstd: "11"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-latest
|
||||||
container: ubuntu:16.04
|
container: ubuntu:16.04
|
||||||
install:
|
install:
|
||||||
- clang-3.5
|
- clang-3.5
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-3.6
|
compiler: clang++-3.6
|
||||||
cxxstd: "03,11,14"
|
cxxstd: "11,14"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-latest
|
||||||
container: ubuntu:16.04
|
container: ubuntu:16.04
|
||||||
install:
|
install:
|
||||||
- clang-3.6
|
- clang-3.6
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-3.7
|
compiler: clang++-3.7
|
||||||
cxxstd: "03,11,14"
|
cxxstd: "11,14"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-latest
|
||||||
container: ubuntu:16.04
|
container: ubuntu:16.04
|
||||||
install:
|
install:
|
||||||
- clang-3.7
|
- clang-3.7
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-3.8
|
compiler: clang++-3.8
|
||||||
cxxstd: "03,11,14"
|
cxxstd: "11,14"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-latest
|
||||||
container: ubuntu:16.04
|
container: ubuntu:16.04
|
||||||
install:
|
install:
|
||||||
- clang-3.8
|
- clang-3.8
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-3.9
|
compiler: clang++-3.9
|
||||||
cxxstd: "03,11,14"
|
cxxstd: "11,14"
|
||||||
os: ubuntu-18.04
|
os: ubuntu-latest
|
||||||
|
container: ubuntu:18.04
|
||||||
install:
|
install:
|
||||||
- clang-3.9
|
- clang-3.9
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-4.0
|
compiler: clang++-4.0
|
||||||
cxxstd: "03,11,14"
|
cxxstd: "11,14"
|
||||||
os: ubuntu-18.04
|
os: ubuntu-latest
|
||||||
|
container: ubuntu:18.04
|
||||||
install:
|
install:
|
||||||
- clang-4.0
|
- clang-4.0
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-5.0
|
compiler: clang++-5.0
|
||||||
cxxstd: "03,11,14,1z"
|
cxxstd: "11,14,1z"
|
||||||
os: ubuntu-18.04
|
os: ubuntu-latest
|
||||||
|
container: ubuntu:18.04
|
||||||
install:
|
install:
|
||||||
- clang-5.0
|
- clang-5.0
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-6.0
|
compiler: clang++-6.0
|
||||||
cxxstd: "03,11,14,17"
|
cxxstd: "11,14,17"
|
||||||
os: ubuntu-18.04
|
os: ubuntu-latest
|
||||||
|
container: ubuntu:18.04
|
||||||
install:
|
install:
|
||||||
- clang-6.0
|
- clang-6.0
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-7
|
compiler: clang++-7
|
||||||
cxxstd: "03,11,14,17"
|
cxxstd: "11,14,17"
|
||||||
os: ubuntu-18.04
|
os: ubuntu-latest
|
||||||
|
container: ubuntu:18.04
|
||||||
install:
|
install:
|
||||||
- clang-7
|
- clang-7
|
||||||
# Note: clang-8 does not fully support C++20, so it is not compatible with libstdc++-8 in this mode
|
# Note: clang-8 does not fully support C++20, so it is not compatible with libstdc++-8 in this mode
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-8
|
compiler: clang++-8
|
||||||
cxxstd: "03,11,14,17,2a"
|
cxxstd: "11,14,17,2a"
|
||||||
os: ubuntu-18.04
|
os: ubuntu-latest
|
||||||
|
container: ubuntu:18.04
|
||||||
install:
|
install:
|
||||||
- clang-8
|
- clang-8
|
||||||
- g++-7
|
- g++-7
|
||||||
gcc_toolchain: 7
|
gcc_toolchain: 7
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-9
|
compiler: clang++-9
|
||||||
cxxstd: "03,11,14,17,2a"
|
cxxstd: "11,14,17,2a"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-latest
|
||||||
|
container: ubuntu:20.04
|
||||||
install:
|
install:
|
||||||
- clang-9
|
- clang-9
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-10
|
compiler: clang++-10
|
||||||
cxxstd: "03,11,14,17,20"
|
cxxstd: "11,14,17,20"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-latest
|
||||||
|
container: ubuntu:20.04
|
||||||
install:
|
install:
|
||||||
- clang-10
|
- clang-10
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-11
|
compiler: clang++-11
|
||||||
cxxstd: "03,11,14,17,20"
|
cxxstd: "11,14,17,20"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-22.04
|
||||||
install:
|
install:
|
||||||
- clang-11
|
- clang-11
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-12
|
compiler: clang++-12
|
||||||
cxxstd: "03,11,14,17,20"
|
cxxstd: "11,14,17,20,2b"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-22.04
|
||||||
install:
|
install:
|
||||||
- clang-12
|
- clang-12
|
||||||
|
- g++-11
|
||||||
|
gcc_toolchain: 11
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-12
|
compiler: clang++-13
|
||||||
cxxstd: "03,11,14,17,20"
|
cxxstd: "11,14,17,20,2b"
|
||||||
os: ubuntu-20.04
|
os: ubuntu-22.04
|
||||||
install:
|
install:
|
||||||
- clang-12
|
- clang-13
|
||||||
- libc++-12-dev
|
- g++-11
|
||||||
- libc++abi-12-dev
|
gcc_toolchain: 11
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-14
|
||||||
|
cxxstd: "11,14,17,20,2b"
|
||||||
|
os: ubuntu-22.04
|
||||||
|
install:
|
||||||
|
- clang-14
|
||||||
|
- g++-11
|
||||||
|
gcc_toolchain: 11
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-15
|
||||||
|
cxxstd: "11,14,17,20,2b"
|
||||||
|
os: ubuntu-22.04
|
||||||
|
install:
|
||||||
|
- clang-15
|
||||||
|
- g++-11
|
||||||
|
gcc_toolchain: 11
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-16
|
||||||
|
cxxstd: "11,14,17,20,2b"
|
||||||
|
os: ubuntu-24.04
|
||||||
|
install:
|
||||||
|
- clang-16
|
||||||
|
- g++-11
|
||||||
|
gcc_toolchain: 11
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-17
|
||||||
|
cxxstd: "11,14,17,20,23"
|
||||||
|
os: ubuntu-24.04
|
||||||
|
install:
|
||||||
|
- clang-17
|
||||||
|
- g++-11
|
||||||
|
gcc_toolchain: 11
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-18
|
||||||
|
cxxstd: "11,14,17,20,23,26"
|
||||||
|
os: ubuntu-24.04
|
||||||
|
install:
|
||||||
|
- clang-18
|
||||||
|
- g++-13
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-19
|
||||||
|
cxxstd: "11,14,17,20,23,26"
|
||||||
|
os: ubuntu-24.04
|
||||||
|
install:
|
||||||
|
- clang-19
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-20
|
||||||
|
cxxstd: "11,14,17,20,23,26"
|
||||||
|
os: ubuntu-latest
|
||||||
|
container: ubuntu:25.04
|
||||||
|
install:
|
||||||
|
- clang-20
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-20
|
||||||
|
cxxstd: "11,14,17,20,23,26"
|
||||||
cxxflags: -stdlib=libc++
|
cxxflags: -stdlib=libc++
|
||||||
linkflags: -stdlib=libc++
|
linkflags: -stdlib=libc++
|
||||||
|
os: ubuntu-latest
|
||||||
|
container: ubuntu:25.04
|
||||||
|
install:
|
||||||
|
- clang-20
|
||||||
|
- libc++-20-dev
|
||||||
|
- libc++abi-20-dev
|
||||||
- name: UBSAN
|
- name: UBSAN
|
||||||
toolset: clang
|
toolset: clang
|
||||||
compiler: clang++-12
|
compiler: clang++-18
|
||||||
cxxstd: "03,11,14,17,20"
|
cxxstd: "11,14,17,20,23,26"
|
||||||
cxxflags: -stdlib=libc++
|
cxxflags: -stdlib=libc++
|
||||||
linkflags: -stdlib=libc++
|
linkflags: -stdlib=libc++
|
||||||
ubsan: 1
|
ubsan: 1
|
||||||
build_variant: debug
|
build_variant: debug
|
||||||
os: ubuntu-20.04
|
os: ubuntu-24.04
|
||||||
install:
|
install:
|
||||||
- clang-12
|
- clang-18
|
||||||
- libc++-12-dev
|
- libc++-18-dev
|
||||||
- libc++abi-12-dev
|
- libc++abi-18-dev
|
||||||
|
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
cxxstd: "03,11,14,17,2a"
|
cxxstd: "11,14,17,20,2b"
|
||||||
os: macos-10.15
|
os: macos-14
|
||||||
|
- toolset: clang
|
||||||
|
cxxstd: "11,14,17,20,23"
|
||||||
|
os: macos-15
|
||||||
|
|
||||||
timeout-minutes: 60
|
timeout-minutes: 30
|
||||||
runs-on: ${{matrix.os}}
|
runs-on: ${{matrix.os}}
|
||||||
container: ${{matrix.container}}
|
container: ${{matrix.container}}
|
||||||
|
|
||||||
@@ -252,14 +327,34 @@ jobs:
|
|||||||
echo "GHA_CONTAINER=${{matrix.container}}" >> $GITHUB_ENV
|
echo "GHA_CONTAINER=${{matrix.container}}" >> $GITHUB_ENV
|
||||||
if [ -f "/etc/debian_version" ]
|
if [ -f "/etc/debian_version" ]
|
||||||
then
|
then
|
||||||
|
# Use Azure APT mirrors in containers to avoid HTTP errors due to DDoS filters triggered by lots of CI jobs launching concurrently.
|
||||||
|
# Note that not all Ubuntu versions support "mirror+file:..." URIs in APT sources, so just use Azure mirrors exclusively.
|
||||||
|
# Note also that on recent Ubuntu versions DEB822 format is used for source files.
|
||||||
|
APT_SOURCES=()
|
||||||
|
if [ -d "/etc/apt/sources.list.d" ]
|
||||||
|
then
|
||||||
|
readarray -t APT_SOURCES < <(find "/etc/apt/sources.list.d" -type f -name '*.sources' -print)
|
||||||
|
fi
|
||||||
|
if [ -f "/etc/apt/sources.list" ]
|
||||||
|
then
|
||||||
|
APT_SOURCES+=("/etc/apt/sources.list")
|
||||||
|
fi
|
||||||
|
if [ "${#APT_SOURCES[@]}" -gt 0 ]
|
||||||
|
then
|
||||||
|
sed -i -E -e 's!([^ ]+) (http|https)://(archive|security)\.ubuntu\.com/ubuntu[^ ]*(.*)!\1 http://azure.archive.ubuntu.com/ubuntu/\4!' "${APT_SOURCES[@]}"
|
||||||
|
fi
|
||||||
apt-get -o Acquire::Retries=$NET_RETRY_COUNT update
|
apt-get -o Acquire::Retries=$NET_RETRY_COUNT update
|
||||||
apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y sudo software-properties-common tzdata wget curl apt-transport-https ca-certificates make build-essential g++ python python3 libpython-dev libpython3-dev perl git cmake
|
if [ "$(apt-cache search "^python-is-python3$" | wc -l)" -ne 0 ]
|
||||||
|
then
|
||||||
|
PYTHON_PACKAGE="python-is-python3"
|
||||||
|
else
|
||||||
|
PYTHON_PACKAGE="python"
|
||||||
|
fi
|
||||||
|
apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y sudo software-properties-common tzdata wget curl apt-transport-https ca-certificates make build-essential g++ $PYTHON_PACKAGE python3 perl git cmake
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
git config --global pack.threads 0
|
git config --global pack.threads 0
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
if: matrix.install
|
if: matrix.install
|
||||||
run: |
|
run: |
|
||||||
@@ -374,11 +469,25 @@ jobs:
|
|||||||
then
|
then
|
||||||
DEPINST_ARGS+=("--git_args" "--jobs $GIT_FETCH_JOBS")
|
DEPINST_ARGS+=("--git_args" "--jobs $GIT_FETCH_JOBS")
|
||||||
fi
|
fi
|
||||||
|
mkdir -p snapshot
|
||||||
|
cd snapshot
|
||||||
|
echo "Downloading library snapshot: https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz"
|
||||||
|
curl -L --retry "$NET_RETRY_COUNT" -o "${LIBRARY}-${GITHUB_SHA}.tar.gz" "https://github.com/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz"
|
||||||
|
tar -xf "${LIBRARY}-${GITHUB_SHA}.tar.gz"
|
||||||
|
if [ ! -d "${LIBRARY}-${GITHUB_SHA}" ]
|
||||||
|
then
|
||||||
|
echo "Library snapshot does not contain the library directory ${LIBRARY}-${GITHUB_SHA}:"
|
||||||
|
ls -la
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
rm -f "${LIBRARY}-${GITHUB_SHA}.tar.gz"
|
||||||
cd ..
|
cd ..
|
||||||
git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" "boost-root"
|
git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" "boost-root"
|
||||||
cd boost-root
|
cd boost-root
|
||||||
mkdir -p libs/$LIBRARY
|
mkdir -p libs
|
||||||
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
|
rm -rf "libs/$LIBRARY"
|
||||||
|
mv -f "../snapshot/${LIBRARY}-${GITHUB_SHA}" "libs/$LIBRARY"
|
||||||
|
rm -rf "../snapshot"
|
||||||
git submodule update --init tools/boostdep
|
git submodule update --init tools/boostdep
|
||||||
DEPINST_ARGS+=("$LIBRARY")
|
DEPINST_ARGS+=("$LIBRARY")
|
||||||
python tools/boostdep/depinst/depinst.py "${DEPINST_ARGS[@]}"
|
python tools/boostdep/depinst/depinst.py "${DEPINST_ARGS[@]}"
|
||||||
@@ -400,7 +509,7 @@ jobs:
|
|||||||
- name: Run tests
|
- name: Run tests
|
||||||
if: matrix.cmake_tests == ''
|
if: matrix.cmake_tests == ''
|
||||||
run: |
|
run: |
|
||||||
cd ../boost-root
|
cd boost-root
|
||||||
B2_ARGS=("-j" "$BUILD_JOBS" "toolset=${{matrix.toolset}}" "cxxstd=${{matrix.cxxstd}}")
|
B2_ARGS=("-j" "$BUILD_JOBS" "toolset=${{matrix.toolset}}" "cxxstd=${{matrix.cxxstd}}")
|
||||||
if [ -n "${{matrix.build_variant}}" ]
|
if [ -n "${{matrix.build_variant}}" ]
|
||||||
then
|
then
|
||||||
@@ -429,3 +538,70 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
B2_ARGS+=("libs/$LIBRARY/test")
|
B2_ARGS+=("libs/$LIBRARY/test")
|
||||||
./b2 "${B2_ARGS[@]}"
|
./b2 "${B2_ARGS[@]}"
|
||||||
|
|
||||||
|
windows:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- 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: "11,14,17,20,23"
|
||||||
|
addrmd: 64
|
||||||
|
os: windows-2022
|
||||||
|
|
||||||
|
timeout-minutes: 30
|
||||||
|
runs-on: ${{matrix.os}}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- 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%
|
||||||
|
mkdir snapshot
|
||||||
|
cd snapshot
|
||||||
|
echo Downloading library snapshot: https://github.com/%GITHUB_REPOSITORY%/archive/%GITHUB_SHA%.zip
|
||||||
|
curl -L --retry %NET_RETRY_COUNT% -o "%LIBRARY%-%GITHUB_SHA%.zip" "https://github.com/%GITHUB_REPOSITORY%/archive/%GITHUB_SHA%.zip"
|
||||||
|
tar -xf "%LIBRARY%-%GITHUB_SHA%.zip"
|
||||||
|
if not exist "%LIBRARY%-%GITHUB_SHA%\" (
|
||||||
|
echo Library snapshot does not contain the library directory %LIBRARY%-%GITHUB_SHA%:
|
||||||
|
dir
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
del /f "%LIBRARY%-%GITHUB_SHA%.zip"
|
||||||
|
cd ..
|
||||||
|
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||||
|
cd boost-root
|
||||||
|
if not exist "libs\" mkdir libs
|
||||||
|
if exist "libs\%LIBRARY%\" rmdir /s /q "libs\%LIBRARY%"
|
||||||
|
move /Y "..\snapshot\%LIBRARY%-%GITHUB_SHA%" "libs\%LIBRARY%"
|
||||||
|
rmdir /s /q "..\snapshot"
|
||||||
|
git submodule update --init tools/boostdep
|
||||||
|
python tools/boostdep/depinst/depinst.py --git_args "--jobs %GIT_FETCH_JOBS%" %LIBRARY%
|
||||||
|
cmd /c bootstrap
|
||||||
|
b2 -d0 headers
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
cd boost-root
|
||||||
|
if not "${{matrix.cxxstd}}" == "" set CXXSTD=cxxstd=${{matrix.cxxstd}}
|
||||||
|
if not "${{matrix.addrmd}}" == "" set ADDRMD=address-model=${{matrix.addrmd}}
|
||||||
|
if not "${{matrix.build_variant}}" == "" (set BUILD_VARIANT=variant=${{matrix.build_variant}}) else (set BUILD_VARIANT=variant=%DEFAULT_BUILD_VARIANT%)
|
||||||
|
b2 -j %NUMBER_OF_PROCESSORS% libs/%LIBRARY%/test toolset=${{matrix.toolset}} %CXXSTD% %ADDRMD% %BUILD_VARIANT% embed-manifest-via=linker
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ Boost.Parameter, part of collection of the [Boost C++ Libraries](https://github.
|
|||||||
|
|
||||||
Branch | GitHub Actions | AppVeyor | Test Matrix | Dependencies |
|
Branch | GitHub Actions | AppVeyor | Test Matrix | Dependencies |
|
||||||
:-------------: | -------------- | -------- | ----------- | ------------ |
|
:-------------: | -------------- | -------- | ----------- | ------------ |
|
||||||
[`master`](https://github.com/boostorg/parameter/tree/master) | [](https://github.com/boostorg/parameter/actions?query=branch%3Amaster) | [](https://ci.appveyor.com/project/Lastique/parameter/branch/master) | [](http://www.boost.org/development/tests/master/developer/parameter.html) | [](https://pdimov.github.io/boostdep-report/master/parameter.html)
|
[`master`](https://github.com/boostorg/parameter/tree/master) | [](https://github.com/boostorg/parameter/actions?query=branch%3Amaster) | [](https://ci.appveyor.com/project/Lastique/parameter/branch/master) | [](https://regression.boost.io/master/developer/parameter.html) | [](https://pdimov.github.io/boostdep-report/master/parameter.html)
|
||||||
[`develop`](https://github.com/boostorg/parameter/tree/develop) | [](https://github.com/boostorg/parameter/actions?query=branch%3Adevelop) | [](https://ci.appveyor.com/project/Lastique/parameter/branch/develop) | [](http://www.boost.org/development/tests/develop/developer/parameter.html) | [](https://pdimov.github.io/boostdep-report/develop/parameter.html)
|
[`develop`](https://github.com/boostorg/parameter/tree/develop) | [](https://github.com/boostorg/parameter/actions?query=branch%3Adevelop) | [](https://ci.appveyor.com/project/Lastique/parameter/branch/develop) | [](https://regression.boost.io/develop/developer/parameter.html) | [](https://pdimov.github.io/boostdep-report/develop/parameter.html)
|
||||||
|
|
||||||
### License
|
### License
|
||||||
|
|
||||||
|
|||||||
42
appveyor.yml
42
appveyor.yml
@@ -1,6 +1,6 @@
|
|||||||
# Copyright 2017 Edward Diener
|
# Copyright 2017 Edward Diener
|
||||||
# Copyright 2017 Cromwell D. Enage
|
# Copyright 2017 Cromwell D. Enage
|
||||||
# Copyright 2021 Andrey Semashev
|
# Copyright 2021-2025 Andrey Semashev
|
||||||
# Distributed under the Boost Software License, Version 1.0.
|
# Distributed under the Boost Software License, Version 1.0.
|
||||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
# http://boost.org/LICENSE_1_0.txt)
|
# http://boost.org/LICENSE_1_0.txt)
|
||||||
@@ -17,36 +17,38 @@ branches:
|
|||||||
|
|
||||||
environment:
|
environment:
|
||||||
matrix:
|
matrix:
|
||||||
- ARGS: toolset=msvc-9.0,msvc-10.0,msvc-11.0,msvc-12.0 address-model=32
|
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
|
||||||
- ARGS: toolset=msvc-14.0 address-model=32,64 cxxstd=14,latest
|
- ARGS: toolset=msvc-14.0 address-model=32,64 cxxstd=14,latest
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||||
- ARGS: toolset=msvc-14.1 address-model=32,64 cxxstd=14,17,latest
|
- ARGS: toolset=msvc-14.1 address-model=32,64 cxxstd=14,17,latest
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||||
- ARGS: toolset=msvc-14.2 address-model=32,64 cxxstd=14,17,latest
|
- ARGS: toolset=msvc-14.2 address-model=32,64 cxxstd=14,17,20,latest
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
||||||
- ARGS: toolset=gcc address-model=32 cxxstd=03,11,14,1z
|
- ARGS: toolset=msvc-14.3 address-model=32,64 cxxstd=14,17,20,latest
|
||||||
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
|
||||||
|
- ARGS: toolset=clang-win address-model=64 cxxstd=14,17,latest
|
||||||
|
ENV_SCRIPT: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat
|
||||||
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
||||||
|
- ARGS: toolset=clang-win address-model=32 cxxstd=14,17,latest
|
||||||
|
ENV_SCRIPT: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat
|
||||||
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
||||||
|
- ARGS: toolset=gcc address-model=32 cxxstd=11,14,1z
|
||||||
PATH: C:\cygwin\bin;%PATH%
|
PATH: C:\cygwin\bin;%PATH%
|
||||||
# Cygwin does not have python headers installed, the compiler picks up Win32 headers in C:\Python27\Include and fails
|
|
||||||
BOOST_PARAMETER_TEST_WITHOUT_PYTHON_TESTS: 1
|
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||||
- ARGS: toolset=gcc address-model=64 cxxstd=03,11,14,1z
|
- ARGS: toolset=gcc address-model=64 cxxstd=11,14,1z
|
||||||
PATH: C:\cygwin64\bin;%PATH%
|
PATH: C:\cygwin64\bin;%PATH%
|
||||||
# Cygwin64 does not have python headers installed, the compiler picks up Win32 headers in C:\Python27\Include and fails
|
|
||||||
BOOST_PARAMETER_TEST_WITHOUT_PYTHON_TESTS: 1
|
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||||
- ARGS: toolset=gcc address-model=32 cxxstd=03,11 linkflags=-Wl,-allow-multiple-definition
|
- ARGS: toolset=gcc address-model=32 cxxstd=11,14
|
||||||
PATH: C:\MinGW\bin;%PATH%
|
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
|
||||||
- ARGS: toolset=gcc address-model=32 cxxstd=03,11,14
|
|
||||||
PATH: C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin;%PATH%
|
PATH: C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin;%PATH%
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||||
- ARGS: toolset=gcc address-model=64 cxxstd=03,11,14,1z
|
- ARGS: toolset=gcc address-model=64 cxxstd=11,14,1z
|
||||||
PATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH%
|
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
|
||||||
- ARGS: toolset=gcc address-model=64 cxxstd=03,11,14,1z
|
|
||||||
PATH: C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64\bin;%PATH%
|
PATH: C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64\bin;%PATH%
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||||
|
- ARGS: toolset=gcc address-model=64 cxxstd=11,14,17,2a
|
||||||
|
PATH: C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;%PATH%
|
||||||
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||||
|
- ARGS: toolset=gcc address-model=32 cxxstd=11,14,17,2a
|
||||||
|
PATH: C:\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin;%PATH%
|
||||||
|
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- set GIT_FETCH_JOBS=8
|
- set GIT_FETCH_JOBS=8
|
||||||
@@ -60,14 +62,14 @@ install:
|
|||||||
- git submodule init tools/boost_install
|
- git submodule init tools/boost_install
|
||||||
- git submodule init libs/headers
|
- git submodule init libs/headers
|
||||||
- git submodule init libs/config
|
- git submodule init libs/config
|
||||||
- git submodule init libs/parameter_python
|
|
||||||
- git submodule update --jobs %GIT_FETCH_JOBS%
|
- git submodule update --jobs %GIT_FETCH_JOBS%
|
||||||
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\parameter
|
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\parameter
|
||||||
- python tools/boostdep/depinst/depinst.py --git_args "--jobs %GIT_FETCH_JOBS%" parameter
|
- python tools/boostdep/depinst/depinst.py --git_args "--jobs %GIT_FETCH_JOBS%" parameter
|
||||||
- cmd /c bootstrap
|
- cmd /c bootstrap
|
||||||
- b2 headers
|
- b2 -d0 headers
|
||||||
|
|
||||||
build: off
|
build: off
|
||||||
|
|
||||||
test_script:
|
test_script:
|
||||||
|
- if not "%ENV_SCRIPT%" == "" call "%ENV_SCRIPT%"
|
||||||
- b2 -j %NUMBER_OF_PROCESSORS% libs/parameter/test %ARGS%
|
- b2 -j %NUMBER_OF_PROCESSORS% libs/parameter/test %ARGS%
|
||||||
|
|||||||
32
build.jam
Normal file
32
build.jam
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# 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)
|
||||||
|
|
||||||
|
require-b2 5.2 ;
|
||||||
|
|
||||||
|
constant boost_dependencies :
|
||||||
|
/boost/config//boost_config
|
||||||
|
/boost/core//boost_core
|
||||||
|
/boost/function//boost_function
|
||||||
|
/boost/fusion//boost_fusion
|
||||||
|
/boost/mp11//boost_mp11
|
||||||
|
/boost/mpl//boost_mpl
|
||||||
|
/boost/optional//boost_optional
|
||||||
|
/boost/preprocessor//boost_preprocessor
|
||||||
|
/boost/type_traits//boost_type_traits
|
||||||
|
/boost/utility//boost_utility ;
|
||||||
|
|
||||||
|
project /boost/parameter
|
||||||
|
: common-requirements
|
||||||
|
<include>include
|
||||||
|
;
|
||||||
|
|
||||||
|
explicit
|
||||||
|
[ alias boost_parameter : : : : <library>$(boost_dependencies) ]
|
||||||
|
[ alias all : boost_parameter test ]
|
||||||
|
;
|
||||||
|
|
||||||
|
call-if : boost-library parameter
|
||||||
|
;
|
||||||
|
|
||||||
8
config/Jamfile.v2
Normal file
8
config/Jamfile.v2
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# Copyright Andrey Semashev 2025.
|
||||||
|
#
|
||||||
|
# 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)
|
||||||
|
|
||||||
|
exe graph_supported : graph_supported.cpp : <library>/boost/graph//boost_graph ;
|
||||||
|
explicit graph_supported ;
|
||||||
18
config/graph_supported.cpp
Normal file
18
config/graph_supported.cpp
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
* Copyright Andrey Semashev 2025.
|
||||||
|
* 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)
|
||||||
|
*/
|
||||||
|
|
||||||
|
// This test checks whether the portion of Boost.Graph that is used by Boost.Parameter tests
|
||||||
|
// is compatible with the current compiler. The headers listed below are used in Boost.Parameter tests.
|
||||||
|
|
||||||
|
#include <boost/graph/graph_traits.hpp>
|
||||||
|
#include <boost/graph/properties.hpp>
|
||||||
|
#include <boost/graph/depth_first_search.hpp>
|
||||||
|
#include <boost/graph/adjacency_list.hpp>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -98,8 +98,6 @@ int x =
|
|||||||
</tr>
|
</tr>
|
||||||
<tr class="field"><th class="field-name">organization:</th><td class="field-body"><a class="reference external" href="http://www.boostpro.com">BoostPro Computing</a></td>
|
<tr class="field"><th class="field-name">organization:</th><td class="field-body"><a class="reference external" href="http://www.boostpro.com">BoostPro Computing</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="field"><th class="field-name">date:</th><td class="field-body">$Date: 2005/07/17 19:53:01 $</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="field"><th class="field-name">copyright:</th><td class="field-body">Copyright David Abrahams, Daniel Wallin
|
<tr class="field"><th class="field-name">copyright:</th><td class="field-body">Copyright David Abrahams, Daniel Wallin
|
||||||
2005-2009. Distributed under the Boost Software License,
|
2005-2009. Distributed under the Boost Software License,
|
||||||
Version 1.0. (See accompanying file LICENSE_1_0.txt
|
Version 1.0. (See accompanying file LICENSE_1_0.txt
|
||||||
|
|||||||
@@ -90,7 +90,6 @@ parameters whose identity can be deduced from their types.
|
|||||||
:Authors: David Abrahams, Daniel Wallin
|
:Authors: David Abrahams, Daniel Wallin
|
||||||
:Contact: dave@boost-consulting.com, daniel@boostpro.com
|
:Contact: dave@boost-consulting.com, daniel@boostpro.com
|
||||||
:organization: `BoostPro Computing`_
|
:organization: `BoostPro Computing`_
|
||||||
:date: $Date: 2005/07/17 19:53:01 $
|
|
||||||
|
|
||||||
:copyright: Copyright David Abrahams, Daniel Wallin
|
:copyright: Copyright David Abrahams, Daniel Wallin
|
||||||
2005-2009. Distributed under the Boost Software License,
|
2005-2009. Distributed under the Boost Software License,
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ The Boost Parameter Library Reference Documentation
|
|||||||
:Authors: David Abrahams, Daniel Wallin
|
:Authors: David Abrahams, Daniel Wallin
|
||||||
:Contact: dave@boost-consulting.com, daniel@boostpro.com
|
:Contact: dave@boost-consulting.com, daniel@boostpro.com
|
||||||
:organization: `BoostPro Computing`_
|
:organization: `BoostPro Computing`_
|
||||||
:date: $Date: 2005/07/17 19:53:01 $
|
|
||||||
|
|
||||||
:copyright: Copyright David Abrahams, Daniel Wallin
|
:copyright: Copyright David Abrahams, Daniel Wallin
|
||||||
2005-2009. Distributed under the Boost Software License,
|
2005-2009. Distributed under the Boost Software License,
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#include <boost/parameter/aux_/tagged_argument.hpp>
|
#include <boost/parameter/aux_/tagged_argument.hpp>
|
||||||
#include <boost/parameter/config.hpp>
|
#include <boost/parameter/config.hpp>
|
||||||
|
|
||||||
namespace boost { namespace parameter { namespace aux {
|
namespace boost { namespace parameter { namespace aux {
|
||||||
|
|
||||||
template <
|
template <
|
||||||
typename Keyword
|
typename Keyword
|
||||||
@@ -34,7 +34,7 @@ namespace boost { namespace parameter { namespace aux {
|
|||||||
|
|
||||||
#include <boost/mpl/bool.hpp>
|
#include <boost/mpl/bool.hpp>
|
||||||
|
|
||||||
namespace boost { namespace parameter { namespace aux {
|
namespace boost { namespace parameter { namespace aux {
|
||||||
|
|
||||||
template <typename Keyword, typename ActualArg>
|
template <typename Keyword, typename ActualArg>
|
||||||
struct tag_ref<Keyword,ActualArg,::boost::mpl::false_>
|
struct tag_ref<Keyword,ActualArg,::boost::mpl::false_>
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ namespace boost { namespace parameter { namespace aux {
|
|||||||
));
|
));
|
||||||
#endif
|
#endif
|
||||||
typedef int type;
|
typedef int type;
|
||||||
};
|
};
|
||||||
}}} // namespace boost::parameter::aux
|
}}} // namespace boost::parameter::aux
|
||||||
|
|
||||||
#endif // include guard
|
#endif // include guard
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
::boost::parameter::aux::item< \
|
::boost::parameter::aux::item< \
|
||||||
BOOST_PP_CAT(PS, n), BOOST_PP_CAT(A, n)
|
BOOST_PP_CAT(PS, n), BOOST_PP_CAT(A, n)
|
||||||
|
|
||||||
#define BOOST_PARAMETER_close_list(z, n, text) >
|
#define BOOST_PARAMETER_close_list(z, n, text) >
|
||||||
|
|
||||||
#define BOOST_PARAMETER_arg_list(n) \
|
#define BOOST_PARAMETER_arg_list(n) \
|
||||||
::boost::parameter::aux::make_arg_list< \
|
::boost::parameter::aux::make_arg_list< \
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
#include <boost/mp11/utility.hpp>
|
#include <boost/mp11/utility.hpp>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
namespace boost { namespace parameter { namespace aux {
|
namespace boost { namespace parameter { namespace aux {
|
||||||
|
|
||||||
template <typename Keyword, typename Arg>
|
template <typename Keyword, typename Arg>
|
||||||
struct tag_if_lvalue_reference
|
struct tag_if_lvalue_reference
|
||||||
@@ -75,7 +75,7 @@ namespace boost { namespace parameter { namespace aux {
|
|||||||
#include <boost/type_traits/is_lvalue_reference.hpp>
|
#include <boost/type_traits/is_lvalue_reference.hpp>
|
||||||
#include <boost/type_traits/remove_const.hpp>
|
#include <boost/type_traits/remove_const.hpp>
|
||||||
|
|
||||||
namespace boost { namespace parameter { namespace aux {
|
namespace boost { namespace parameter { namespace aux {
|
||||||
|
|
||||||
template <typename Keyword, typename ActualArg>
|
template <typename Keyword, typename ActualArg>
|
||||||
struct tag
|
struct tag
|
||||||
@@ -119,7 +119,7 @@ namespace boost { namespace parameter { namespace aux {
|
|||||||
|
|
||||||
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||||
|
|
||||||
namespace boost { namespace parameter { namespace aux {
|
namespace boost { namespace parameter { namespace aux {
|
||||||
|
|
||||||
template <
|
template <
|
||||||
typename Keyword
|
typename Keyword
|
||||||
@@ -142,7 +142,7 @@ namespace boost { namespace parameter { namespace aux {
|
|||||||
#include <boost/mpl/bool.hpp>
|
#include <boost/mpl/bool.hpp>
|
||||||
#include <boost/type_traits/remove_reference.hpp>
|
#include <boost/type_traits/remove_reference.hpp>
|
||||||
|
|
||||||
namespace boost { namespace parameter { namespace aux {
|
namespace boost { namespace parameter { namespace aux {
|
||||||
|
|
||||||
template <typename Keyword, typename Arg>
|
template <typename Keyword, typename Arg>
|
||||||
struct tag<Keyword,Arg,::boost::mpl::false_>
|
struct tag<Keyword,Arg,::boost::mpl::false_>
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ namespace boost { namespace parameter { namespace aux {
|
|||||||
typedef boost::mpl::bool_<
|
typedef boost::mpl::bool_<
|
||||||
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
|
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
|
||||||
is_cv_reference_wrapper::
|
is_cv_reference_wrapper::
|
||||||
#endif
|
#endif
|
||||||
value> type;
|
value> type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#ifndef BOOST_PARAMETER_VOID_050329_HPP
|
#ifndef BOOST_PARAMETER_VOID_050329_HPP
|
||||||
#define BOOST_PARAMETER_VOID_050329_HPP
|
#define BOOST_PARAMETER_VOID_050329_HPP
|
||||||
|
|
||||||
namespace boost { namespace parameter {
|
namespace boost { namespace parameter {
|
||||||
|
|
||||||
// A placemarker for "no argument passed."
|
// A placemarker for "no argument passed."
|
||||||
// MAINTAINER NOTE: Do not make this into a metafunction
|
// MAINTAINER NOTE: Do not make this into a metafunction
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
#include <boost/type_traits/is_same.hpp>
|
#include <boost/type_traits/is_same.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace boost { namespace parameter {
|
namespace boost { namespace parameter {
|
||||||
|
|
||||||
// A metafunction that, given an argument pack, returns the reference type
|
// A metafunction that, given an argument pack, returns the reference type
|
||||||
// of the parameter identified by the given keyword. If no such parameter
|
// of the parameter identified by the given keyword. If no such parameter
|
||||||
@@ -100,7 +100,7 @@ namespace boost { namespace parameter {
|
|||||||
|
|
||||||
#include <boost/parameter/aux_/is_placeholder.hpp>
|
#include <boost/parameter/aux_/is_placeholder.hpp>
|
||||||
|
|
||||||
namespace boost { namespace parameter {
|
namespace boost { namespace parameter {
|
||||||
|
|
||||||
template <
|
template <
|
||||||
typename Parameters
|
typename Parameters
|
||||||
@@ -132,7 +132,7 @@ namespace boost { namespace parameter {
|
|||||||
|
|
||||||
#include <boost/parameter/aux_/result_of0.hpp>
|
#include <boost/parameter/aux_/result_of0.hpp>
|
||||||
|
|
||||||
namespace boost { namespace parameter {
|
namespace boost { namespace parameter {
|
||||||
|
|
||||||
// A metafunction that, given an argument pack, returns the reference type
|
// A metafunction that, given an argument pack, returns the reference type
|
||||||
// of the parameter identified by the given keyword. If no such parameter
|
// of the parameter identified by the given keyword. If no such parameter
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
/**/
|
/**/
|
||||||
#else
|
#else
|
||||||
#define BOOST_PARAMETER_MATCH_DEFAULTS(ArgTypes)
|
#define BOOST_PARAMETER_MATCH_DEFAULTS(ArgTypes)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <boost/parameter/aux_/preprocessor/seq_enum.hpp>
|
#include <boost/parameter/aux_/preprocessor/seq_enum.hpp>
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
#include <boost/type_traits/is_array.hpp>
|
#include <boost/type_traits/is_array.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace boost { namespace parameter {
|
namespace boost { namespace parameter {
|
||||||
|
|
||||||
template <typename Tag, typename T>
|
template <typename Tag, typename T>
|
||||||
struct template_keyword : ::boost::parameter::aux::template_keyword_base
|
struct template_keyword : ::boost::parameter::aux::template_keyword_base
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
#include <boost/type_traits/is_same.hpp>
|
#include <boost/type_traits/is_same.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace boost { namespace parameter {
|
namespace boost { namespace parameter {
|
||||||
|
|
||||||
// A metafunction that, given an argument pack, returns the value type
|
// A metafunction that, given an argument pack, returns the value type
|
||||||
// of the parameter identified by the given keyword. If no such parameter
|
// of the parameter identified by the given keyword. If no such parameter
|
||||||
@@ -100,7 +100,7 @@ namespace boost { namespace parameter {
|
|||||||
|
|
||||||
#include <boost/parameter/aux_/is_placeholder.hpp>
|
#include <boost/parameter/aux_/is_placeholder.hpp>
|
||||||
|
|
||||||
namespace boost { namespace parameter {
|
namespace boost { namespace parameter {
|
||||||
|
|
||||||
template <
|
template <
|
||||||
typename Parameters
|
typename Parameters
|
||||||
@@ -132,7 +132,7 @@ namespace boost { namespace parameter {
|
|||||||
|
|
||||||
#include <boost/parameter/aux_/result_of0.hpp>
|
#include <boost/parameter/aux_/result_of0.hpp>
|
||||||
|
|
||||||
namespace boost { namespace parameter {
|
namespace boost { namespace parameter {
|
||||||
|
|
||||||
// A metafunction that, given an argument pack, returns the value type
|
// A metafunction that, given an argument pack, returns the value type
|
||||||
// of the parameter identified by the given keyword. If no such parameter
|
// of the parameter identified by the given keyword. If no such parameter
|
||||||
|
|||||||
@@ -5,6 +5,8 @@
|
|||||||
# NOTE: CMake support for Boost.Parameter is currently experimental at best
|
# NOTE: CMake support for Boost.Parameter is currently experimental at best
|
||||||
# and the interface is likely to change in the future
|
# and the interface is likely to change in the future
|
||||||
|
|
||||||
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
# TODO: Also process literate tests
|
# TODO: Also process literate tests
|
||||||
file(GLOB test_files *.cpp)
|
file(GLOB test_files *.cpp)
|
||||||
|
|
||||||
@@ -12,7 +14,7 @@ file(GLOB test_files *.cpp)
|
|||||||
# special requirements
|
# special requirements
|
||||||
# TODO: enable more tests
|
# TODO: enable more tests
|
||||||
list(FILTER test_files EXCLUDE REGEX
|
list(FILTER test_files EXCLUDE REGEX
|
||||||
efficiency|deduced_unmatched_arg|python_test|duplicates)
|
efficiency|deduced_unmatched_arg|duplicates)
|
||||||
|
|
||||||
# Attach all our tests to the `tests` target, to enable
|
# Attach all our tests to the `tests` target, to enable
|
||||||
# `cmake --build . --target tests`
|
# `cmake --build . --target tests`
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
# Copyright David Abrahams, Daniel Wallin 2006.
|
# Copyright David Abrahams, Daniel Wallin 2006.
|
||||||
# Copyright Cromwell D. Enage 2017.
|
# Copyright Cromwell D. Enage 2017.
|
||||||
|
# Copyright Andrey Semashev 2025.
|
||||||
|
#
|
||||||
# Distributed under the Boost Software License, Version 1.0.
|
# Distributed under the Boost Software License, Version 1.0.
|
||||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
# http://www.boost.org/LICENSE_1_0.txt)
|
# http://www.boost.org/LICENSE_1_0.txt)
|
||||||
@@ -9,14 +11,14 @@
|
|||||||
import os ;
|
import os ;
|
||||||
import testing ;
|
import testing ;
|
||||||
|
|
||||||
project boost/parameter
|
project
|
||||||
:
|
:
|
||||||
default-build
|
requirements
|
||||||
|
<library>/boost/parameter//boost_parameter
|
||||||
<warnings>off
|
<warnings>off
|
||||||
|
<include>.
|
||||||
;
|
;
|
||||||
|
|
||||||
import python ;
|
|
||||||
|
|
||||||
alias parameter_standard_tests
|
alias parameter_standard_tests
|
||||||
:
|
:
|
||||||
[ run maybe.cpp : : : : : <preserve-target-tests>off ]
|
[ run maybe.cpp : : : : : <preserve-target-tests>off ]
|
||||||
@@ -425,6 +427,8 @@ alias parameter_literate_tests
|
|||||||
:
|
:
|
||||||
:
|
:
|
||||||
:
|
:
|
||||||
|
[ check-target-builds ../config//graph_supported "Boost.Graph compiles" : <library>/boost/graph//boost_graph : <build>no ]
|
||||||
|
|
||||||
<define>BOOST_PARAMETER_MAX_ARITY=5
|
<define>BOOST_PARAMETER_MAX_ARITY=5
|
||||||
<define>BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY=6
|
<define>BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY=6
|
||||||
:
|
:
|
||||||
@@ -493,76 +497,6 @@ alias parameter_literate_tests
|
|||||||
]
|
]
|
||||||
;
|
;
|
||||||
|
|
||||||
if ! [ os.environ BOOST_PARAMETER_TEST_WITHOUT_PYTHON_TESTS ]
|
|
||||||
{
|
|
||||||
alias parameter_python_test
|
|
||||||
:
|
|
||||||
:
|
|
||||||
# Python fails for clang on linux with cxxstd set to 14
|
|
||||||
<target-os>linux
|
|
||||||
<toolset>clang
|
|
||||||
<cxxstd>14
|
|
||||||
;
|
|
||||||
|
|
||||||
alias parameter_python_test
|
|
||||||
:
|
|
||||||
:
|
|
||||||
# Python fails for clang on linux with cxxstd set to 1z
|
|
||||||
<target-os>linux
|
|
||||||
<toolset>clang
|
|
||||||
<cxxstd>1z
|
|
||||||
;
|
|
||||||
|
|
||||||
alias parameter_python_test
|
|
||||||
:
|
|
||||||
:
|
|
||||||
# Python fails for xcode 8.3.0 on osx
|
|
||||||
# so we turn off this test for this compiler completely for now
|
|
||||||
<target-os>darwin
|
|
||||||
# TODO: Differentiate by xcode version or by clang version
|
|
||||||
;
|
|
||||||
|
|
||||||
alias parameter_python_test
|
|
||||||
:
|
|
||||||
:
|
|
||||||
# Python fails for mingw compilers with cxxstd set to 11 or higher
|
|
||||||
# because of a Python header problem
|
|
||||||
# so we turn off this test for this compiler completely
|
|
||||||
<target-os>windows
|
|
||||||
<toolset>gcc
|
|
||||||
<address-model>32
|
|
||||||
;
|
|
||||||
|
|
||||||
alias parameter_python_test
|
|
||||||
:
|
|
||||||
:
|
|
||||||
# Python fails for clang-linux compilers with cxxstd set to 11 or higher
|
|
||||||
# because of a Python header problem
|
|
||||||
# so we turn off this test for this compiler completely
|
|
||||||
<target-os>windows
|
|
||||||
<toolset>clang-linux
|
|
||||||
<address-model>32
|
|
||||||
;
|
|
||||||
|
|
||||||
alias parameter_python_test
|
|
||||||
:
|
|
||||||
:
|
|
||||||
# Python fails for windows compilers with 64-bit addressing set
|
|
||||||
# because of a Python header problem
|
|
||||||
<target-os>windows
|
|
||||||
<address-model>64
|
|
||||||
;
|
|
||||||
|
|
||||||
alias parameter_python_test
|
|
||||||
:
|
|
||||||
[ bpl-test python_test ]
|
|
||||||
;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
alias parameter_python_test ;
|
|
||||||
}
|
|
||||||
|
|
||||||
alias parameter_macros_eval_category
|
alias parameter_macros_eval_category
|
||||||
:
|
:
|
||||||
:
|
:
|
||||||
@@ -950,6 +884,5 @@ test-suite "parameter"
|
|||||||
parameter_preprocessor_eval_cat_fail
|
parameter_preprocessor_eval_cat_fail
|
||||||
parameter_standard_tests
|
parameter_standard_tests
|
||||||
parameter_literate_tests
|
parameter_literate_tests
|
||||||
parameter_python_test
|
|
||||||
parameter_vendor_specific_fail_tests
|
parameter_vendor_specific_fail_tests
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -91,14 +91,14 @@ namespace test {
|
|||||||
BOOST_PARAMETER_FUN(int, f, 1, 4, f_parameters)
|
BOOST_PARAMETER_FUN(int, f, 1, 4, f_parameters)
|
||||||
#else
|
#else
|
||||||
BOOST_PARAMETER_FUN(void, f, 1, 4, f_parameters)
|
BOOST_PARAMETER_FUN(void, f, 1, 4, f_parameters)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
BOOST_TEST_EQ(p[test::_w][0], p[test::_x | -1]);
|
BOOST_TEST_EQ(p[test::_w][0], p[test::_x | -1]);
|
||||||
BOOST_TEST_EQ(p[test::_w][1], p[test::_y | -2]);
|
BOOST_TEST_EQ(p[test::_w][1], p[test::_y | -2]);
|
||||||
BOOST_TEST_EQ(p[test::_w][2], p[test::_z | -3]);
|
BOOST_TEST_EQ(p[test::_w][2], p[test::_z | -3]);
|
||||||
#if defined(BOOST_NO_VOID_RETURNS)
|
#if defined(BOOST_NO_VOID_RETURNS)
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
} // namespace test
|
} // namespace test
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
|
|
||||||
#include <boost/parameter/name.hpp>
|
#include <boost/parameter/name.hpp>
|
||||||
#include <boost/config/workaround.hpp>
|
#include <boost/config/workaround.hpp>
|
||||||
#include <boost/timer.hpp>
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include "timer.hpp"
|
||||||
|
|
||||||
namespace test {
|
namespace test {
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ namespace test {
|
|||||||
// or other processes and even device hardware interrupts may
|
// or other processes and even device hardware interrupts may
|
||||||
// interfere by causing caches to be flushed.
|
// interfere by causing caches to be flushed.
|
||||||
|
|
||||||
// Accumulator function object with plain C++ interface
|
// Accumulator function object with plain C++ interface
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct plain_weight_running_total
|
struct plain_weight_running_total
|
||||||
{
|
{
|
||||||
@@ -147,7 +147,7 @@ namespace test {
|
|||||||
test::hammer<Accumulator>(x, repeats);
|
test::hammer<Accumulator>(x, repeats);
|
||||||
|
|
||||||
// Now start a timer.
|
// Now start a timer.
|
||||||
boost::timer time;
|
test::timer time;
|
||||||
test::hammer<Accumulator>(x, repeats); // This time, we'll measure.
|
test::hammer<Accumulator>(x, repeats); // This time, we'll measure.
|
||||||
return time.elapsed();
|
return time.elapsed();
|
||||||
}
|
}
|
||||||
@@ -163,7 +163,7 @@ int main()
|
|||||||
{
|
{
|
||||||
repeats *= 10;
|
repeats *= 10;
|
||||||
|
|
||||||
boost::timer time;
|
test::timer time;
|
||||||
|
|
||||||
test::hammer<test::plain_weight_running_total<double> >(.1, repeats);
|
test::hammer<test::plain_weight_running_total<double> >(.1, repeats);
|
||||||
test::hammer<test::named_param_weight_running_total<double> >(
|
test::hammer<test::named_param_weight_running_total<double> >(
|
||||||
@@ -172,7 +172,7 @@ int main()
|
|||||||
|
|
||||||
measured = time.elapsed();
|
measured = time.elapsed();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout
|
std::cout
|
||||||
<< "plain time: "
|
<< "plain time: "
|
||||||
<< test::measure<test::plain_weight_running_total<double> >(
|
<< test::measure<test::plain_weight_running_total<double> >(
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ BOOST_PARAMETER_NAME(root_vertex)
|
|||||||
BOOST_PARAMETER_NAME(index_map)
|
BOOST_PARAMETER_NAME(index_map)
|
||||||
BOOST_PARAMETER_NAME(color_map)
|
BOOST_PARAMETER_NAME(color_map)
|
||||||
|
|
||||||
#include <boost/graph/depth_first_search.hpp> // for dfs_visitor
|
|
||||||
|
|
||||||
BOOST_PARAMETER_FUNCTION((bool), depth_first_search, tag,
|
BOOST_PARAMETER_FUNCTION((bool), depth_first_search, tag,
|
||||||
(required
|
(required
|
||||||
(graph, *)
|
(graph, *)
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ namespace test {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct X
|
struct X
|
||||||
{
|
{
|
||||||
X(int x_ = -1) : x(x_)
|
X(int x_ = -1) : x(x_)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,172 +0,0 @@
|
|||||||
// Copyright Daniel Wallin 2006. 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)
|
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
#include <boost/python.hpp>
|
|
||||||
#include <boost/parameter/preprocessor.hpp>
|
|
||||||
#include <boost/parameter/keyword.hpp>
|
|
||||||
#include <boost/parameter/python.hpp>
|
|
||||||
#include <boost/utility/enable_if.hpp>
|
|
||||||
|
|
||||||
namespace test {
|
|
||||||
|
|
||||||
BOOST_PARAMETER_KEYWORD(tags, x)
|
|
||||||
BOOST_PARAMETER_KEYWORD(tags, y)
|
|
||||||
BOOST_PARAMETER_KEYWORD(tags, z)
|
|
||||||
|
|
||||||
struct Xbase
|
|
||||||
{
|
|
||||||
// We need the disable_if part for VC7.1/8.0.
|
|
||||||
template <class Args>
|
|
||||||
Xbase(
|
|
||||||
Args const& args
|
|
||||||
, typename boost::disable_if<
|
|
||||||
boost::is_base_and_derived<Xbase, Args>
|
|
||||||
>::type* = 0
|
|
||||||
)
|
|
||||||
: value(std::string(args[x | "foo"]) + args[y | "bar"])
|
|
||||||
{}
|
|
||||||
|
|
||||||
std::string value;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct X : Xbase
|
|
||||||
{
|
|
||||||
BOOST_PARAMETER_CONSTRUCTOR(X, (Xbase), tags,
|
|
||||||
(optional
|
|
||||||
(x, *)
|
|
||||||
(y, *)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
BOOST_PARAMETER_BASIC_MEMBER_FUNCTION((int), f, tags,
|
|
||||||
(required
|
|
||||||
(x, *)
|
|
||||||
(y, *)
|
|
||||||
)
|
|
||||||
(optional
|
|
||||||
(z, *)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return args[x] + args[y] + args[z | 0];
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOST_PARAMETER_BASIC_MEMBER_FUNCTION((std::string), g, tags,
|
|
||||||
(optional
|
|
||||||
(x, *)
|
|
||||||
(y, *)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return std::string(args[x | "foo"]) + args[y | "bar"];
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOST_PARAMETER_MEMBER_FUNCTION((X&), h, tags,
|
|
||||||
(optional (x, *, "") (y, *, ""))
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class A0>
|
|
||||||
X& operator()(A0 const& a0)
|
|
||||||
{
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace test
|
|
||||||
|
|
||||||
struct f_fwd
|
|
||||||
{
|
|
||||||
template <class R, class T, class A0, class A1, class A2>
|
|
||||||
R operator()(boost::type<R>, T& self, A0 const& a0, A1 const& a1, A2 const& a2)
|
|
||||||
{
|
|
||||||
return self.f(a0,a1,a2);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct g_fwd
|
|
||||||
{
|
|
||||||
template <class R, class T, class A0, class A1>
|
|
||||||
R operator()(boost::type<R>, T& self, A0 const& a0, A1 const& a1)
|
|
||||||
{
|
|
||||||
return self.g(a0,a1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct h_fwd
|
|
||||||
{
|
|
||||||
template <class R, class T>
|
|
||||||
R operator()(boost::type<R>, T& self)
|
|
||||||
{
|
|
||||||
return self.h();
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class R, class T, class A0>
|
|
||||||
R operator()(boost::type<R>, T& self, A0 const& a0)
|
|
||||||
{
|
|
||||||
return self.h(a0);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class R, class T, class A0, class A1>
|
|
||||||
R operator()(boost::type<R>, T& self, A0 const& a0, A1 const& a1)
|
|
||||||
{
|
|
||||||
return self.h(a0,a1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
BOOST_PYTHON_MODULE(python_test_ext)
|
|
||||||
{
|
|
||||||
namespace mpl = boost::mpl;
|
|
||||||
using namespace test;
|
|
||||||
using namespace boost::python;
|
|
||||||
|
|
||||||
class_<X>("X")
|
|
||||||
.def(
|
|
||||||
boost::parameter::python::init<
|
|
||||||
mpl::vector<
|
|
||||||
tags::x*(std::string), tags::y*(std::string)
|
|
||||||
>
|
|
||||||
>()
|
|
||||||
)
|
|
||||||
.def(
|
|
||||||
"f"
|
|
||||||
, boost::parameter::python::function<
|
|
||||||
f_fwd
|
|
||||||
, mpl::vector<
|
|
||||||
int, tags::x(int), tags::y(int), tags::z*(int)
|
|
||||||
>
|
|
||||||
>()
|
|
||||||
)
|
|
||||||
.def(
|
|
||||||
"g"
|
|
||||||
, boost::parameter::python::function<
|
|
||||||
g_fwd
|
|
||||||
, mpl::vector<
|
|
||||||
std::string, tags::x*(std::string), tags::y*(std::string)
|
|
||||||
>
|
|
||||||
>()
|
|
||||||
)
|
|
||||||
.def(
|
|
||||||
"h"
|
|
||||||
, boost::parameter::python::function<
|
|
||||||
h_fwd
|
|
||||||
, mpl::vector<
|
|
||||||
X&, tags::x**(std::string), tags::y**(std::string)
|
|
||||||
>
|
|
||||||
>()
|
|
||||||
, return_arg<>()
|
|
||||||
)
|
|
||||||
.def(
|
|
||||||
boost::parameter::python::call<
|
|
||||||
mpl::vector<
|
|
||||||
X&, tags::x(int)
|
|
||||||
>
|
|
||||||
>() [ return_arg<>() ]
|
|
||||||
)
|
|
||||||
.def_readonly("value", &X::value);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
# Copyright Daniel Wallin 2006. 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 python_test_ext import X
|
|
||||||
>>> x = X(y = 'baz')
|
|
||||||
>>> x.value
|
|
||||||
'foobaz'
|
|
||||||
>>> x.f(1,2)
|
|
||||||
3
|
|
||||||
>>> x.f(1,2,3)
|
|
||||||
6
|
|
||||||
>>> x.f(1,2, z = 3)
|
|
||||||
6
|
|
||||||
>>> x.f(z = 3, y = 2, x = 1)
|
|
||||||
6
|
|
||||||
>>> x.g()
|
|
||||||
'foobar'
|
|
||||||
>>> x.g(y = "baz")
|
|
||||||
'foobaz'
|
|
||||||
>>> x.g(x = "baz")
|
|
||||||
'bazbar'
|
|
||||||
>>> x.g(y = "foo", x = "bar")
|
|
||||||
'barfoo'
|
|
||||||
>>> y = x.h(x = "bar", y = "foo")
|
|
||||||
>>> assert x == y
|
|
||||||
>>> y = x(0)
|
|
||||||
>>> assert x == y
|
|
||||||
'''
|
|
||||||
|
|
||||||
def run(args = None):
|
|
||||||
if args is not None:
|
|
||||||
import sys
|
|
||||||
sys.argv = args
|
|
||||||
import doctest, python_test
|
|
||||||
return doctest.testmod(python_test)
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
import sys
|
|
||||||
sys.exit(run()[0])
|
|
||||||
59
test/timer.hpp
Normal file
59
test/timer.hpp
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
// Copyright Andrey Semashev 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)
|
||||||
|
|
||||||
|
// This file is a copy of boost/timer.hpp from Boost.Timer v1, which
|
||||||
|
// was deprecated and slated for removal. We are not using Boost.Timer v2
|
||||||
|
// components to avoid having to link with its binary.
|
||||||
|
//
|
||||||
|
// See http://www.boost.org/libs/timer for documentation.
|
||||||
|
|
||||||
|
#ifndef BOOST_PARAMETER_TEST_TIMER_HPP
|
||||||
|
#define BOOST_PARAMETER_TEST_TIMER_HPP
|
||||||
|
|
||||||
|
#include <ctime>
|
||||||
|
#include <limits>
|
||||||
|
|
||||||
|
namespace test {
|
||||||
|
|
||||||
|
// timer -------------------------------------------------------------------//
|
||||||
|
|
||||||
|
// A timer object measures elapsed time.
|
||||||
|
|
||||||
|
// It is recommended that implementations measure wall clock rather than CPU
|
||||||
|
// time since the intended use is performance measurement on systems where
|
||||||
|
// total elapsed time is more important than just process or CPU time.
|
||||||
|
|
||||||
|
// Warnings: The maximum measurable elapsed time may well be only 596.5+ hours
|
||||||
|
// due to implementation limitations. The accuracy of timings depends on the
|
||||||
|
// accuracy of timing information provided by the underlying platform, and
|
||||||
|
// this varies a great deal from platform to platform.
|
||||||
|
|
||||||
|
class timer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
timer() { _start_time = std::clock(); } // postcondition: elapsed()==0
|
||||||
|
void restart() { _start_time = std::clock(); } // post: elapsed()==0
|
||||||
|
double elapsed() const // return elapsed time in seconds
|
||||||
|
{ return double(std::clock() - _start_time) / CLOCKS_PER_SEC; }
|
||||||
|
|
||||||
|
double elapsed_max() const // return estimated maximum value for elapsed()
|
||||||
|
// Portability warning: elapsed_max() may return too high a value on systems
|
||||||
|
// where std::clock_t overflows or resets at surprising values.
|
||||||
|
{
|
||||||
|
return (double((std::numeric_limits<std::clock_t>::max)())
|
||||||
|
- double(_start_time)) / double(CLOCKS_PER_SEC);
|
||||||
|
}
|
||||||
|
|
||||||
|
double elapsed_min() const // return minimum value for elapsed()
|
||||||
|
{ return double(1)/double(CLOCKS_PER_SEC); }
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::clock_t _start_time;
|
||||||
|
}; // timer
|
||||||
|
|
||||||
|
} // namespace test
|
||||||
|
|
||||||
|
#endif // BOOST_PARAMETER_TEST_TIMER_HPP
|
||||||
Reference in New Issue
Block a user