mirror of
https://github.com/boostorg/describe.git
synced 2026-01-20 16:32:36 +00:00
Compare commits
21 Commits
feature/se
...
feature/ha
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b5df0b2ee9 | ||
|
|
1e32c60dff | ||
|
|
0d8de0aae7 | ||
|
|
8ff96dcd9e | ||
|
|
7a06d512dc | ||
|
|
2deab4c35c | ||
|
|
8a982de483 | ||
|
|
f8c2b7d2d9 | ||
|
|
5d13049e06 | ||
|
|
df0f16a85b | ||
|
|
81d924fff2 | ||
|
|
a1557028b3 | ||
|
|
6bf8045bac | ||
|
|
973bdf1725 | ||
|
|
f6bf0c4f1e | ||
|
|
c156466e2b | ||
|
|
9273e7c0af | ||
|
|
ef9c38f90c | ||
|
|
6749a0f46a | ||
|
|
c8c46bfdf7 | ||
|
|
ccfed27ddd |
337
.drone.jsonnet
Normal file
337
.drone.jsonnet
Normal file
@@ -0,0 +1,337 @@
|
||||
# Copyright 2022 Peter Dimov
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
local library = "describe";
|
||||
|
||||
local triggers =
|
||||
{
|
||||
branch: [ "master", "develop", "feature/*" ]
|
||||
};
|
||||
|
||||
local ubsan = { UBSAN: '1', UBSAN_OPTIONS: 'print_stacktrace=1' };
|
||||
local asan = { ASAN: '1' };
|
||||
|
||||
local linux_pipeline(name, image, environment, packages = "", sources = [], arch = "amd64") =
|
||||
{
|
||||
name: name,
|
||||
kind: "pipeline",
|
||||
type: "docker",
|
||||
trigger: triggers,
|
||||
platform:
|
||||
{
|
||||
os: "linux",
|
||||
arch: arch
|
||||
},
|
||||
steps:
|
||||
[
|
||||
{
|
||||
name: "everything",
|
||||
image: image,
|
||||
environment: environment,
|
||||
commands:
|
||||
[
|
||||
'set -e',
|
||||
'wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -',
|
||||
] +
|
||||
(if sources != [] then [ ('apt-add-repository "' + source + '"') for source in sources ] else []) +
|
||||
(if packages != "" then [ 'apt-get update', 'apt-get -y install ' + packages ] else []) +
|
||||
[
|
||||
'export LIBRARY=' + library,
|
||||
'./.drone/drone.sh',
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
local macos_pipeline(name, environment, xcode_version = "12.2", osx_version = "catalina", arch = "amd64") =
|
||||
{
|
||||
name: name,
|
||||
kind: "pipeline",
|
||||
type: "exec",
|
||||
trigger: triggers,
|
||||
platform: {
|
||||
"os": "darwin",
|
||||
"arch": arch
|
||||
},
|
||||
node: {
|
||||
"os": osx_version
|
||||
},
|
||||
steps: [
|
||||
{
|
||||
name: "everything",
|
||||
environment: environment + { "DEVELOPER_DIR": "/Applications/Xcode-" + xcode_version + ".app/Contents/Developer" },
|
||||
commands:
|
||||
[
|
||||
'export LIBRARY=' + library,
|
||||
'./.drone/drone.sh',
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
local windows_pipeline(name, image, environment, arch = "amd64") =
|
||||
{
|
||||
name: name,
|
||||
kind: "pipeline",
|
||||
type: "docker",
|
||||
trigger: triggers,
|
||||
platform:
|
||||
{
|
||||
os: "windows",
|
||||
arch: arch
|
||||
},
|
||||
"steps":
|
||||
[
|
||||
{
|
||||
name: "everything",
|
||||
image: image,
|
||||
environment: environment,
|
||||
commands:
|
||||
[
|
||||
'cmd /C .drone\\\\drone.bat ' + library,
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
[
|
||||
linux_pipeline(
|
||||
"Linux 14.04 GCC 4.4",
|
||||
"cppalliance/droneubuntu1404:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-4.4', CXXSTD: '98,0x' },
|
||||
"g++-4.4",
|
||||
[ "ppa:ubuntu-toolchain-r/test" ],
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 14.04 GCC 4.6",
|
||||
"cppalliance/droneubuntu1404:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-4.6', CXXSTD: '98,0x' },
|
||||
"g++-4.6",
|
||||
[ "ppa:ubuntu-toolchain-r/test" ],
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 14.04 GCC 4.7",
|
||||
"cppalliance/droneubuntu1404:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-4.7', CXXSTD: '98,0x' },
|
||||
"g++-4.7",
|
||||
[ "ppa:ubuntu-toolchain-r/test" ],
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 14.04 GCC 4.8*",
|
||||
"cppalliance/droneubuntu1404:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11' },
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 14.04 GCC 4.9",
|
||||
"cppalliance/droneubuntu1404:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-4.9', CXXSTD: '03,11' },
|
||||
"g++-4.9",
|
||||
[ "ppa:ubuntu-toolchain-r/test" ],
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 16.04 GCC 5*",
|
||||
"cppalliance/droneubuntu1604:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,1z' },
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 18.04 GCC 6",
|
||||
"cppalliance/droneubuntu1804:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-6', CXXSTD: '03,11,14,1z' },
|
||||
"g++-6",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 18.04 GCC 7*",
|
||||
"cppalliance/droneubuntu1804:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17' },
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 18.04 GCC 8",
|
||||
"cppalliance/droneubuntu1804:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-8', CXXSTD: '03,11,14,17,2a' },
|
||||
"g++-8",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 20.04 GCC 9*",
|
||||
"cppalliance/droneubuntu2004:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a' },
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 20.04 GCC 10",
|
||||
"cppalliance/droneubuntu2004:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-10', CXXSTD: '03,11,14,17,2a' },
|
||||
"g++-10",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 22.04 GCC 11*",
|
||||
"cppalliance/droneubuntu2204:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a' },
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 22.04 GCC 12",
|
||||
"cppalliance/droneubuntu2204:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '03,11,14,17,20,2b' },
|
||||
"g++-12",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 16.04 Clang 3.5",
|
||||
"cppalliance/droneubuntu1604:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-3.5', CXXSTD: '03,11' },
|
||||
"clang-3.5",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 16.04 Clang 3.6",
|
||||
"cppalliance/droneubuntu1604:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-3.6', CXXSTD: '03,11,14' },
|
||||
"clang-3.6",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 16.04 Clang 3.7",
|
||||
"cppalliance/droneubuntu1604:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-3.7', CXXSTD: '03,11,14' },
|
||||
"clang-3.7",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 16.04 Clang 3.8",
|
||||
"cppalliance/droneubuntu1604:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-3.8', CXXSTD: '03,11,14' },
|
||||
"clang-3.8",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 18.04 Clang 3.9",
|
||||
"cppalliance/droneubuntu1804:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-3.9', CXXSTD: '03,11,14' },
|
||||
"clang-3.9",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 18.04 Clang 4.0",
|
||||
"cppalliance/droneubuntu1804:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-4.0', CXXSTD: '03,11,14' },
|
||||
"clang-4.0",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 18.04 Clang 5.0",
|
||||
"cppalliance/droneubuntu1804:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-5.0', CXXSTD: '03,11,14,1z' },
|
||||
"clang-5.0",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 18.04 Clang 6.0",
|
||||
"cppalliance/droneubuntu1804:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-6.0', CXXSTD: '03,11,14,17' },
|
||||
"clang-6.0",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 20.04 Clang 7",
|
||||
"cppalliance/droneubuntu2004:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-7', CXXSTD: '03,11,14,17' },
|
||||
"clang-7",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 20.04 Clang 8",
|
||||
"cppalliance/droneubuntu2004:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-8', CXXSTD: '03,11,14,17' },
|
||||
"clang-8",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 20.04 Clang 9",
|
||||
"cppalliance/droneubuntu2004:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-9', CXXSTD: '03,11,14,17,2a' },
|
||||
"clang-9",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 20.04 Clang 10",
|
||||
"cppalliance/droneubuntu2004:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-10', CXXSTD: '03,11,14,17,2a' },
|
||||
"clang-10",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 20.04 Clang 11",
|
||||
"cppalliance/droneubuntu2004:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-11', CXXSTD: '03,11,14,17,2a' },
|
||||
"clang-11",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 20.04 Clang 12",
|
||||
"cppalliance/droneubuntu2004:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-12', CXXSTD: '03,11,14,17,2a' },
|
||||
"clang-12",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 22.04 Clang 13",
|
||||
"cppalliance/droneubuntu2204:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-13', CXXSTD: '03,11,14,17,20,2b' },
|
||||
"clang-13",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 22.04 Clang 14",
|
||||
"cppalliance/droneubuntu2204:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-14', CXXSTD: '03,11,14,17,20,2b' },
|
||||
"clang-14",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 22.04 Clang 15",
|
||||
"cppalliance/droneubuntu2204:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-15', CXXSTD: '03,11,14,17,20,2b' },
|
||||
"clang-15",
|
||||
["deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main"],
|
||||
),
|
||||
|
||||
macos_pipeline(
|
||||
"MacOS 10.15 Xcode 12.2",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,1z' },
|
||||
),
|
||||
|
||||
windows_pipeline(
|
||||
"Windows VS2015 msvc-14.0",
|
||||
"cppalliance/dronevs2015",
|
||||
{ TOOLSET: 'msvc-14.0', CXXSTD: '14,latest' },
|
||||
),
|
||||
|
||||
windows_pipeline(
|
||||
"Windows VS2017 msvc-14.1",
|
||||
"cppalliance/dronevs2017",
|
||||
{ TOOLSET: 'msvc-14.1', CXXSTD: '14,17,latest' },
|
||||
),
|
||||
|
||||
windows_pipeline(
|
||||
"Windows VS2019 msvc-14.2",
|
||||
"cppalliance/dronevs2019",
|
||||
{ TOOLSET: 'msvc-14.2', CXXSTD: '14,17,20,latest' },
|
||||
),
|
||||
|
||||
windows_pipeline(
|
||||
"Windows VS2022 msvc-14.3",
|
||||
"cppalliance/dronevs2022:1",
|
||||
{ TOOLSET: 'msvc-14.3', CXXSTD: '14,17,20,latest' },
|
||||
),
|
||||
]
|
||||
23
.drone/drone.bat
Normal file
23
.drone/drone.bat
Normal file
@@ -0,0 +1,23 @@
|
||||
@REM Copyright 2022 Peter Dimov
|
||||
@REM Distributed under the Boost Software License, Version 1.0.
|
||||
@REM https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
@ECHO ON
|
||||
|
||||
set LIBRARY=%1
|
||||
set DRONE_BUILD_DIR=%CD%
|
||||
|
||||
set BOOST_BRANCH=develop
|
||||
if "%DRONE_BRANCH%" == "master" set BOOST_BRANCH=master
|
||||
cd ..
|
||||
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||
cd boost-root
|
||||
git submodule update --init tools/boostdep
|
||||
xcopy /s /e /q %DRONE_BUILD_DIR% libs\%LIBRARY%\
|
||||
python tools/boostdep/depinst/depinst.py -I example %LIBRARY%
|
||||
cmd /c bootstrap
|
||||
b2 -d0 headers
|
||||
|
||||
if not "%CXXSTD%" == "" set CXXSTD=cxxstd=%CXXSTD%
|
||||
if not "%ADDRMD%" == "" set ADDRMD=address-model=%ADDRMD%
|
||||
b2 -j3 libs/%LIBRARY%/test toolset=%TOOLSET% %CXXSTD% %ADDRMD% variant=debug,release embed-manifest-via=linker
|
||||
24
.drone/drone.sh
Executable file
24
.drone/drone.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2022 Peter Dimov
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
set -ex
|
||||
|
||||
DRONE_BUILD_DIR=$(pwd)
|
||||
|
||||
BOOST_BRANCH=develop
|
||||
if [ "$DRONE_BRANCH" = "master" ]; then BOOST_BRANCH=master; fi
|
||||
|
||||
cd ..
|
||||
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||
cd boost-root
|
||||
git submodule update --init tools/boostdep
|
||||
cp -r $DRONE_BUILD_DIR/* libs/$LIBRARY
|
||||
python tools/boostdep/depinst/depinst.py -I example $LIBRARY
|
||||
./bootstrap.sh
|
||||
./b2 -d0 headers
|
||||
|
||||
echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam
|
||||
./b2 -j3 libs/$LIBRARY/test toolset=$TOOLSET cxxstd=$CXXSTD variant=debug,release ${ADDRMD:+address-model=$ADDRMD} ${UBSAN:+undefined-sanitizer=norecover debug-symbols=on} ${ASAN:+address-sanitizer=norecover debug-symbols=on} ${LINKFLAGS:+linkflags=$LINKFLAGS}
|
||||
39
.github/workflows/ci.yml
vendored
39
.github/workflows/ci.yml
vendored
@@ -47,6 +47,10 @@ jobs:
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
os: ubuntu-20.04
|
||||
install: g++-11
|
||||
- toolset: gcc-12
|
||||
cxxstd: "03,11,14,17,20"
|
||||
os: ubuntu-22.04
|
||||
install: g++-12
|
||||
- toolset: clang
|
||||
compiler: clang++-3.9
|
||||
cxxstd: "03,11,14"
|
||||
@@ -97,14 +101,24 @@ jobs:
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
os: ubuntu-20.04
|
||||
install: clang-12
|
||||
- toolset: clang
|
||||
compiler: clang++-13
|
||||
cxxstd: "03,11,14,17,20"
|
||||
os: ubuntu-22.04
|
||||
install: clang-13
|
||||
- toolset: clang
|
||||
compiler: clang++-14
|
||||
cxxstd: "03,11,14,17,20"
|
||||
os: ubuntu-22.04
|
||||
install: clang-14
|
||||
- toolset: clang
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
os: macos-10.15
|
||||
os: macos-11
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install packages
|
||||
if: matrix.install
|
||||
@@ -152,10 +166,6 @@ jobs:
|
||||
cxxstd: "14,latest"
|
||||
addrmd: 32,64
|
||||
os: windows-2019
|
||||
- toolset: msvc-14.1
|
||||
cxxstd: "14,17,latest"
|
||||
addrmd: 32,64
|
||||
os: windows-2016
|
||||
- toolset: msvc-14.2
|
||||
cxxstd: "14,17,20,latest"
|
||||
addrmd: 32,64
|
||||
@@ -186,7 +196,7 @@ jobs:
|
||||
runs-on: ${{matrix.os}}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Boost
|
||||
shell: cmd
|
||||
@@ -224,12 +234,13 @@ jobs:
|
||||
include:
|
||||
- os: ubuntu-18.04
|
||||
- os: ubuntu-20.04
|
||||
- os: macos-10.15
|
||||
- os: ubuntu-22.04
|
||||
- os: macos-11
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install packages
|
||||
if: matrix.install
|
||||
@@ -270,12 +281,13 @@ jobs:
|
||||
include:
|
||||
- os: ubuntu-18.04
|
||||
- os: ubuntu-20.04
|
||||
- os: macos-10.15
|
||||
- os: ubuntu-22.04
|
||||
- os: macos-11
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install packages
|
||||
if: matrix.install
|
||||
@@ -326,12 +338,13 @@ jobs:
|
||||
include:
|
||||
- os: ubuntu-18.04
|
||||
- os: ubuntu-20.04
|
||||
- os: macos-10.15
|
||||
- os: ubuntu-22.04
|
||||
- os: macos-11
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install packages
|
||||
if: matrix.install
|
||||
|
||||
@@ -15,7 +15,10 @@ branches:
|
||||
environment:
|
||||
matrix:
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
TOOLSET: msvc-14.0
|
||||
TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0
|
||||
ADDRMD: 32
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
TOOLSET: msvc-12.0,msvc-14.0
|
||||
ADDRMD: 32,64
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
TOOLSET: msvc-14.1
|
||||
|
||||
@@ -478,7 +478,7 @@ This example defines an `operator<<` overload for pointers to members.
|
||||
|
||||
[source]
|
||||
----
|
||||
include::../../example/pm_to_string.cpp[lines=5..-1]
|
||||
include::../../example/pm_to_string.cpp[lines=9..-1]
|
||||
----
|
||||
|
||||
Sample output:
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
// Copyright 2021 Peter Dimov
|
||||
// Copyright 2021, 2022 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/container_hash/hash.hpp>
|
||||
#include <boost/describe.hpp>
|
||||
#include <boost/mp11.hpp>
|
||||
#include <boost/container_hash/hash.hpp>
|
||||
#include <boost/variant2/variant.hpp>
|
||||
#include <boost/version.hpp>
|
||||
#include <vector>
|
||||
|
||||
using namespace boost::describe;
|
||||
@@ -13,6 +14,8 @@ using namespace boost::describe;
|
||||
namespace app
|
||||
{
|
||||
|
||||
#if BOOST_VERSION < 108100
|
||||
|
||||
template<class T,
|
||||
class Bd = describe_bases<T, mod_any_access>,
|
||||
class Md = describe_members<T, mod_any_access>,
|
||||
@@ -37,6 +40,8 @@ template<class T,
|
||||
return r;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
struct A
|
||||
{
|
||||
int x = 1;
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 12
|
||||
# pragma GCC diagnostic ignored "-Wrestrict" // false positive
|
||||
#endif
|
||||
|
||||
#include <boost/describe.hpp>
|
||||
#include <boost/mp11.hpp>
|
||||
#include <boost/core/type_name.hpp>
|
||||
|
||||
@@ -16,5 +16,6 @@
|
||||
#include <boost/describe/operators.hpp>
|
||||
#include <boost/describe/descriptor_by_name.hpp>
|
||||
#include <boost/describe/descriptor_by_pointer.hpp>
|
||||
#include <boost/describe/modifier_description.hpp>
|
||||
|
||||
#endif // #ifndef BOOST_DESCRIBE_HPP_INCLUDED
|
||||
|
||||
@@ -19,6 +19,10 @@
|
||||
|
||||
# define BOOST_DESCRIBE_CXX11
|
||||
|
||||
# if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ == 7
|
||||
# undef BOOST_DESCRIBE_CXX11
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_DESCRIBE_CXX11)
|
||||
@@ -27,12 +31,10 @@
|
||||
# define BOOST_DESCRIBE_CONSTEXPR_OR_CONST const
|
||||
#endif
|
||||
|
||||
#define BOOST_DESCRIBE_MAYBE_UNUSED
|
||||
#if defined(__has_cpp_attribute)
|
||||
# if __has_cpp_attribute(maybe_unused)
|
||||
# undef BOOST_DESCRIBE_MAYBE_UNUSED
|
||||
# define BOOST_DESCRIBE_MAYBE_UNUSED [[maybe_unused]]
|
||||
# endif
|
||||
#if defined(__clang__)
|
||||
# define BOOST_DESCRIBE_MAYBE_UNUSED __attribute__((unused))
|
||||
#else
|
||||
# define BOOST_DESCRIBE_MAYBE_UNUSED
|
||||
#endif
|
||||
|
||||
#endif // #ifndef BOOST_DESCRIBE_DETAIL_CONFIG_HPP_INCLUDED
|
||||
|
||||
@@ -13,6 +13,11 @@
|
||||
#include <boost/mp11/algorithm.hpp>
|
||||
#include <cstring>
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER == 1900
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable: 4100) // unreferenced formal parameter
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace describe
|
||||
@@ -39,6 +44,10 @@ bool enum_from_string( char const* name, E& e ) noexcept
|
||||
} // namespace describe
|
||||
} // namespace boost
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER == 1900
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif // defined(BOOST_DESCRIBE_CXX14)
|
||||
|
||||
#endif // #ifndef BOOST_DESCRIBE_ENUM_FROM_STRING_HPP_INCLUDED
|
||||
|
||||
@@ -12,6 +12,11 @@
|
||||
#include <boost/describe/enumerators.hpp>
|
||||
#include <boost/mp11/algorithm.hpp>
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER == 1900
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable: 4100) // unreferenced formal parameter
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace describe
|
||||
@@ -34,6 +39,10 @@ char const * enum_to_string( E e, char const* def ) noexcept
|
||||
} // namespace describe
|
||||
} // namespace boost
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER == 1900
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif // defined(BOOST_DESCRIBE_CXX14)
|
||||
|
||||
#endif // #ifndef BOOST_DESCRIBE_ENUM_TO_STRING_HPP_INCLUDED
|
||||
|
||||
30
include/boost/describe/modifier_description.hpp
Normal file
30
include/boost/describe/modifier_description.hpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#ifndef BOOST_DESCRIBE_MODIFIER_DESCRIPTION_HPP_INCLUDED
|
||||
#define BOOST_DESCRIBE_MODIFIER_DESCRIPTION_HPP_INCLUDED
|
||||
|
||||
// Copyright 2020, 2022 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/describe/modifiers.hpp>
|
||||
#include <boost/describe/enum.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace describe
|
||||
{
|
||||
|
||||
BOOST_DESCRIBE_ENUM(modifiers,
|
||||
mod_public,
|
||||
mod_protected,
|
||||
mod_private,
|
||||
mod_virtual,
|
||||
mod_static,
|
||||
mod_function,
|
||||
mod_any_member,
|
||||
mod_inherited,
|
||||
mod_hidden)
|
||||
|
||||
} // namespace describe
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_DESCRIBE_MODIFIER_DESCRIPTION_HPP_INCLUDED
|
||||
@@ -5,7 +5,7 @@
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/describe/enum.hpp>
|
||||
#include <boost/describe/detail/config.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
@@ -22,20 +22,9 @@ enum modifiers
|
||||
mod_function = 32,
|
||||
mod_any_member = 64,
|
||||
mod_inherited = 128,
|
||||
mod_hidden = 256,
|
||||
mod_hidden = 256
|
||||
};
|
||||
|
||||
BOOST_DESCRIBE_ENUM(modifiers,
|
||||
mod_public,
|
||||
mod_protected,
|
||||
mod_private,
|
||||
mod_virtual,
|
||||
mod_static,
|
||||
mod_function,
|
||||
mod_any_member,
|
||||
mod_inherited,
|
||||
mod_hidden)
|
||||
|
||||
BOOST_DESCRIBE_CONSTEXPR_OR_CONST modifiers mod_any_access = static_cast<modifiers>( mod_public | mod_protected | mod_private );
|
||||
|
||||
} // namespace describe
|
||||
|
||||
@@ -16,6 +16,11 @@
|
||||
#include <type_traits>
|
||||
#include <iosfwd>
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER == 1900
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable: 4100) // unreferenced formal parameter
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace describe
|
||||
@@ -25,8 +30,8 @@ namespace detail
|
||||
{
|
||||
|
||||
template<class T,
|
||||
class Bd = describe_bases<T, mod_any_access>,
|
||||
class Md = describe_members<T, mod_any_access>>
|
||||
class Bd = describe::describe_bases<T, mod_any_access>,
|
||||
class Md = describe::describe_members<T, mod_any_access>>
|
||||
bool eq( T const& t1, T const& t2 )
|
||||
{
|
||||
bool r = true;
|
||||
@@ -48,8 +53,8 @@ bool eq( T const& t1, T const& t2 )
|
||||
}
|
||||
|
||||
template<class T,
|
||||
class Bd = describe_bases<T, mod_any_access>,
|
||||
class Md = describe_members<T, mod_any_access>>
|
||||
class Bd = describe::describe_bases<T, mod_any_access>,
|
||||
class Md = describe::describe_members<T, mod_any_access>>
|
||||
bool lt( T const& t1, T const& t2 )
|
||||
{
|
||||
int r = 0;
|
||||
@@ -73,8 +78,8 @@ bool lt( T const& t1, T const& t2 )
|
||||
}
|
||||
|
||||
template<class Os, class T,
|
||||
class Bd = describe_bases<T, mod_any_access>,
|
||||
class Md = describe_members<T, mod_any_access>>
|
||||
class Bd = describe::describe_bases<T, mod_any_access>,
|
||||
class Md = describe::describe_members<T, mod_any_access>>
|
||||
void print( Os& os, T const& t )
|
||||
{
|
||||
os << "{";
|
||||
@@ -165,6 +170,10 @@ template<class T, class Ch, class Tr> std::enable_if_t<
|
||||
} // namespace describe
|
||||
} // namespace boost
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER == 1900
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif // defined(BOOST_DESCRIBE_CXX14)
|
||||
|
||||
#endif // #ifndef BOOST_DESCRIBE_OPERATORS_HPP_INCLUDED
|
||||
|
||||
12
test/Jamfile
12
test/Jamfile
@@ -9,7 +9,6 @@ project : requirements
|
||||
<toolset>msvc:<warnings-as-errors>on
|
||||
<toolset>clang:<warnings-as-errors>on
|
||||
<toolset>gcc:<warnings-as-errors>on
|
||||
<toolset>msvc-14.0:<cxxflags>"-wd4100"
|
||||
<toolset>clang:<cxxflags>"-Wno-unused-private-field" ;
|
||||
|
||||
run quick.cpp ;
|
||||
@@ -72,14 +71,21 @@ compile unnamed_namespace_test2.cpp ;
|
||||
run union_test.cpp ;
|
||||
run union_test2.cpp ;
|
||||
|
||||
run pedantic_enumerators_test.cpp
|
||||
: : : <warnings>pedantic ;
|
||||
run pedantic_bases_test.cpp
|
||||
: : : <warnings>pedantic ;
|
||||
run pedantic_members_test.cpp
|
||||
: : : <warnings>pedantic ;
|
||||
|
||||
# examples
|
||||
|
||||
obj describe_cxx14 : describe_cxx14.cpp ;
|
||||
explicit describe_cxx14 ;
|
||||
|
||||
local CXX14 = [ check-target-builds describe_cxx14 describe_cxx14 : : <build>no ] ;
|
||||
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.0:<build>no" "<toolset>msvc-14.2:<cxxflags>-wd5104" ;
|
||||
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" ;
|
||||
|
||||
run ../example/printing_enums_ct.cpp : : : $(CXX14) ;
|
||||
|
||||
@@ -7,6 +7,11 @@
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/core/lightweight_test_trait.hpp>
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1900
|
||||
# pragma warning(disable: 4510) // default constructor could not be generated
|
||||
# pragma warning(disable: 4610) // struct can never be instantiated
|
||||
#endif
|
||||
|
||||
struct X
|
||||
{
|
||||
};
|
||||
|
||||
@@ -20,9 +20,11 @@ namespace app
|
||||
|
||||
struct X
|
||||
{
|
||||
void f() const {}
|
||||
static void g() {}
|
||||
};
|
||||
|
||||
BOOST_DESCRIBE_STRUCT(X, (), ())
|
||||
BOOST_DESCRIBE_STRUCT(X, (), (f, g))
|
||||
|
||||
using boost::describe::operators::operator==;
|
||||
using boost::describe::operators::operator<<;
|
||||
|
||||
@@ -20,9 +20,11 @@ namespace app
|
||||
|
||||
struct X
|
||||
{
|
||||
void f() const {}
|
||||
static void g() {}
|
||||
};
|
||||
|
||||
BOOST_DESCRIBE_STRUCT(X, (), ())
|
||||
BOOST_DESCRIBE_STRUCT(X, (), (f, g))
|
||||
|
||||
using boost::describe::operators::operator<=;
|
||||
using boost::describe::operators::operator>=;
|
||||
|
||||
19
test/pedantic_bases_test.cpp
Normal file
19
test/pedantic_bases_test.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
// Copyright 2022 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/describe/bases.hpp>
|
||||
#include <boost/core/lightweight_test_trait.hpp>
|
||||
|
||||
struct X {};
|
||||
|
||||
int main()
|
||||
{
|
||||
#if defined(BOOST_DESCRIBE_CXX11)
|
||||
|
||||
BOOST_TEST_TRAIT_FALSE((boost::describe::has_describe_bases<X>));
|
||||
|
||||
#endif
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
19
test/pedantic_enumerators_test.cpp
Normal file
19
test/pedantic_enumerators_test.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
// Copyright 2022 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/core/lightweight_test_trait.hpp>
|
||||
|
||||
enum E {};
|
||||
|
||||
int main()
|
||||
{
|
||||
#if defined(BOOST_DESCRIBE_CXX11)
|
||||
|
||||
BOOST_TEST_TRAIT_FALSE((boost::describe::has_describe_enumerators<E>));
|
||||
|
||||
#endif
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
19
test/pedantic_members_test.cpp
Normal file
19
test/pedantic_members_test.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
// Copyright 2022 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/describe/members.hpp>
|
||||
#include <boost/core/lightweight_test_trait.hpp>
|
||||
|
||||
struct X {};
|
||||
|
||||
int main()
|
||||
{
|
||||
#if defined(BOOST_DESCRIBE_CXX11)
|
||||
|
||||
BOOST_TEST_TRAIT_FALSE((boost::describe::has_describe_members<X>));
|
||||
|
||||
#endif
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
@@ -2,6 +2,8 @@
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
// Tests that -Wunused-function is not emitted under Clang
|
||||
|
||||
#include <boost/describe.hpp>
|
||||
|
||||
#if !defined(BOOST_DESCRIBE_CXX14)
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
// Tests that -Wunneeded-internal-declaration is not emitted under Clang
|
||||
|
||||
#include <boost/describe.hpp>
|
||||
|
||||
#if !defined(BOOST_DESCRIBE_CXX14)
|
||||
|
||||
Reference in New Issue
Block a user