Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 30 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ jobs:
os: ubuntu-22.04
install: g++-12-multilib
address-model: 32,64
- toolset: gcc-13
cxxstd: "11,14,17,20,2b"
os: ubuntu-latest
container: ubuntu:23.04
install: g++-13-multilib
address-model: 32,64
- toolset: clang
compiler: clang++-3.9
cxxstd: "11,14"
Expand Down Expand Up @@ -126,9 +132,26 @@ jobs:
cxxstd: "11,14,17,20,2b"
os: ubuntu-22.04
install: clang-14
- toolset: clang
compiler: clang++-15
cxxstd: "11,14,17,20,2b"
os: ubuntu-22.04
install: clang-15
- toolset: clang
compiler: clang++-16
cxxstd: "11,14,17,20,2b"
os: ubuntu-latest
container: ubuntu:23.04
install: clang-16
- toolset: clang
cxxstd: "11,14,17,2a"
os: macos-11
- toolset: clang
cxxstd: "11,14,17,20,2b"
os: macos-12
- toolset: clang
cxxstd: "11,14,17,20,2b"
os: macos-13

runs-on: ${{matrix.os}}
container: ${{matrix.container}}
Expand All @@ -144,11 +167,13 @@ jobs:
if: matrix.container
run: |
apt-get update
apt-get -y install sudo python git g++
apt-get -y install sudo python3 git g++

- name: Install packages
if: matrix.install
run: sudo apt-get -y install ${{matrix.install}}
run: |
sudo apt-get update
sudo apt-get -y install ${{matrix.install}}

- name: Setup Boost
run: |
Expand All @@ -168,7 +193,7 @@ jobs:
cd boost-root
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
python3 tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
./bootstrap.sh
./b2 -d0 headers

Expand All @@ -180,7 +205,7 @@ jobs:
- name: Generate headers
run: |
cd ../boost-root/libs/leaf
python gen/generate_single_header.py -i include/boost/leaf/detail/all.hpp -p include -o test/leaf.hpp boost/leaf
python3 gen/generate_single_header.py -i include/boost/leaf/detail/all.hpp -p include -o test/leaf.hpp boost/leaf

- name: Run tests
run: |
Expand All @@ -204,7 +229,6 @@ jobs:
cxxstd: "14,17,latest"
addrmd: 64
os: windows-2022
embedmanifest: embed-manifest-via=linker
- toolset: gcc
cxxstd: "11,14,17,2a"
addrmd: 64
Expand Down Expand Up @@ -240,7 +264,7 @@ jobs:
- name: Generate headers
run: |
cd ../boost-root/libs/leaf
python gen/generate_single_header.py -i include/boost/leaf/detail/all.hpp -p include -o test/leaf.hpp boost/leaf
python3 gen/generate_single_header.py -i include/boost/leaf/detail/all.hpp -p include -o test/leaf.hpp boost/leaf

