mirror of
https://github.com/boostorg/describe.git
synced 2026-01-19 16:12:19 +00:00
Compare commits
60 Commits
boost-1.81
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4959611e09 | ||
|
|
a722380b2a | ||
|
|
dfd9182bf3 | ||
|
|
f1774f3d02 | ||
|
|
7c0d234267 | ||
|
|
6e4b7f5a07 | ||
|
|
0a40d3b824 | ||
|
|
644a984a61 | ||
|
|
43ee545507 | ||
|
|
54b73c7ca7 | ||
|
|
ee215421cb | ||
|
|
2864875eef | ||
|
|
1a63fc6ffb | ||
|
|
373db78411 | ||
|
|
5858ccb775 | ||
|
|
ba01c60d56 | ||
|
|
ecd2b0456b | ||
|
|
362a266b7d | ||
|
|
b64177c39f | ||
|
|
ddff876eea | ||
|
|
112c33a793 | ||
|
|
22f497d1ad | ||
|
|
3da6a1e295 | ||
|
|
ff76bbb90b | ||
|
|
18e7c01359 | ||
|
|
777bdec2e9 | ||
|
|
f39d32150d | ||
|
|
f8f7af29d5 | ||
|
|
89b5caef8d | ||
|
|
2fb95498ea | ||
|
|
8a0ade0ad0 | ||
|
|
1508f66184 | ||
|
|
ac298922b0 | ||
|
|
86099f1d78 | ||
|
|
d25e48348e | ||
|
|
76c036a2d7 | ||
|
|
879d4b2a22 | ||
|
|
202203112b | ||
|
|
882b168de8 | ||
|
|
1ddee6c39a | ||
|
|
9899acb4c9 | ||
|
|
84ce044885 | ||
|
|
120b9edaed | ||
|
|
50719b2123 | ||
|
|
8f3b04a3d9 | ||
|
|
2e63564776 | ||
|
|
9da33c4629 | ||
|
|
fad199e782 | ||
|
|
e005f6950c | ||
|
|
2e5dcc80b2 | ||
|
|
ba1459ac84 | ||
|
|
c89e4dd3db | ||
|
|
3047e5a72f | ||
|
|
cfddb57d3a | ||
|
|
6e7d49c6e1 | ||
|
|
cc2281054e | ||
|
|
215042b480 | ||
|
|
a0eafb0810 | ||
|
|
1692c3e5d6 | ||
|
|
b54fda5469 |
130
.drone.jsonnet
130
.drone.jsonnet
@@ -32,7 +32,8 @@ local linux_pipeline(name, image, environment, packages = "", sources = [], arch
|
||||
commands:
|
||||
[
|
||||
'set -e',
|
||||
'wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -',
|
||||
'uname -a',
|
||||
'echo $DRONE_STAGE_MACHINE',
|
||||
] +
|
||||
(if sources != [] then [ ('apt-add-repository "' + source + '"') for source in sources ] else []) +
|
||||
(if packages != "" then [ 'apt-get update', 'apt-get -y install ' + packages ] else []) +
|
||||
@@ -186,6 +187,34 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
|
||||
"g++-12",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 24.04 GCC 13",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '03,11,14,17,20,2b' },
|
||||
"g++-13",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 24.04 GCC 14 UBSAN",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '03,11,14,17,20,2b' } + ubsan,
|
||||
"g++-14",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 24.04 GCC 14 ASAN",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '03,11,14,17,20,2b' } + asan,
|
||||
"g++-14",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 25.04 GCC 15",
|
||||
"cppalliance/droneubuntu2504:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-15', CXXSTD: '03,11,14,17,20,23,2c' },
|
||||
"g++-15",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 16.04 Clang 3.5",
|
||||
"cppalliance/droneubuntu1604:1",
|
||||
@@ -231,7 +260,7 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
|
||||
linux_pipeline(
|
||||
"Linux 18.04 Clang 5.0",
|
||||
"cppalliance/droneubuntu1804:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-5.0', CXXSTD: '03,11,14,1z' },
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-5.0', CXXSTD: '03,11,14' },
|
||||
"clang-5.0",
|
||||
),
|
||||
|
||||
@@ -303,18 +332,107 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
|
||||
"cppalliance/droneubuntu2204:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-15', CXXSTD: '03,11,14,17,20,2b' },
|
||||
"clang-15",
|
||||
["deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main"],
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 24.04 Clang 16",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-16', CXXSTD: '03,11,14,17,20,2b' },
|
||||
"clang-16",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 24.04 Clang 17",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '03,11,14,17,20,2b' },
|
||||
"clang-17",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 24.04 Clang 18 UBSAN",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '03,11,14,17,20,2b' } + ubsan,
|
||||
"clang-18",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 24.04 Clang 18 ASAN",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '03,11,14,17,20,2b' } + asan,
|
||||
"clang-18",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 24.04 Clang 19",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-19', CXXSTD: '03,11,14,17,20,2b' },
|
||||
"clang-19",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 24.04 Clang 20",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-20', CXXSTD: '03,11,14,17,20,23,2c' },
|
||||
"clang-20",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 25.10 Clang 21",
|
||||
"cppalliance/droneubuntu2510:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-21', CXXSTD: '03,11,14,17,20,23,2c' },
|
||||
"clang-21",
|
||||
),
|
||||
|
||||
macos_pipeline(
|
||||
"MacOS 10.15 Xcode 12.2",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,1z' },
|
||||
"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,
|
||||
),
|
||||
|
||||
macos_pipeline(
|
||||
"MacOS 12.4 Xcode 13.2.1 UBSAN",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,17,20,2b' } + ubsan,
|
||||
xcode_version = "13.2.1", osx_version = "monterey", arch = "arm64",
|
||||
),
|
||||
|
||||
macos_pipeline(
|
||||
"MacOS 12.4 Xcode 13.2.1 ASAN",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,17,20,2b' } + asan,
|
||||
xcode_version = "13.2.1", osx_version = "monterey", arch = "arm64",
|
||||
),
|
||||
|
||||
macos_pipeline(
|
||||
"MacOS 12.4 Xcode 13.4.1 UBSAN",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,17,20,2b' } + ubsan,
|
||||
xcode_version = "13.4.1", osx_version = "monterey", arch = "arm64",
|
||||
),
|
||||
|
||||
macos_pipeline(
|
||||
"MacOS 12.4 Xcode 13.4.1 ASAN",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,17,20,2b' } + asan,
|
||||
xcode_version = "13.4.1", osx_version = "monterey", arch = "arm64",
|
||||
),
|
||||
|
||||
macos_pipeline(
|
||||
"MacOS 14 Xcode 16.2.0 UBSAN",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,17,20,2b' } + ubsan,
|
||||
xcode_version = "16.2.0", osx_version = "sonoma", arch = "arm64",
|
||||
),
|
||||
|
||||
macos_pipeline(
|
||||
"MacOS 14 Xcode 16.2.0 ASAN",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,17,20,2b' } + asan,
|
||||
xcode_version = "16.2.0", osx_version = "sonoma", arch = "arm64",
|
||||
),
|
||||
|
||||
windows_pipeline(
|
||||
"Windows VS2015 msvc-14.0",
|
||||
"cppalliance/dronevs2015",
|
||||
{ TOOLSET: 'msvc-14.0', CXXSTD: '14,latest' },
|
||||
{ TOOLSET: 'msvc-14.0', CXXSTD: '14,latest', B2_DONT_EMBED_MANIFEST: '1' },
|
||||
),
|
||||
|
||||
windows_pipeline(
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
# https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
set -ex
|
||||
export PATH=~/.local/bin:/usr/local/bin:$PATH
|
||||
|
||||
DRONE_BUILD_DIR=$(pwd)
|
||||
|
||||
|
||||
387
.github/workflows/ci.yml
vendored
387
.github/workflows/ci.yml
vendored
@@ -19,110 +19,216 @@ jobs:
|
||||
include:
|
||||
- toolset: gcc-4.8
|
||||
cxxstd: "03,11"
|
||||
os: ubuntu-18.04
|
||||
container: ubuntu:18.04
|
||||
os: ubuntu-latest
|
||||
install: g++-4.8
|
||||
- toolset: gcc-5
|
||||
cxxstd: "03,11,14,14-gnu,1z,1z-gnu"
|
||||
os: ubuntu-18.04
|
||||
container: ubuntu:18.04
|
||||
os: ubuntu-latest
|
||||
install: g++-5
|
||||
- toolset: gcc-6
|
||||
cxxstd: "03,11,14,14-gnu,1z,1z-gnu"
|
||||
os: ubuntu-18.04
|
||||
container: ubuntu:18.04
|
||||
os: ubuntu-latest
|
||||
install: g++-6
|
||||
- toolset: gcc-7
|
||||
cxxstd: "03,11,14,14-gnu,17,17-gnu"
|
||||
os: ubuntu-18.04
|
||||
container: ubuntu:20.04
|
||||
os: ubuntu-latest
|
||||
install: g++-7
|
||||
- toolset: gcc-8
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
os: ubuntu-18.04
|
||||
container: ubuntu:20.04
|
||||
os: ubuntu-latest
|
||||
install: g++-8
|
||||
- toolset: gcc-9
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
os: ubuntu-20.04
|
||||
container: ubuntu:20.04
|
||||
os: ubuntu-latest
|
||||
- toolset: gcc-10
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
os: ubuntu-20.04
|
||||
os: ubuntu-22.04
|
||||
install: g++-10
|
||||
- toolset: gcc-11
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
os: ubuntu-20.04
|
||||
install: g++-11
|
||||
os: ubuntu-22.04
|
||||
- toolset: gcc-12
|
||||
cxxstd: "03,11,14,17,20"
|
||||
cxxstd: "03,11,14,17,20,2b"
|
||||
os: ubuntu-22.04
|
||||
install: g++-12
|
||||
- toolset: gcc-13
|
||||
cxxstd: "03,11,14,17,20,2b"
|
||||
container: ubuntu:24.04
|
||||
os: ubuntu-latest
|
||||
install: g++-13
|
||||
- toolset: gcc-14
|
||||
cxxstd: "03,11,14,17,20,2b"
|
||||
container: ubuntu:24.04
|
||||
os: ubuntu-latest
|
||||
install: g++-14
|
||||
- toolset: gcc-15
|
||||
cxxstd: "03,11,14,17,20,23,2c"
|
||||
container: ubuntu:25.10
|
||||
os: ubuntu-latest
|
||||
install: g++-15
|
||||
- toolset: clang
|
||||
compiler: clang++-3.9
|
||||
cxxstd: "03,11,14"
|
||||
os: ubuntu-18.04
|
||||
container: ubuntu:18.04
|
||||
os: ubuntu-latest
|
||||
install: clang-3.9
|
||||
- toolset: clang
|
||||
compiler: clang++-4.0
|
||||
cxxstd: "03,11,14"
|
||||
os: ubuntu-18.04
|
||||
container: ubuntu:18.04
|
||||
os: ubuntu-latest
|
||||
install: clang-4.0
|
||||
- toolset: clang
|
||||
compiler: clang++-5.0
|
||||
cxxstd: "03,11,14,1z"
|
||||
os: ubuntu-18.04
|
||||
cxxstd: "03,11,14"
|
||||
container: ubuntu:18.04
|
||||
os: ubuntu-latest
|
||||
install: clang-5.0
|
||||
- toolset: clang
|
||||
compiler: clang++-6.0
|
||||
cxxstd: "03,11,14,17"
|
||||
os: ubuntu-18.04
|
||||
container: ubuntu:20.04
|
||||
os: ubuntu-latest
|
||||
install: clang-6.0
|
||||
- toolset: clang
|
||||
compiler: clang++-7
|
||||
cxxstd: "03,11,14,17"
|
||||
os: ubuntu-18.04
|
||||
container: ubuntu:20.04
|
||||
os: ubuntu-latest
|
||||
install: clang-7
|
||||
- toolset: clang
|
||||
compiler: clang++-8
|
||||
cxxstd: "03,11,14,17"
|
||||
os: ubuntu-20.04
|
||||
container: ubuntu:20.04
|
||||
os: ubuntu-latest
|
||||
install: clang-8
|
||||
- toolset: clang
|
||||
compiler: clang++-9
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
os: ubuntu-20.04
|
||||
container: ubuntu:20.04
|
||||
os: ubuntu-latest
|
||||
install: clang-9
|
||||
- toolset: clang
|
||||
compiler: clang++-10
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
os: ubuntu-20.04
|
||||
container: ubuntu:20.04
|
||||
os: ubuntu-latest
|
||||
install: clang-10
|
||||
- toolset: clang
|
||||
compiler: clang++-11
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
os: ubuntu-20.04
|
||||
container: ubuntu:20.04
|
||||
os: ubuntu-latest
|
||||
install: clang-11
|
||||
- toolset: clang
|
||||
compiler: clang++-12
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
os: ubuntu-20.04
|
||||
container: ubuntu:20.04
|
||||
os: ubuntu-latest
|
||||
install: clang-12
|
||||
- toolset: clang
|
||||
compiler: clang++-13
|
||||
cxxstd: "03,11,14,17,20"
|
||||
os: ubuntu-22.04
|
||||
cxxstd: "03,11,14,17,20,2b"
|
||||
container: ubuntu:22.04
|
||||
os: ubuntu-latest
|
||||
install: clang-13
|
||||
- toolset: clang
|
||||
compiler: clang++-14
|
||||
cxxstd: "03,11,14,17,20"
|
||||
os: ubuntu-22.04
|
||||
cxxstd: "03,11,14,17,20,2b"
|
||||
container: ubuntu:22.04
|
||||
os: ubuntu-latest
|
||||
install: clang-14
|
||||
- toolset: clang
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
os: macos-11
|
||||
compiler: clang++-15
|
||||
cxxstd: "03,11,14,17,20,2b"
|
||||
container: ubuntu:22.04
|
||||
os: ubuntu-latest
|
||||
install: clang-15
|
||||
- toolset: clang
|
||||
compiler: clang++-16
|
||||
cxxstd: "03,11,14,17,20,2b"
|
||||
container: ubuntu:24.04
|
||||
os: ubuntu-latest
|
||||
install: clang-16
|
||||
- toolset: clang
|
||||
compiler: clang++-17
|
||||
cxxstd: "03,11,14,17,20,2b"
|
||||
container: ubuntu:24.04
|
||||
os: ubuntu-latest
|
||||
install: clang-17
|
||||
- toolset: clang
|
||||
compiler: clang++-18
|
||||
cxxstd: "03,11,14,17,20,2b"
|
||||
container: ubuntu:24.04
|
||||
os: ubuntu-latest
|
||||
install: clang-18
|
||||
- toolset: clang
|
||||
compiler: clang++-19
|
||||
cxxstd: "03,11,14,17,20,2b"
|
||||
container: ubuntu:24.04
|
||||
os: ubuntu-latest
|
||||
install: clang-19
|
||||
- toolset: clang
|
||||
compiler: clang++-20
|
||||
cxxstd: "03,11,14,17,20,23,2c"
|
||||
container: ubuntu:24.04
|
||||
os: ubuntu-latest
|
||||
install: clang-20
|
||||
- toolset: clang
|
||||
compiler: clang++-21
|
||||
cxxstd: "03,11,14,17,20,23,2c"
|
||||
container: ubuntu:25.10
|
||||
os: ubuntu-latest
|
||||
install: clang-21
|
||||
- toolset: clang
|
||||
cxxstd: "03,11,14,17,20,2b"
|
||||
os: macos-14
|
||||
- toolset: clang
|
||||
cxxstd: "03,11,14,17,20,2b"
|
||||
os: macos-15
|
||||
- toolset: clang
|
||||
cxxstd: "03,11,14,17,20,23,2c"
|
||||
os: macos-26
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
|
||||
container:
|
||||
image: ${{matrix.container}}
|
||||
volumes:
|
||||
- /node20217:/node20217:rw,rshared
|
||||
- ${{ startsWith(matrix.container, 'ubuntu:1') && '/node20217:/__e/node20:ro,rshared' || ' ' }}
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup container environment
|
||||
if: matrix.container
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get -y install sudo python3 git g++ curl xz-utils
|
||||
|
||||
- name: Install nodejs20glibc2.17
|
||||
if: ${{ startsWith( matrix.container, 'ubuntu:1' ) }}
|
||||
run: |
|
||||
curl -LO https://archives.boost.io/misc/node/node-v20.9.0-linux-x64-glibc-217.tar.xz
|
||||
tar -xf node-v20.9.0-linux-x64-glibc-217.tar.xz --strip-components 1 -C /node20217
|
||||
ldd /__e/node20/bin/node
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install packages
|
||||
if: matrix.install
|
||||
run: sudo apt install ${{matrix.install}}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install ${{matrix.install}}
|
||||
|
||||
- name: Setup Boost
|
||||
run: |
|
||||
@@ -143,7 +249,7 @@ jobs:
|
||||
mkdir -p libs/$LIBRARY
|
||||
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
|
||||
git submodule update --init tools/boostdep
|
||||
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" -I example $LIBRARY
|
||||
python3 tools/boostdep/depinst/depinst.py --git_args "--jobs 3" -I example $LIBRARY
|
||||
./bootstrap.sh
|
||||
./b2 -d0 headers
|
||||
|
||||
@@ -162,19 +268,6 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- toolset: msvc-14.0
|
||||
cxxstd: "14,latest"
|
||||
addrmd: 32,64
|
||||
os: windows-2019
|
||||
- toolset: msvc-14.2
|
||||
cxxstd: "14,17,20,latest"
|
||||
addrmd: 32,64
|
||||
os: windows-2019
|
||||
- toolset: msvc-14.2
|
||||
cxxstd: "14,17,20,latest"
|
||||
addrmd: 32,64
|
||||
cxxflags: "-Zc:preprocessor"
|
||||
os: windows-2019
|
||||
- toolset: msvc-14.3
|
||||
cxxstd: "14,17,20,latest"
|
||||
addrmd: 32,64
|
||||
@@ -191,12 +284,12 @@ jobs:
|
||||
- toolset: gcc
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
addrmd: 64
|
||||
os: windows-2019
|
||||
os: windows-2022
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Boost
|
||||
shell: cmd
|
||||
@@ -232,15 +325,16 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-18.04
|
||||
- os: ubuntu-20.04
|
||||
- os: ubuntu-22.04
|
||||
- os: macos-11
|
||||
- os: ubuntu-24.04
|
||||
- os: macos-14
|
||||
- os: macos-15
|
||||
- os: macos-26
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install packages
|
||||
if: matrix.install
|
||||
@@ -279,15 +373,16 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-18.04
|
||||
- os: ubuntu-20.04
|
||||
- os: ubuntu-22.04
|
||||
- os: macos-11
|
||||
- os: ubuntu-24.04
|
||||
- os: macos-14
|
||||
- os: macos-15
|
||||
- os: macos-26
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install packages
|
||||
if: matrix.install
|
||||
@@ -336,15 +431,16 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-18.04
|
||||
- os: ubuntu-20.04
|
||||
- os: ubuntu-22.04
|
||||
- os: macos-11
|
||||
- os: ubuntu-24.04
|
||||
- os: macos-14
|
||||
- os: macos-15
|
||||
- os: macos-26
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install packages
|
||||
if: matrix.install
|
||||
@@ -385,3 +481,180 @@ jobs:
|
||||
run: |
|
||||
cd ../boost-root/__build__
|
||||
ctest --output-on-failure --no-tests=error
|
||||
|
||||
windows-cmake-subdir:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: windows-latest
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Boost
|
||||
shell: cmd
|
||||
run: |
|
||||
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
|
||||
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi
|
||||
echo LIBRARY: %LIBRARY%
|
||||
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
|
||||
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
|
||||
echo GITHUB_REF: %GITHUB_REF%
|
||||
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
|
||||
set BOOST_BRANCH=develop
|
||||
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
|
||||
echo BOOST_BRANCH: %BOOST_BRANCH%
|
||||
cd ..
|
||||
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||
cd boost-root
|
||||
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
|
||||
git submodule update --init tools/boostdep
|
||||
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY%
|
||||
|
||||
- name: Use library with add_subdirectory (Debug)
|
||||
shell: cmd
|
||||
run: |
|
||||
cd ../boost-root/libs/%LIBRARY%/test/cmake_subdir_test
|
||||
mkdir __build__ && cd __build__
|
||||
cmake ..
|
||||
cmake --build . --config Debug
|
||||
ctest --output-on-failure --no-tests=error -C Debug
|
||||
|
||||
- name: Use library with add_subdirectory (Release)
|
||||
shell: cmd
|
||||
run: |
|
||||
cd ../boost-root/libs/%LIBRARY%/test/cmake_subdir_test/__build__
|
||||
cmake --build . --config Release
|
||||
ctest --output-on-failure --no-tests=error -C Release
|
||||
|
||||
windows-cmake-install:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: windows-latest
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Boost
|
||||
shell: cmd
|
||||
run: |
|
||||
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
|
||||
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi
|
||||
echo LIBRARY: %LIBRARY%
|
||||
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
|
||||
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
|
||||
echo GITHUB_REF: %GITHUB_REF%
|
||||
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
|
||||
set BOOST_BRANCH=develop
|
||||
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
|
||||
echo BOOST_BRANCH: %BOOST_BRANCH%
|
||||
cd ..
|
||||
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||
cd boost-root
|
||||
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
|
||||
git submodule update --init tools/boostdep
|
||||
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY%
|
||||
|
||||
- name: Configure
|
||||
shell: cmd
|
||||
run: |
|
||||
cd ../boost-root
|
||||
mkdir __build__ && cd __build__
|
||||
cmake -DBOOST_INCLUDE_LIBRARIES=%LIBRARY% -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix ..
|
||||
|
||||
- name: Install (Debug)
|
||||
shell: cmd
|
||||
run: |
|
||||
cd ../boost-root/__build__
|
||||
cmake --build . --target install --config Debug
|
||||
|
||||
- name: Install (Release)
|
||||
shell: cmd
|
||||
run: |
|
||||
cd ../boost-root/__build__
|
||||
cmake --build . --target install --config Release
|
||||
|
||||
- name: Use the installed library (Debug)
|
||||
shell: cmd
|
||||
run: |
|
||||
cd ../boost-root/libs/%LIBRARY%/test/cmake_install_test && mkdir __build__ && cd __build__
|
||||
cmake -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix ..
|
||||
cmake --build . --config Debug
|
||||
ctest --output-on-failure --no-tests=error -C Debug
|
||||
|
||||
- name: Use the installed library (Release)
|
||||
shell: cmd
|
||||
run: |
|
||||
cd ../boost-root/libs/%LIBRARY%/test/cmake_install_test/__build__
|
||||
cmake --build . --config Release
|
||||
ctest --output-on-failure --no-tests=error -C Release
|
||||
|
||||
windows-cmake-test:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: windows-latest
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Boost
|
||||
shell: cmd
|
||||
run: |
|
||||
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
|
||||
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi
|
||||
echo LIBRARY: %LIBRARY%
|
||||
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
|
||||
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
|
||||
echo GITHUB_REF: %GITHUB_REF%
|
||||
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
|
||||
set BOOST_BRANCH=develop
|
||||
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
|
||||
echo BOOST_BRANCH: %BOOST_BRANCH%
|
||||
cd ..
|
||||
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||
cd boost-root
|
||||
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
|
||||
git submodule update --init tools/boostdep
|
||||
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY%
|
||||
|
||||
- name: Configure
|
||||
shell: cmd
|
||||
run: |
|
||||
cd ../boost-root
|
||||
mkdir __build__ && cd __build__
|
||||
cmake -DBOOST_INCLUDE_LIBRARIES=%LIBRARY% -DBUILD_TESTING=ON ..
|
||||
|
||||
- name: Build tests (Debug)
|
||||
shell: cmd
|
||||
run: |
|
||||
cd ../boost-root/__build__
|
||||
cmake --build . --target tests --config Debug
|
||||
|
||||
- name: Run tests (Debug)
|
||||
shell: cmd
|
||||
run: |
|
||||
cd ../boost-root/__build__
|
||||
ctest --output-on-failure --no-tests=error -C Debug
|
||||
|
||||
- name: Build tests (Release)
|
||||
shell: cmd
|
||||
run: |
|
||||
cd ../boost-root/__build__
|
||||
cmake --build . --target tests --config Release
|
||||
|
||||
- name: Run tests (Release)
|
||||
shell: cmd
|
||||
run: |
|
||||
cd ../boost-root/__build__
|
||||
ctest --output-on-failure --no-tests=error -C Release
|
||||
|
||||
@@ -24,9 +24,13 @@ environment:
|
||||
TOOLSET: msvc-14.1
|
||||
CXXSTD: 14,17,latest
|
||||
ADDRMD: 32,64
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
||||
TOOLSET: msvc-14.2
|
||||
CXXSTD: 14,17,20,latest
|
||||
ADDRMD: 32,64
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
||||
TOOLSET: clang-win
|
||||
CXXSTD: 14,17,latest
|
||||
CXXSTD: 14,17,20,latest
|
||||
ADDRMD: 32,64
|
||||
|
||||
install:
|
||||
|
||||
20
build.jam
Normal file
20
build.jam
Normal file
@@ -0,0 +1,20 @@
|
||||
# Copyright 2023-2024 René Ferdinand Rivera Morell
|
||||
# Copyright 2024 Peter Dimov
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
require-b2 5.2 ;
|
||||
|
||||
constant boost_dependencies :
|
||||
/boost/mp11//boost_mp11
|
||||
;
|
||||
|
||||
project /boost/describe ;
|
||||
|
||||
explicit
|
||||
[ alias boost_describe : : : : <include>include <library>$(boost_dependencies) ]
|
||||
[ alias all : boost_describe test ]
|
||||
;
|
||||
|
||||
call-if : boost-library describe
|
||||
;
|
||||
@@ -8,6 +8,16 @@ https://www.boost.org/LICENSE_1_0.txt
|
||||
# Revision History
|
||||
:idprefix:
|
||||
|
||||
## Changes in Boost 1.91.0
|
||||
|
||||
* Under {cpp}20, described nested enums now work when the enclosing class is still incomplete. (Thanks to Julien Blanc.)
|
||||
* Made `enum_to_string` constexpr. (Thanks to Julien Blanc.)
|
||||
|
||||
## Changes in Boost 1.84.0
|
||||
|
||||
* Added an overload of `enum_from_string` that takes a string view, to avoid
|
||||
the need for null termination.
|
||||
|
||||
## Changes in Boost 1.81.0
|
||||
|
||||
* To allow the inclusion of `enumerators.hpp`, `bases.hpp`, and `members.hpp`
|
||||
|
||||
@@ -263,6 +263,11 @@ The presence of private members is taken as an indication that
|
||||
a universal conversion is not suitable, so the overload is
|
||||
disabled in this case using `std::enable_if_t`.
|
||||
|
||||
NOTE: Since release 1.81.0, Boost.JSON provides its
|
||||
own, built-in, support for described classes. Consequently,
|
||||
when using Boost 1.81.0 or later, you don't need the below
|
||||
`tag_invoke` function.
|
||||
|
||||
[source]
|
||||
----
|
||||
include::../../example/to_json.cpp[lines=5..-1]
|
||||
@@ -282,6 +287,11 @@ Like the previous example, but in the other direction. Defines
|
||||
a `tag_invoke` overload that converts a `boost::json::value` to
|
||||
an annotated struct.
|
||||
|
||||
NOTE: Since release 1.81.0, Boost.JSON provides its
|
||||
own, built-in, support for described classes. Consequently,
|
||||
when using Boost 1.81.0 or later, you don't need the below
|
||||
`tag_invoke` function.
|
||||
|
||||
[source]
|
||||
----
|
||||
include::../../example/from_json.cpp[lines=5..-1]
|
||||
|
||||
@@ -362,6 +362,7 @@ namespace boost {
|
||||
namespace describe {
|
||||
|
||||
template<class E> bool enum_from_string( char const * name, E & e ) noexcept;
|
||||
template<class S, class E> bool enum_from_string( S const & name, E & e ) noexcept;
|
||||
|
||||
} }
|
||||
```
|
||||
@@ -372,6 +373,11 @@ The function `enum_from_string` assigns to `e` the enumerator value correspondin
|
||||
to `name` and returns `true`. `E` must be a described enumeration type. If `name`
|
||||
does not correspond to one of the described values, the function returns `false`.
|
||||
|
||||
The second overload only participates in overload resolution when `S` is a
|
||||
string-like type such as `std::string` or `std::string_view`. String-like types
|
||||
are recognized by the presence of nested `value_type` and `traits_type` typedefs
|
||||
and are expected to have a non-throwing `operator==` taking `char const*`.
|
||||
|
||||
## <boost/describe/operators.hpp>
|
||||
|
||||
```
|
||||
|
||||
@@ -18,7 +18,7 @@ template<class T> struct fmt::formatter<T, char, std::enable_if_t<
|
||||
|
||||
if( it != end && *it != '}' )
|
||||
{
|
||||
ctx.error_handler().on_error( "invalid format" );
|
||||
throw_format_error( "invalid format" );
|
||||
}
|
||||
|
||||
return it;
|
||||
|
||||
@@ -25,7 +25,7 @@ public:
|
||||
|
||||
if( i1 != i2 )
|
||||
{
|
||||
ctx.error_handler().on_error( "invalid format" );
|
||||
throw_format_error( "invalid format" );
|
||||
}
|
||||
|
||||
return i1;
|
||||
|
||||
@@ -5,11 +5,14 @@
|
||||
#include <boost/describe.hpp>
|
||||
#include <boost/mp11.hpp>
|
||||
#include <boost/json.hpp>
|
||||
#include <boost/version.hpp>
|
||||
#include <type_traits>
|
||||
|
||||
namespace app
|
||||
{
|
||||
|
||||
#if BOOST_VERSION < 108100
|
||||
|
||||
template<class T> void extract( boost::json::object const & obj, char const * name, T & value )
|
||||
{
|
||||
value = boost::json::value_to<T>( obj.at( name ) );
|
||||
@@ -36,6 +39,8 @@ template<class T,
|
||||
return t;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
struct A
|
||||
{
|
||||
int x;
|
||||
|
||||
@@ -34,7 +34,7 @@ template<class C1, class C2, class R, class... A>
|
||||
|
||||
template<class C>
|
||||
boost::json::value
|
||||
call( C & c, boost::string_view method, boost::json::value const & args )
|
||||
call( C & c, boost::string_view method, boost::json::array const & args )
|
||||
{
|
||||
using Fd = boost::describe::describe_members<C,
|
||||
boost::describe::mod_public | boost::describe::mod_function>;
|
||||
@@ -46,7 +46,7 @@ template<class C>
|
||||
|
||||
if( !found && method == D.name)
|
||||
{
|
||||
result = call_impl( c, D.pointer, args.as_array() );
|
||||
result = call_impl( c, D.pointer, args );
|
||||
found = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <boost/describe.hpp>
|
||||
#include <boost/mp11.hpp>
|
||||
#include <boost/json.hpp>
|
||||
#include <boost/version.hpp>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
@@ -12,6 +13,8 @@
|
||||
namespace app
|
||||
{
|
||||
|
||||
#if BOOST_VERSION < 108100
|
||||
|
||||
template<class T,
|
||||
class D1 = boost::describe::describe_members<T,
|
||||
boost::describe::mod_public | boost::describe::mod_protected>,
|
||||
@@ -29,6 +32,8 @@ template<class T,
|
||||
});
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
struct A
|
||||
{
|
||||
int x;
|
||||
|
||||
@@ -26,27 +26,23 @@ template<class C, class B> struct base_descriptor
|
||||
static constexpr unsigned modifiers = compute_base_modifiers<C, B>();
|
||||
};
|
||||
|
||||
#ifndef __cpp_inline_variables
|
||||
template<class C, class B> constexpr unsigned base_descriptor<C, B>::modifiers;
|
||||
|
||||
template<class... T> auto base_descriptor_fn_impl( int, T... )
|
||||
{
|
||||
return list<T...>();
|
||||
}
|
||||
|
||||
#define BOOST_DESCRIBE_BASE_IMPL(C, B) , boost::describe::detail::base_descriptor<C, B>()
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
|
||||
#define BOOST_DESCRIBE_BASES(C, ...) inline auto boost_base_descriptor_fn( C** ) \
|
||||
{ return boost::describe::detail::base_descriptor_fn_impl( 0 BOOST_DESCRIBE_PP_FOR_EACH(BOOST_DESCRIBE_BASE_IMPL, C, __VA_ARGS__) ); }
|
||||
|
||||
#else
|
||||
|
||||
#define BOOST_DESCRIBE_BASES(C, ...) inline auto boost_base_descriptor_fn( C** ) \
|
||||
{ return boost::describe::detail::base_descriptor_fn_impl( 0 BOOST_DESCRIBE_PP_FOR_EACH(BOOST_DESCRIBE_BASE_IMPL, C, ##__VA_ARGS__) ); }
|
||||
|
||||
#endif
|
||||
|
||||
// bases_descriptor
|
||||
template<typename ...>
|
||||
struct bases_descriptor_impl;
|
||||
|
||||
template<class C, class ...Bs>
|
||||
struct bases_descriptor_impl<C, list<Bs...>>
|
||||
{
|
||||
using type = list<base_descriptor<C, Bs>...>;
|
||||
};
|
||||
|
||||
#define BOOST_DESCRIBE_BASES(C, ...) inline auto boost_base_descriptor_fn( C** ) \
|
||||
{ return typename boost::describe::detail::bases_descriptor_impl<C, boost::describe::detail::list<__VA_ARGS__>>::type(); }
|
||||
|
||||
} // namespace detail
|
||||
} // namespace describe
|
||||
} // namespace boost
|
||||
|
||||
@@ -37,4 +37,28 @@
|
||||
# define BOOST_DESCRIBE_MAYBE_UNUSED
|
||||
#endif
|
||||
|
||||
#if defined(__cpp_inline_variables) && __cpp_inline_variables >= 201606L
|
||||
# define BOOST_DESCRIBE_INLINE_VARIABLE inline
|
||||
#else
|
||||
# define BOOST_DESCRIBE_INLINE_VARIABLE
|
||||
#endif
|
||||
|
||||
#define BOOST_DESCRIBE_INLINE_CONSTEXPR BOOST_DESCRIBE_INLINE_VARIABLE BOOST_DESCRIBE_CONSTEXPR_OR_CONST
|
||||
|
||||
#if __cplusplus >= 202002L || ( defined(_MSVC_LANG) && _MSVC_LANG >= 202002L )
|
||||
|
||||
# define BOOST_DESCRIBE_CXX20
|
||||
|
||||
// Clang 13.0 is needed for unevaluated lambdas
|
||||
# if defined(__clang__) && __clang_major__ < 13
|
||||
# undef BOOST_DESCRIBE_CXX20
|
||||
# endif
|
||||
|
||||
// Apple Clang 13.1 is Clang 13.0
|
||||
# if defined(__clang__) && defined(__apple_build_version__) && __clang_major__ == 13 && __clang_minor__ < 1
|
||||
# undef BOOST_DESCRIBE_CXX20
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif // #ifndef BOOST_DESCRIBE_DETAIL_CONFIG_HPP_INCLUDED
|
||||
|
||||
@@ -35,9 +35,11 @@ template<class D, unsigned M> struct member_descriptor
|
||||
static constexpr unsigned modifiers = M | add_static_modifier( D::pointer() ) | add_function_modifier( D::pointer() );
|
||||
};
|
||||
|
||||
#ifndef __cpp_inline_variables
|
||||
template<class D, unsigned M> constexpr decltype(D::pointer()) member_descriptor<D, M>::pointer;
|
||||
template<class D, unsigned M> constexpr decltype(D::name()) member_descriptor<D, M>::name;
|
||||
template<class D, unsigned M> constexpr unsigned member_descriptor<D, M>::modifiers;
|
||||
#endif
|
||||
|
||||
template<unsigned M, class... T> auto member_descriptor_fn_impl( int, T... )
|
||||
{
|
||||
|
||||
@@ -60,11 +60,35 @@
|
||||
#define BOOST_DESCRIBE_PP_FOR_EACH_50(F, a, x, ...) BOOST_DESCRIBE_PP_EXPAND(BOOST_DESCRIBE_PP_CALL(F, a, x) BOOST_DESCRIBE_PP_FOR_EACH_49(F, a, __VA_ARGS__))
|
||||
#define BOOST_DESCRIBE_PP_FOR_EACH_51(F, a, x, ...) BOOST_DESCRIBE_PP_EXPAND(BOOST_DESCRIBE_PP_CALL(F, a, x) BOOST_DESCRIBE_PP_FOR_EACH_50(F, a, __VA_ARGS__))
|
||||
#define BOOST_DESCRIBE_PP_FOR_EACH_52(F, a, x, ...) BOOST_DESCRIBE_PP_EXPAND(BOOST_DESCRIBE_PP_CALL(F, a, x) BOOST_DESCRIBE_PP_FOR_EACH_51(F, a, __VA_ARGS__))
|
||||
#define BOOST_DESCRIBE_PP_FOR_EACH_53(F, a, x, ...) BOOST_DESCRIBE_PP_EXPAND(BOOST_DESCRIBE_PP_CALL(F, a, x) BOOST_DESCRIBE_PP_FOR_EACH_52(F, a, __VA_ARGS__))
|
||||
#define BOOST_DESCRIBE_PP_FOR_EACH_54(F, a, x, ...) BOOST_DESCRIBE_PP_EXPAND(BOOST_DESCRIBE_PP_CALL(F, a, x) BOOST_DESCRIBE_PP_FOR_EACH_53(F, a, __VA_ARGS__))
|
||||
#define BOOST_DESCRIBE_PP_FOR_EACH_55(F, a, x, ...) BOOST_DESCRIBE_PP_EXPAND(BOOST_DESCRIBE_PP_CALL(F, a, x) BOOST_DESCRIBE_PP_FOR_EACH_54(F, a, __VA_ARGS__))
|
||||
#define BOOST_DESCRIBE_PP_FOR_EACH_56(F, a, x, ...) BOOST_DESCRIBE_PP_EXPAND(BOOST_DESCRIBE_PP_CALL(F, a, x) BOOST_DESCRIBE_PP_FOR_EACH_55(F, a, __VA_ARGS__))
|
||||
#define BOOST_DESCRIBE_PP_FOR_EACH_57(F, a, x, ...) BOOST_DESCRIBE_PP_EXPAND(BOOST_DESCRIBE_PP_CALL(F, a, x) BOOST_DESCRIBE_PP_FOR_EACH_56(F, a, __VA_ARGS__))
|
||||
#define BOOST_DESCRIBE_PP_FOR_EACH_58(F, a, x, ...) BOOST_DESCRIBE_PP_EXPAND(BOOST_DESCRIBE_PP_CALL(F, a, x) BOOST_DESCRIBE_PP_FOR_EACH_57(F, a, __VA_ARGS__))
|
||||
#define BOOST_DESCRIBE_PP_FOR_EACH_59(F, a, x, ...) BOOST_DESCRIBE_PP_EXPAND(BOOST_DESCRIBE_PP_CALL(F, a, x) BOOST_DESCRIBE_PP_FOR_EACH_58(F, a, __VA_ARGS__))
|
||||
#define BOOST_DESCRIBE_PP_FOR_EACH_60(F, a, x, ...) BOOST_DESCRIBE_PP_EXPAND(BOOST_DESCRIBE_PP_CALL(F, a, x) BOOST_DESCRIBE_PP_FOR_EACH_59(F, a, __VA_ARGS__))
|
||||
#define BOOST_DESCRIBE_PP_FOR_EACH_61(F, a, x, ...) BOOST_DESCRIBE_PP_EXPAND(BOOST_DESCRIBE_PP_CALL(F, a, x) BOOST_DESCRIBE_PP_FOR_EACH_60(F, a, __VA_ARGS__))
|
||||
#define BOOST_DESCRIBE_PP_FOR_EACH_62(F, a, x, ...) BOOST_DESCRIBE_PP_EXPAND(BOOST_DESCRIBE_PP_CALL(F, a, x) BOOST_DESCRIBE_PP_FOR_EACH_61(F, a, __VA_ARGS__))
|
||||
#define BOOST_DESCRIBE_PP_FOR_EACH_63(F, a, x, ...) BOOST_DESCRIBE_PP_EXPAND(BOOST_DESCRIBE_PP_CALL(F, a, x) BOOST_DESCRIBE_PP_FOR_EACH_62(F, a, __VA_ARGS__))
|
||||
#define BOOST_DESCRIBE_PP_FOR_EACH_64(F, a, x, ...) BOOST_DESCRIBE_PP_EXPAND(BOOST_DESCRIBE_PP_CALL(F, a, x) BOOST_DESCRIBE_PP_FOR_EACH_63(F, a, __VA_ARGS__))
|
||||
|
||||
#define BOOST_DESCRIBE_PP_FE_EXTRACT(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, V, ...) V
|
||||
#define BOOST_DESCRIBE_PP_FE_EXTRACT(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, V, ...) V
|
||||
|
||||
#define BOOST_DESCRIBE_PP_FOR_EACH(F, ...) \
|
||||
BOOST_DESCRIBE_PP_EXPAND(BOOST_DESCRIBE_PP_EXPAND(BOOST_DESCRIBE_PP_FE_EXTRACT(__VA_ARGS__, \
|
||||
BOOST_DESCRIBE_PP_FOR_EACH_64, \
|
||||
BOOST_DESCRIBE_PP_FOR_EACH_63, \
|
||||
BOOST_DESCRIBE_PP_FOR_EACH_62, \
|
||||
BOOST_DESCRIBE_PP_FOR_EACH_61, \
|
||||
BOOST_DESCRIBE_PP_FOR_EACH_60, \
|
||||
BOOST_DESCRIBE_PP_FOR_EACH_59, \
|
||||
BOOST_DESCRIBE_PP_FOR_EACH_58, \
|
||||
BOOST_DESCRIBE_PP_FOR_EACH_57, \
|
||||
BOOST_DESCRIBE_PP_FOR_EACH_56, \
|
||||
BOOST_DESCRIBE_PP_FOR_EACH_55, \
|
||||
BOOST_DESCRIBE_PP_FOR_EACH_54, \
|
||||
BOOST_DESCRIBE_PP_FOR_EACH_53, \
|
||||
BOOST_DESCRIBE_PP_FOR_EACH_52, \
|
||||
BOOST_DESCRIBE_PP_FOR_EACH_51, \
|
||||
BOOST_DESCRIBE_PP_FOR_EACH_50, \
|
||||
|
||||
@@ -32,15 +32,34 @@ template<class D> struct enum_descriptor
|
||||
static constexpr decltype(D::name()) name = D::name();
|
||||
};
|
||||
|
||||
#ifndef __cpp_inline_variables
|
||||
// GCC requires these definitions
|
||||
template<class D> constexpr decltype(D::value()) enum_descriptor<D>::value;
|
||||
template<class D> constexpr decltype(D::name()) enum_descriptor<D>::name;
|
||||
#endif
|
||||
|
||||
template<class... T> auto enum_descriptor_fn_impl( int, T... )
|
||||
{
|
||||
return list<enum_descriptor<T>...>();
|
||||
}
|
||||
|
||||
#if defined(BOOST_DESCRIBE_CXX20)
|
||||
|
||||
template<auto V, auto N> struct enum_desc
|
||||
{
|
||||
static constexpr auto value() noexcept { return V; }
|
||||
static constexpr auto name() noexcept { return N(); }
|
||||
};
|
||||
|
||||
#define BOOST_DESCRIBE_ENUM_BEGIN(E) \
|
||||
inline decltype( boost::describe::detail::enum_descriptor_fn_impl( 0
|
||||
|
||||
#define BOOST_DESCRIBE_ENUM_ENTRY(E, e) , boost::describe::detail::enum_desc<E::e, []{ return #e; }>{}
|
||||
|
||||
#define BOOST_DESCRIBE_ENUM_END(E) ) ) boost_enum_descriptor_fn( E** ) { return {}; }
|
||||
|
||||
#else
|
||||
|
||||
#define BOOST_DESCRIBE_ENUM_BEGIN(E) \
|
||||
inline auto boost_enum_descriptor_fn( E** ) \
|
||||
{ return boost::describe::detail::enum_descriptor_fn_impl( 0
|
||||
@@ -51,6 +70,8 @@ template<class... T> auto enum_descriptor_fn_impl( int, T... )
|
||||
|
||||
#define BOOST_DESCRIBE_ENUM_END(E) ); }
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace detail
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <boost/describe/enumerators.hpp>
|
||||
#include <boost/mp11/algorithm.hpp>
|
||||
#include <cstring>
|
||||
#include <type_traits>
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER == 1900
|
||||
# pragma warning(push)
|
||||
@@ -41,6 +42,29 @@ bool enum_from_string( char const* name, E& e ) noexcept
|
||||
return found;
|
||||
}
|
||||
|
||||
template<class S, class E, class De = describe_enumerators<E>,
|
||||
class En = std::enable_if_t<
|
||||
std::is_same<typename S::value_type, char>::value &&
|
||||
std::is_same<typename S::traits_type::char_type, char>::value
|
||||
>
|
||||
>
|
||||
bool enum_from_string( S const& name, E& e ) noexcept
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
mp11::mp_for_each<De>([&](auto D){
|
||||
|
||||
if( !found && name == D.name )
|
||||
{
|
||||
found = true;
|
||||
e = D.value;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
} // namespace describe
|
||||
} // namespace boost
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef BOOST_DESCRIBE_ENUM_TO_STRING_HPP_INCLUDED
|
||||
#define BOOST_DESCRIBE_ENUM_TO_STRING_HPP_INCLUDED
|
||||
|
||||
// Copyright 2020, 2021 Peter Dimov
|
||||
// Copyright 2020, 2021, 2025 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
@@ -22,16 +22,34 @@ namespace boost
|
||||
namespace describe
|
||||
{
|
||||
|
||||
template<class E, class De = describe_enumerators<E>>
|
||||
char const * enum_to_string( E e, char const* def ) noexcept
|
||||
namespace detail
|
||||
{
|
||||
char const * r = def;
|
||||
|
||||
mp11::mp_for_each<De>([&](auto D){
|
||||
// [&](auto D){ if( e == D.value ) r = D.name; }
|
||||
// except constexpr under C++14
|
||||
|
||||
if( e == D.value ) r = D.name;
|
||||
template<class E> struct ets_lambda
|
||||
{
|
||||
E e;
|
||||
char const** pr;
|
||||
|
||||
});
|
||||
template<class D> constexpr void operator()( D d ) const noexcept
|
||||
{
|
||||
if( e == d.value ) *pr = d.name;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template<class E, class De = describe_enumerators<E>>
|
||||
#if !( defined(_MSC_VER) && _MSC_VER == 1900 )
|
||||
constexpr
|
||||
#endif
|
||||
char const* enum_to_string( E e, char const* def ) noexcept
|
||||
{
|
||||
char const* r = def;
|
||||
|
||||
mp11::mp_for_each<De>( detail::ets_lambda<E>{ e, &r } );
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -86,9 +86,11 @@ template<class T, unsigned Bm> struct update_modifiers
|
||||
};
|
||||
};
|
||||
|
||||
#ifndef __cpp_inline_variables
|
||||
template<class T, unsigned Bm> template<class D> constexpr decltype(D::pointer) update_modifiers<T, Bm>::fn<D>::pointer;
|
||||
template<class T, unsigned Bm> template<class D> constexpr decltype(D::name) update_modifiers<T, Bm>::fn<D>::name;
|
||||
template<class T, unsigned Bm> template<class D> constexpr unsigned update_modifiers<T, Bm>::fn<D>::modifiers;
|
||||
#endif
|
||||
|
||||
template<class D> struct gather_virtual_bases_impl;
|
||||
template<class D> using gather_virtual_bases = typename gather_virtual_bases_impl<D>::type;
|
||||
|
||||
@@ -25,7 +25,7 @@ enum modifiers
|
||||
mod_hidden = 256
|
||||
};
|
||||
|
||||
BOOST_DESCRIBE_CONSTEXPR_OR_CONST modifiers mod_any_access = static_cast<modifiers>( mod_public | mod_protected | mod_private );
|
||||
BOOST_DESCRIBE_INLINE_CONSTEXPR modifiers mod_any_access = static_cast<modifiers>( mod_public | mod_protected | mod_private );
|
||||
|
||||
} // namespace describe
|
||||
} // namespace boost
|
||||
|
||||
26
test/Jamfile
26
test/Jamfile
@@ -4,11 +4,16 @@
|
||||
|
||||
import testing ;
|
||||
|
||||
local WERROR = <toolset>msvc:<warnings-as-errors>on <toolset>clang:<warnings-as-errors>on <toolset>gcc:<warnings-as-errors>on ;
|
||||
|
||||
project : requirements
|
||||
<library>/boost/describe//boost_describe
|
||||
<library>/boost/container_hash//boost_container_hash
|
||||
<library>/boost/core//boost_core
|
||||
<library>/boost/variant2//boost_variant2
|
||||
|
||||
<warnings>extra
|
||||
<toolset>msvc:<warnings-as-errors>on
|
||||
<toolset>clang:<warnings-as-errors>on
|
||||
<toolset>gcc:<warnings-as-errors>on
|
||||
$(WERROR)
|
||||
<toolset>clang:<cxxflags>"-Wno-unused-private-field" ;
|
||||
|
||||
run quick.cpp ;
|
||||
@@ -78,6 +83,12 @@ run pedantic_bases_test.cpp
|
||||
run pedantic_members_test.cpp
|
||||
: : : <warnings>pedantic ;
|
||||
|
||||
run enum_from_string_test2.cpp ;
|
||||
|
||||
compile nested_enum_test2.cpp ;
|
||||
|
||||
compile enum_to_string_test_cx.cpp ;
|
||||
|
||||
# examples
|
||||
|
||||
obj describe_cxx14 : describe_cxx14.cpp ;
|
||||
@@ -85,8 +96,8 @@ explicit describe_cxx14 ;
|
||||
|
||||
local CXX14 = [ check-target-builds describe_cxx14 describe_cxx14 : : <build>no ] "<toolset>msvc-14.0:<cxxflags>-wd4100" ;
|
||||
|
||||
local JSON = <library>/boost//json/<warnings>off "<toolset>msvc-14.2:<cxxflags>-wd5104" ;
|
||||
local SERIALIZATION = <library>/boost//serialization/<warnings>off "-<toolset>clang:<warnings-as-errors>on" ;
|
||||
local JSON = <library>/boost/json//boost_json/<warnings>off "<toolset>msvc-14.2:<cxxflags>-wd5104" "<toolset>msvc-14.0:<cxxflags>-wd4996" <undefined-sanitizer>norecover:<link>static ;
|
||||
local SERIALIZATION = <library>/boost/serialization//boost_serialization/<warnings>off -$(WERROR) <undefined-sanitizer>norecover:<link>static ;
|
||||
|
||||
run ../example/printing_enums_ct.cpp : : : $(CXX14) ;
|
||||
run ../example/printing_enums_rt.cpp : : : $(CXX14) ;
|
||||
@@ -96,9 +107,10 @@ run ../example/print_function.cpp : : : $(CXX14) ;
|
||||
run ../example/to_json.cpp : : : $(CXX14) $(JSON) ;
|
||||
run ../example/from_json.cpp : : : $(CXX14) $(JSON) ;
|
||||
run ../example/serialization.cpp : : : $(CXX14) $(SERIALIZATION) ;
|
||||
run ../example/json_rpc.cpp : : : $(CXX14) $(JSON) ;
|
||||
run ../example/json_rpc.cpp : : : $(CXX14) $(JSON) <library>/boost/utility//boost_utility
|
||||
"<toolset>gcc-14,<cxxstd>14:<build>no" ; # mysterious segmentation fault
|
||||
run ../example/hash_value.cpp : : : $(CXX14) ;
|
||||
run ../example/equality.cpp : : : $(CXX14) ;
|
||||
link ../example/console.cpp : $(CXX14) $(JSON) ;
|
||||
link ../example/console.cpp : $(CXX14) $(JSON) <library>/boost/utility//boost_utility ;
|
||||
run ../example/struct_to_tuple.cpp : : : $(CXX14) ;
|
||||
run ../example/pm_to_string.cpp : : : $(CXX14) ;
|
||||
|
||||
@@ -62,6 +62,14 @@ int main() {}
|
||||
|
||||
#include <boost/mp11.hpp>
|
||||
|
||||
template<typename ...Bases>
|
||||
struct ZT: Bases...
|
||||
{
|
||||
BOOST_DESCRIBE_CLASS(ZT, (Bases...), (), (), ());
|
||||
};
|
||||
|
||||
using Z = ZT<X1, X2, X3>;
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace boost::describe;
|
||||
@@ -151,6 +159,21 @@ int main()
|
||||
BOOST_TEST_EQ( (mp_at_c<L, 1>::modifiers), mod_private | mod_virtual );
|
||||
}
|
||||
|
||||
{
|
||||
using L = describe_bases<Z, mod_any_access>;
|
||||
|
||||
BOOST_TEST_EQ( mp_size<L>::value, 3 );
|
||||
|
||||
BOOST_TEST_TRAIT_SAME( typename mp_at_c<L, 0>::type, X1 );
|
||||
BOOST_TEST_EQ( (mp_at_c<L, 0>::modifiers), mod_public );
|
||||
|
||||
BOOST_TEST_TRAIT_SAME( typename mp_at_c<L, 1>::type, X2 );
|
||||
BOOST_TEST_EQ( (mp_at_c<L, 1>::modifiers), mod_public );
|
||||
|
||||
BOOST_TEST_TRAIT_SAME( typename mp_at_c<L, 2>::type, X3 );
|
||||
BOOST_TEST_EQ( (mp_at_c<L, 2>::modifiers), mod_public );
|
||||
}
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
|
||||
@@ -14,4 +14,4 @@ target_link_libraries(main Boost::describe)
|
||||
enable_testing()
|
||||
add_test(main main)
|
||||
|
||||
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
|
||||
add_custom_target(check VERBATIM COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
|
||||
|
||||
@@ -11,7 +11,6 @@ add_subdirectory(../../../assert boostorg/assert)
|
||||
add_subdirectory(../../../config boostorg/config)
|
||||
add_subdirectory(../../../core boostorg/core)
|
||||
add_subdirectory(../../../mp11 boostorg/mp11)
|
||||
add_subdirectory(../../../static_assert boostorg/static_assert)
|
||||
add_subdirectory(../../../throw_exception boostorg/throw_exception)
|
||||
|
||||
add_executable(quick ../quick.cpp)
|
||||
@@ -20,4 +19,4 @@ target_link_libraries(quick Boost::describe Boost::core)
|
||||
enable_testing()
|
||||
add_test(quick quick)
|
||||
|
||||
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure --no-tests=error -C $<CONFIG>)
|
||||
add_custom_target(check VERBATIM COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure --no-tests=error -C $<CONFIG>)
|
||||
|
||||
78
test/enum_from_string_test2.cpp
Normal file
78
test/enum_from_string_test2.cpp
Normal file
@@ -0,0 +1,78 @@
|
||||
// Copyright 2021 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/describe/enum_from_string.hpp>
|
||||
#include <boost/describe/enum.hpp>
|
||||
#include <boost/core/detail/string_view.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if !defined(BOOST_DESCRIBE_CXX14)
|
||||
|
||||
#include <boost/config/pragma_message.hpp>
|
||||
|
||||
BOOST_PRAGMA_MESSAGE("Skipping test because C++14 is not available")
|
||||
int main() {}
|
||||
|
||||
#else
|
||||
|
||||
enum E1 { v101 = 101, v102 = 102 };
|
||||
BOOST_DESCRIBE_ENUM(E1, v101, v102)
|
||||
|
||||
enum class E2 { v201 = 201, v202 = 202 };
|
||||
BOOST_DESCRIBE_ENUM(E2, v201, v202)
|
||||
|
||||
BOOST_DEFINE_ENUM(E3, v301, v302)
|
||||
BOOST_DEFINE_ENUM_CLASS(E4, v401, v402)
|
||||
|
||||
template<class St> void test()
|
||||
{
|
||||
using boost::describe::enum_from_string;
|
||||
|
||||
{
|
||||
E1 w{};
|
||||
BOOST_TEST( enum_from_string( St( "v101" ), w ) ) && BOOST_TEST_EQ( w, v101 );
|
||||
BOOST_TEST( enum_from_string( St( "v102" ), w ) ) && BOOST_TEST_EQ( w, v102 );
|
||||
BOOST_TEST_NOT( enum_from_string( St( "v103" ), w ) );
|
||||
}
|
||||
|
||||
{
|
||||
E2 w{};
|
||||
BOOST_TEST( enum_from_string( St( "v201" ), w ) ) && BOOST_TEST_EQ( (int)w, (int)E2::v201 );
|
||||
BOOST_TEST( enum_from_string( St( "v202" ), w ) ) && BOOST_TEST_EQ( (int)w, (int)E2::v202 );
|
||||
BOOST_TEST_NOT( enum_from_string( St( "v203" ), w ) );
|
||||
}
|
||||
|
||||
{
|
||||
E3 w{};
|
||||
BOOST_TEST( enum_from_string( St( "v301" ), w ) ) && BOOST_TEST_EQ( w, v301 );
|
||||
BOOST_TEST( enum_from_string( St( "v302" ), w ) ) && BOOST_TEST_EQ( w, v302 );
|
||||
BOOST_TEST_NOT( enum_from_string( St( "v303" ), w ) );
|
||||
}
|
||||
|
||||
{
|
||||
E4 w{};
|
||||
BOOST_TEST( enum_from_string( St( "v401" ), w ) ) && BOOST_TEST_EQ( (int)w, (int)E4::v401 );
|
||||
BOOST_TEST( enum_from_string( St( "v402" ), w ) ) && BOOST_TEST_EQ( (int)w, (int)E4::v402 );
|
||||
BOOST_TEST_NOT( enum_from_string( St( "v403" ), w ) );
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW)
|
||||
# include <string_view>
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
test<std::string>();
|
||||
test<boost::core::string_view>();
|
||||
|
||||
#if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW)
|
||||
test<std::string_view>();
|
||||
#endif
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif // !defined(BOOST_DESCRIBE_CXX14)
|
||||
32
test/enum_to_string_test_cx.cpp
Normal file
32
test/enum_to_string_test_cx.cpp
Normal file
@@ -0,0 +1,32 @@
|
||||
// Copyright 2021, 2025 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/describe/enum_to_string.hpp>
|
||||
#include <boost/describe/enum.hpp>
|
||||
#include <boost/describe/detail/cx_streq.hpp>
|
||||
#include <boost/config/pragma_message.hpp>
|
||||
|
||||
#if !defined(BOOST_DESCRIBE_CXX14)
|
||||
|
||||
BOOST_PRAGMA_MESSAGE("Skipping test because C++14 is not available")
|
||||
|
||||
#elif defined(_MSC_VER) && _MSC_VER == 1900
|
||||
|
||||
BOOST_PRAGMA_MESSAGE("Skipping test because _MSC_VER == 1900")
|
||||
|
||||
#else
|
||||
|
||||
#define STATIC_ASSERT(...) static_assert(__VA_ARGS__, #__VA_ARGS__)
|
||||
|
||||
BOOST_DEFINE_ENUM_CLASS(E, v1, v2, v3)
|
||||
|
||||
using boost::describe::enum_to_string;
|
||||
using boost::describe::detail::cx_streq;
|
||||
|
||||
STATIC_ASSERT( cx_streq( enum_to_string( E::v1, "" ), "v1" ) );
|
||||
STATIC_ASSERT( cx_streq( enum_to_string( E::v2, "" ), "v2" ) );
|
||||
STATIC_ASSERT( cx_streq( enum_to_string( E::v3, "" ), "v3" ) );
|
||||
STATIC_ASSERT( cx_streq( enum_to_string( (E)17, "def" ), "def" ) );
|
||||
|
||||
#endif // !defined(BOOST_DESCRIBE_CXX14)
|
||||
24
test/nested_enum_test2.cpp
Normal file
24
test/nested_enum_test2.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
// Copyright 2025 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/describe/enumerators.hpp>
|
||||
#include <boost/describe/enum.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/pragma_message.hpp>
|
||||
|
||||
#if !defined(BOOST_DESCRIBE_CXX20)
|
||||
|
||||
BOOST_PRAGMA_MESSAGE("Skipping test because BOOST_DESCRIBE_CXX20 isn't defined")
|
||||
|
||||
#else
|
||||
|
||||
struct X
|
||||
{
|
||||
enum E { v1 };
|
||||
BOOST_DESCRIBE_NESTED_ENUM(E, v1)
|
||||
|
||||
using L = boost::describe::describe_enumerators<E>;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -70,6 +70,19 @@ char const * s49 = BOOST_DESCRIBE_PP_FOR_EACH(F1, ~, a, b, c, d, e, f, g, h, i,
|
||||
char const * s50 = BOOST_DESCRIBE_PP_FOR_EACH(F1, ~, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X);
|
||||
char const * s51 = BOOST_DESCRIBE_PP_FOR_EACH(F1, ~, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y);
|
||||
char const * s52 = BOOST_DESCRIBE_PP_FOR_EACH(F1, ~, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z);
|
||||
char const * s53 = BOOST_DESCRIBE_PP_FOR_EACH(F1, ~, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, 1);
|
||||
char const * s54 = BOOST_DESCRIBE_PP_FOR_EACH(F1, ~, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, 1, 2);
|
||||
char const * s55 = BOOST_DESCRIBE_PP_FOR_EACH(F1, ~, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, 1, 2, 3);
|
||||
char const * s56 = BOOST_DESCRIBE_PP_FOR_EACH(F1, ~, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, 1, 2, 3, 4);
|
||||
char const * s57 = BOOST_DESCRIBE_PP_FOR_EACH(F1, ~, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, 1, 2, 3, 4, 5);
|
||||
char const * s58 = BOOST_DESCRIBE_PP_FOR_EACH(F1, ~, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, 1, 2, 3, 4, 5, 6);
|
||||
char const * s59 = BOOST_DESCRIBE_PP_FOR_EACH(F1, ~, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, 1, 2, 3, 4, 5, 6, 7);
|
||||
char const * s60 = BOOST_DESCRIBE_PP_FOR_EACH(F1, ~, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, 1, 2, 3, 4, 5, 6, 7, 8);
|
||||
char const * s61 = BOOST_DESCRIBE_PP_FOR_EACH(F1, ~, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, 1, 2, 3, 4, 5, 6, 7, 8, 9);
|
||||
char const * s62 = BOOST_DESCRIBE_PP_FOR_EACH(F1, ~, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0);
|
||||
char const * s63 = BOOST_DESCRIBE_PP_FOR_EACH(F1, ~, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, @);
|
||||
char const * s64 = BOOST_DESCRIBE_PP_FOR_EACH(F1, ~, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, @, _);
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
@@ -126,6 +139,18 @@ int main()
|
||||
BOOST_TEST_CSTR_EQ( s50, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWX" );
|
||||
BOOST_TEST_CSTR_EQ( s51, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY" );
|
||||
BOOST_TEST_CSTR_EQ( s52, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" );
|
||||
BOOST_TEST_CSTR_EQ( s53, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1" );
|
||||
BOOST_TEST_CSTR_EQ( s54, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ12" );
|
||||
BOOST_TEST_CSTR_EQ( s55, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123" );
|
||||
BOOST_TEST_CSTR_EQ( s56, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234" );
|
||||
BOOST_TEST_CSTR_EQ( s57, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ12345" );
|
||||
BOOST_TEST_CSTR_EQ( s58, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456" );
|
||||
BOOST_TEST_CSTR_EQ( s59, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567" );
|
||||
BOOST_TEST_CSTR_EQ( s60, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ12345678" );
|
||||
BOOST_TEST_CSTR_EQ( s61, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789" );
|
||||
BOOST_TEST_CSTR_EQ( s62, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" );
|
||||
BOOST_TEST_CSTR_EQ( s63, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890@" );
|
||||
BOOST_TEST_CSTR_EQ( s64, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890@_" );
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user