- name: Run tests
shell: cmd
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*.opensdf
*.db
*.opendb
bld/*
_bld/*
doc/html/*
snippets/*
subprojects/*/
Expand Down
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"name": "(lldb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/bld/debug/capture_exception_async_test",
"program": "${workspaceFolder}/_bld/debug/capture_exception_async_test",
"args": [ ],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
Expand Down
25 changes: 11 additions & 14 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
{
"label": "Configure Meson build directories",
"type": "shell",
"command": "cd ${workspaceRoot} && meson -D leaf_boost_examples=true -D leaf_lua_examples=true bld/debug && meson -D leaf_boost_examples=true -D leaf_lua_examples=true -D leaf_hpp=true bld/debug_leaf_hpp && meson -D leaf_boost_examples=true -D leaf_lua_examples=true bld/release --buildtype release && meson -D leaf_boost_examples=true -D leaf_lua_examples=true -D leaf_hpp=true bld/release_leaf_hpp --buildtype release && meson -D leaf_diagnostics=0 -D cpp_eh=none -D b_ndebug=true -D b_lto=true -D leaf_enable_benchmarks=true bld/benchmark --buildtype release",
"command": "cd ${workspaceRoot} && meson -D leaf_boost_examples=true -D leaf_lua_examples=true _bld/debug && meson -D leaf_boost_examples=true -D leaf_lua_examples=true -D leaf_hpp=true _bld/debug_leaf_hpp && meson -D leaf_boost_examples=true -D leaf_lua_examples=true _bld/release --buildtype release && meson -D leaf_boost_examples=true -D leaf_lua_examples=true -D leaf_hpp=true _bld/release_leaf_hpp --buildtype release && meson -D leaf_diagnostics=0 -D cpp_eh=none -D b_ndebug=true -D b_lto=true -D leaf_enable_benchmarks=true _bld/benchmark --buildtype release",
"problemMatcher": []
},
{
"label": "Configure Meson build directories (no Boost)",
"type": "shell",
"command": "cd ${workspaceRoot} && meson -D leaf_lua_examples=true bld/debug && meson -D leaf_lua_examples=true -D leaf_hpp=true bld/debug_leaf_hpp && meson -D leaf_lua_examples=true bld/release --buildtype release && meson -D leaf_lua_examples=true -D leaf_hpp=true bld/release_leaf_hpp --buildtype release",
"command": "cd ${workspaceRoot} && meson -D leaf_lua_examples=true _bld/debug && meson -D leaf_lua_examples=true -D leaf_hpp=true _bld/debug_leaf_hpp && meson -D leaf_lua_examples=true _bld/release --buildtype release && meson -D leaf_lua_examples=true -D leaf_hpp=true _bld/release_leaf_hpp --buildtype release",
"problemMatcher": []
},
{
Expand All @@ -28,12 +28,12 @@
},
"label": "Build all unit tests and examples (debug)",
"type": "shell",
"command": "cd ${workspaceRoot}/bld/debug && ninja",
"command": "cd ${workspaceRoot}/_bld/debug && ninja",
"problemMatcher": {
"base": "$gcc",
"fileLocation": [
"relative",
"${workspaceRoot}/bld/debug"
"${workspaceRoot}/_bld/debug"
]
}
},
Expand All @@ -44,12 +44,12 @@
"dependsOn": [
"Generate leaf.hpp"
],
"command": "cd ${workspaceRoot}/bld/debug_leaf_hpp && ninja && meson test && cd ${workspaceRoot}/bld/debug && ninja && meson test",
"command": "cd ${workspaceRoot}/_bld/debug_leaf_hpp && ninja && meson test && cd ${workspaceRoot}/_bld/debug && ninja && meson test",
"problemMatcher": {
"base": "$gcc",
"fileLocation": [
"relative",
"${workspaceRoot}/bld/debug"
"${workspaceRoot}/_bld/debug"
]
}
},
Expand All @@ -60,22 +60,19 @@
"dependsOn": [
"Generate leaf.hpp"
],
"command": "cd ${workspaceRoot}/bld/release && ninja && meson test && cd ${workspaceRoot}/bld/release_leaf_hpp && ninja && meson test",
"command": "cd ${workspaceRoot}/_bld/release && ninja && meson test && cd ${workspaceRoot}/_bld/release_leaf_hpp && ninja && meson test",
"problemMatcher": {
"base": "$gcc",
"fileLocation": [
"relative",
"${workspaceRoot}/bld/release"
"${workspaceRoot}/_bld/release"
]
}
},
{
"group": "test",
"label": "Run all unit tests (b2, all configurations)",
"type": "shell",
"dependsOn": [
"Generate leaf.hpp"
],
"command": "../../b2 test link=shared,static variant=debug,release,leaf_debug_diag0,leaf_release_diag0,leaf_debug_leaf_hpp,leaf_release_leaf_hpp exception-handling=on,off cxxstd=11,14,1z,17 && ../../b2 test link=shared,static variant=debug,release,leaf_debug_diag0,leaf_release_diag0,leaf_debug_leaf_hpp,leaf_release_leaf_hpp,leaf_debug_embedded,leaf_release_embedded exception-handling=off rtti=off cxxstd=11,14,1z,17",
"windows": {
"command": "..\\..\\b2 test link=shared,static variant=debug,release,leaf_debug_diag0,leaf_release_diag0,leaf_debug_leaf_hpp,leaf_release_leaf_hpp exception-handling=on,off cxxstd=14,17,latest && ..\\..\\b2 test link=shared,static variant=debug,release,leaf_debug_diag0,leaf_release_diag0,leaf_debug_leaf_hpp,leaf_release_leaf_hpp,leaf_debug_embedded,leaf_release_embedded exception-handling=off rtti=off cxxstd=14,17,latest",
Expand All @@ -84,7 +81,7 @@
"base": "$gcc",
"fileLocation": [
"relative",
"${workspaceRoot}/bld/release"
"${workspaceRoot}/_bld/release"
]
}
},
Expand All @@ -95,12 +92,12 @@
},
"label": "Test current editor file",
"type": "shell",
"command": "cd ${workspaceRoot}/bld/debug && ninja && { meson test ${fileBasenameNoExtension} || cat ./meson-logs/testlog.txt }",
"command": "cd ${workspaceRoot}/_bld/debug && ninja && { meson test ${fileBasenameNoExtension} || cat ./meson-logs/testlog.txt }",
"problemMatcher": {
"base": "$gcc",
"fileLocation": [
"relative",
"${workspaceRoot}/bld/debug"
"${workspaceRoot}/_bld/debug"
]
}
}
Expand Down
2 changes: 1 addition & 1 deletion include/boost/leaf/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ namespace leaf_detail
BOOST_LEAF_ASSERT(err_id != 0);
auto & sl = std::get<I-1>(tup);
if( sl.has_value(err_id) )
load_slot(err_id, std::move(sl).value(err_id));
(void) load_slot<true>(err_id, std::move(sl).value(err_id));
tuple_for_each<I-1,Tuple>::propagate_captured(tup, err_id);
}

Expand Down
9 changes: 9 additions & 0 deletions include/boost/leaf/detail/optional.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,15 @@ namespace leaf_detail
}
}

BOOST_LEAF_CONSTEXPR T & put( int key )
{
BOOST_LEAF_ASSERT(key);
reset();
(void) new(&value_) T;
key_=key;
return value_;
}

BOOST_LEAF_CONSTEXPR T & put( int key, T const & v )
{
BOOST_LEAF_ASSERT(key);
Expand Down
Loading