2
0
mirror of https://github.com/boostorg/lambda2.git synced 2026-01-20 04:32:44 +00:00

Compare commits

...

51 Commits

Author SHA1 Message Date
Peter Dimov
f60f1d7f9f Update ci.yml 2025-12-15 15:55:12 +02:00
Peter Dimov
7b49621c6c Update version 2025-12-15 15:47:09 +02:00
Peter Dimov
a87d775e10 Update ci.yml 2025-10-09 19:52:36 +03:00
Peter Dimov
585671d15d Update version 2025-10-09 18:30:37 +03:00
Peter Dimov
dddfec6085 Update ci.yml 2025-06-28 08:26:42 +03:00
Peter Dimov
a13c743c4b Update version 2025-06-28 08:08:43 +03:00
Peter Dimov
865eb98c9c Update ci.yml 2024-12-13 22:38:40 +02:00
Peter Dimov
8466c546e5 Apply Node20 workaround 2024-12-13 22:36:00 +02:00
Peter Dimov
6ebe42d4ac Update ci.yml 2024-12-13 22:35:11 +02:00
Peter Dimov
cb2e51eb84 Update version 2024-12-13 22:33:25 +02:00
Peter Dimov
f1d863c6b2 Add VERBATIM to add_custom_target 2024-08-27 14:07:08 +03:00
Peter Dimov
3fb266bf57 Update build.jam, test/Jamfile 2024-08-27 13:59:28 +03:00
Rene Rivera
3d7778f2a9 Sync from upstream. 2024-08-17 09:06:33 -05:00
Peter Dimov
97f43720a1 Update ci.yml 2024-08-17 11:53:49 +03:00
Peter Dimov
3a982bf019 Update version 2024-08-17 04:22:04 +03:00
Rene Rivera
a03806e4ec Move inter-lib dependencies to a project variable and into the build targets. 2024-07-23 22:34:24 -05:00
Rene Rivera
53bbeac521 Update copyright dates. 2024-07-20 22:52:05 -05:00
Rene Rivera
ad47d9ed4f Change all <source> references to <library>. 2024-07-20 19:40:17 -05:00
Rene Rivera
d1fa581326 Bump B2 require to 5.2 2024-06-14 11:33:55 -05:00
Rene Rivera
19d484e707 Add requires-b2 check to top-level build file. 2024-05-05 09:00:01 -05:00
Rene Rivera
a50009a44f Sync from upstream. 2024-04-20 15:34:26 -05:00
Peter Dimov
4118a318ca Update version 2024-04-18 12:08:17 +03:00
Peter Dimov
94a56766bb Revert "Update doc/Jamfile"
This reverts commit 863cdf2e96.
2024-04-16 22:35:22 +03:00
Peter Dimov
863cdf2e96 Update doc/Jamfile 2024-04-16 22:19:00 +03:00
Rene Rivera
7958b78d45 Make the library modular usable. 2024-03-11 08:38:17 -05:00
Peter Dimov
a17ffc25d3 Update ci.yml 2023-12-19 16:29:43 +02:00
Peter Dimov
2c8de60398 Update version 2023-12-19 13:21:24 +02:00
Peter Dimov
62815a69bf Update ci.yml 2023-08-13 01:00:21 +03:00
Peter Dimov
247f6b7b58 Update version 2023-08-12 23:47:37 +03:00
Peter Dimov
2935343723 Update ci.yml 2023-04-15 18:19:30 +03:00
Peter Dimov
8ac931161b Update version 2023-04-15 15:20:39 +03:00
Peter Dimov
3ba6ab955e Update version 2022-12-15 17:55:58 +02:00
Peter Dimov
4b68743cf0 Add gcc-12, clang-13, clang-14 to ci.yml 2022-08-15 19:55:55 +03:00
Peter Dimov
3f43588316 Regenerate CMakeLists.txt 2022-08-15 19:32:30 +03:00
Peter Dimov
20420e134f Add 'cxxstd' to meta/libraries.json 2022-08-15 19:32:03 +03:00
Peter Dimov
7824b74a27 Add CMake tests to ci.yml 2022-08-15 19:22:35 +03:00
Peter Dimov
d72468479f Change macos-10.15 to macos-11 in ci.yml 2022-08-15 19:08:24 +03:00
Peter Dimov
b55fdcb9fa Update version 2022-08-14 18:45:43 +03:00
Peter Dimov
fd1a3e4543 Remove msvc-14.1 from GHA, add clang-win 2022-04-14 16:15:13 +03:00
Peter Dimov
8c6c1166c4 Update ci.yml 2022-04-14 14:21:41 +03:00
Peter Dimov
c618d6902b Re-enable VS2017 2022-04-14 14:02:35 +03:00
Peter Dimov
ae42ebda76 Update version 2022-04-14 13:41:49 +03:00
Peter Dimov
3ccd5c251b Add msvc-14.0 to GHA 2021-12-09 04:11:57 +02:00
Peter Dimov
132db3b09a Update version 2021-12-09 04:10:29 +02:00
Peter Dimov
253aef863f Enable syntax highlighting 2021-10-28 23:13:48 +03:00
Peter Dimov
a593616a98 Add msvc-14.3 to ci.yml 2021-10-28 23:13:17 +03:00
Peter Dimov
2ff3fef3d1 Update documentation 2021-10-18 21:33:52 +03:00
Peter Dimov
0572e42219 Work around libc++ issue (again.) 2021-10-18 21:20:14 +03:00
Peter Dimov
7c39436198 Add first, second function objects. Fixes #5. 2021-10-18 20:57:25 +03:00
Peter Dimov
f8b3099259 Fix placeholder types in the synopsis 2021-09-05 19:01:20 +03:00
Peter Dimov
a666ac4fb6 Update revision history 2021-09-05 18:46:17 +03:00
14 changed files with 638 additions and 53 deletions

View File

@@ -19,88 +19,210 @@ jobs:
include: include:
- toolset: gcc-5 - toolset: gcc-5
cxxstd: "03,11,14,1z" cxxstd: "03,11,14,1z"
os: ubuntu-18.04 container: ubuntu:18.04
os: ubuntu-latest
install: g++-5 install: g++-5
- toolset: gcc-6 - toolset: gcc-6
cxxstd: "03,11,14,1z" cxxstd: "03,11,14,1z"
os: ubuntu-18.04 container: ubuntu:18.04
os: ubuntu-latest
install: g++-6 install: g++-6
- toolset: gcc-7 - toolset: gcc-7
cxxstd: "03,11,14,17" cxxstd: "03,11,14,17"
os: ubuntu-18.04 container: ubuntu:20.04
os: ubuntu-latest
install: g++-7
- toolset: gcc-8 - toolset: gcc-8
cxxstd: "03,11,14,17,2a" cxxstd: "03,11,14,17,2a"
os: ubuntu-18.04 container: ubuntu:20.04
os: ubuntu-latest
install: g++-8 install: g++-8
- toolset: gcc-9 - toolset: gcc-9
cxxstd: "03,11,14,17,2a" cxxstd: "03,11,14,17,2a"
os: ubuntu-20.04 container: ubuntu:20.04
os: ubuntu-latest
- toolset: gcc-10 - toolset: gcc-10
cxxstd: "03,11,14,17,2a" cxxstd: "03,11,14,17,2a"
os: ubuntu-18.04 container: ubuntu:20.04
os: ubuntu-latest
install: g++-10
- toolset: gcc-11 - toolset: gcc-11
cxxstd: "03,11,14,17,2a" cxxstd: "03,11,14,17,2a"
os: ubuntu-18.04 os: ubuntu-22.04
install: g++-11 - toolset: gcc-12
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.04
os: ubuntu-latest
install: g++-15
- toolset: clang - toolset: clang
compiler: clang++-3.9 compiler: clang++-3.9
cxxstd: "03,11,14" cxxstd: "03,11,14"
os: ubuntu-18.04 container: ubuntu:18.04
os: ubuntu-latest
install: clang-3.9 install: clang-3.9
- toolset: clang - toolset: clang
compiler: clang++-4.0 compiler: clang++-4.0
cxxstd: "03,11,14" cxxstd: "03,11,14"
os: ubuntu-18.04 container: ubuntu:18.04
os: ubuntu-latest
install: clang-4.0 install: clang-4.0
- toolset: clang - toolset: clang
compiler: clang++-5.0 compiler: clang++-5.0
cxxstd: "03,11,14,1z" cxxstd: "03,11,14,1z"
os: ubuntu-18.04 container: ubuntu:18.04
os: ubuntu-latest
install: clang-5.0 install: clang-5.0
- toolset: clang - toolset: clang
compiler: clang++-6.0 compiler: clang++-6.0
cxxstd: "03,11,14,17" cxxstd: "03,11,14,17"
os: ubuntu-18.04 container: ubuntu:20.04
os: ubuntu-latest
install: clang-6.0 install: clang-6.0
- toolset: clang - toolset: clang
compiler: clang++-7 compiler: clang++-7
cxxstd: "03,11,14,17" cxxstd: "03,11,14,17"
os: ubuntu-18.04 container: ubuntu:20.04
os: ubuntu-latest
install: clang-7 install: clang-7
- toolset: clang - toolset: clang
compiler: clang++-8 compiler: clang++-8
cxxstd: "03,11,14,17,2a" cxxstd: "03,11,14,17,2a"
os: ubuntu-20.04 container: ubuntu:20.04
os: ubuntu-latest
install: clang-8 install: clang-8
- toolset: clang - toolset: clang
compiler: clang++-9 compiler: clang++-9
cxxstd: "03,11,14,17,2a" cxxstd: "03,11,14,17,2a"
os: ubuntu-20.04 container: ubuntu:20.04
os: ubuntu-latest
install: clang-9 install: clang-9
- toolset: clang - toolset: clang
compiler: clang++-10 compiler: clang++-10
cxxstd: "03,11,14,17,2a" cxxstd: "03,11,14,17,2a"
os: ubuntu-20.04 container: ubuntu:20.04
os: ubuntu-latest
install: clang-10
- toolset: clang - toolset: clang
compiler: clang++-11 compiler: clang++-11
cxxstd: "03,11,14,17,2a" cxxstd: "03,11,14,17,2a"
os: ubuntu-20.04 container: ubuntu:20.04
os: ubuntu-latest
install: clang-11
- toolset: clang - toolset: clang
compiler: clang++-12 compiler: clang++-12
cxxstd: "03,11,14,17,2a" cxxstd: "03,11,14,17,2a"
os: ubuntu-20.04 container: ubuntu:20.04
os: ubuntu-latest
install: clang-12
- toolset: clang - toolset: clang
cxxstd: "03,11,14,17,2a" compiler: clang++-13
os: macos-10.15 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,2b"
container: ubuntu:22.04
os: ubuntu-latest
install: clang-14
- toolset: clang
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,2b"
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,23,2c"
os: macos-15
- toolset: clang
cxxstd: "03,11,14,17,20,23,2c"
os: macos-26
runs-on: ${{matrix.os}} 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: steps:
- uses: actions/checkout@v2 - 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 - name: Install packages
if: matrix.install if: matrix.install
run: sudo apt install ${{matrix.install}} run: sudo apt-get -y install ${{matrix.install}}
- name: Setup Boost - name: Setup Boost
run: | run: |
@@ -120,7 +242,7 @@ jobs:
cd boost-root cd boost-root
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
git submodule update --init tools/boostdep 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 ./bootstrap.sh
./b2 -d0 headers ./b2 -d0 headers
@@ -139,23 +261,23 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- toolset: msvc-14.1 - toolset: msvc-14.3
cxxstd: "14,17,20,latest"
addrmd: 32,64
os: windows-2022
- toolset: clang-win
cxxstd: "14,17,latest" cxxstd: "14,17,latest"
addrmd: 32,64 addrmd: 32,64
os: windows-2016 os: windows-2022
- toolset: msvc-14.2
cxxstd: "14,17,latest"
addrmd: 32,64
os: windows-2019
- toolset: gcc - toolset: gcc
cxxstd: "03,11,14,17,2a" cxxstd: "03,11,14,17,2a"
addrmd: 64 addrmd: 64
os: windows-2019 os: windows-2022
runs-on: ${{matrix.os}} runs-on: ${{matrix.os}}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v4
- name: Setup Boost - name: Setup Boost
shell: cmd shell: cmd
@@ -183,4 +305,346 @@ jobs:
shell: cmd shell: cmd
run: | run: |
cd ../boost-root cd ../boost-root
b2 -j3 libs/%LIBRARY%/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} address-model=${{matrix.addrmd}} variant=debug,release b2 -j3 libs/%LIBRARY%/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} address-model=${{matrix.addrmd}} variant=debug,release embed-manifest-via=linker
posix-cmake-subdir:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
- os: ubuntu-24.04
- os: macos-14
- os: macos-15
- os: macos-26
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Install packages
if: matrix.install
run: sudo apt install ${{matrix.install}}
- name: Setup Boost
run: |
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
LIBRARY=${GITHUB_REPOSITORY#*/}
echo LIBRARY: $LIBRARY
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
echo GITHUB_REF: $GITHUB_REF
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
REF=${REF#refs/heads/}
echo REF: $REF
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
echo BOOST_BRANCH: $BOOST_BRANCH
cd ..
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
- name: Use library with add_subdirectory
run: |
cd ../boost-root/libs/$LIBRARY/test/cmake_subdir_test
mkdir __build__ && cd __build__
cmake ..
cmake --build .
ctest --output-on-failure --no-tests=error
posix-cmake-install:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
- os: ubuntu-24.04
- os: macos-14
- os: macos-15
- os: macos-26
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Install packages
if: matrix.install
run: sudo apt install ${{matrix.install}}
- name: Setup Boost
run: |
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
LIBRARY=${GITHUB_REPOSITORY#*/}
echo LIBRARY: $LIBRARY
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
echo GITHUB_REF: $GITHUB_REF
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
REF=${REF#refs/heads/}
echo REF: $REF
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
echo BOOST_BRANCH: $BOOST_BRANCH
cd ..
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
- name: Configure
run: |
cd ../boost-root
mkdir __build__ && cd __build__
cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DCMAKE_INSTALL_PREFIX=~/.local ..
- name: Install
run: |
cd ../boost-root/__build__
cmake --build . --target install
- name: Use the installed library
run: |
cd ../boost-root/libs/$LIBRARY/test/cmake_install_test && mkdir __build__ && cd __build__
cmake -DCMAKE_INSTALL_PREFIX=~/.local ..
cmake --build .
ctest --output-on-failure --no-tests=error
posix-cmake-test:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
- os: ubuntu-24.04
- os: macos-14
- os: macos-15
- os: macos-26
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Install packages
if: matrix.install
run: sudo apt install ${{matrix.install}}
- name: Setup Boost
run: |
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
LIBRARY=${GITHUB_REPOSITORY#*/}
echo LIBRARY: $LIBRARY
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
echo GITHUB_REF: $GITHUB_REF
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
REF=${REF#refs/heads/}
echo REF: $REF
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
echo BOOST_BRANCH: $BOOST_BRANCH
cd ..
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
- name: Configure
run: |
cd ../boost-root
mkdir __build__ && cd __build__
cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DBUILD_TESTING=ON ..
- name: Build tests
run: |
cd ../boost-root/__build__
cmake --build . --target tests
- name: Run tests
run: |
cd ../boost-root/__build__
ctest --output-on-failure --no-tests=error
windows-cmake-subdir:
strategy:
fail-fast: false
matrix:
include:
- os: windows-2022
- os: windows-2025
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-2022
- os: windows-2025
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-2022
- os: windows-2025
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

View File

@@ -1,9 +1,9 @@
# Generated by `boostdep --cmake lambda2` # Generated by `boostdep --cmake lambda2`
# Copyright 2020 Peter Dimov # Copyright 2020, 2021 Peter Dimov
# Distributed under the Boost Software License, Version 1.0. # Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt # https://www.boost.org/LICENSE_1_0.txt
cmake_minimum_required(VERSION 3.5...3.16) cmake_minimum_required(VERSION 3.8...3.20)
project(boost_lambda2 VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) project(boost_lambda2 VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
@@ -12,9 +12,10 @@ add_library(Boost::lambda2 ALIAS boost_lambda2)
target_include_directories(boost_lambda2 INTERFACE include) target_include_directories(boost_lambda2 INTERFACE include)
target_compile_features(boost_lambda2 INTERFACE cxx_std_14)
if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt") if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
add_subdirectory(test) add_subdirectory(test)
endif() endif()

16
build.jam Normal file
View File

@@ -0,0 +1,16 @@
# 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 ;
project /boost/lambda2 ;
explicit
[ alias boost_lambda2 : : : : <include>include <library>$(boost_dependencies) ]
[ alias all : boost_lambda2 test ]
;
call-if : boost-library lambda2
;

View File

@@ -9,7 +9,10 @@ Peter Dimov
:toc: left :toc: left
:toclevels: 4 :toclevels: 4
:idprefix: :idprefix:
:listing-caption: Code Example
:docinfo: private-footer :docinfo: private-footer
:source-highlighter: rouge
:source-language: c++
:leveloffset: +1 :leveloffset: +1

View File

@@ -12,3 +12,5 @@ https://www.boost.org/LICENSE_1_0.txt
* Added special cases in `operator<<` and `operator>>` when * Added special cases in `operator<<` and `operator>>` when
the first argument is a stream, to allow `std::cout << _1`. the first argument is a stream, to allow `std::cout << _1`.
* Added `operator\->*`.
* Added `first`, `second`.

View File

@@ -21,14 +21,14 @@ namespace lambda2 {
template<int I> struct lambda2_arg; template<int I> struct lambda2_arg;
inline constexpr lambda2_arg<1> _1{}; inline constexpr lambda2_arg<1> _1{};
inline constexpr lambda2_arg<1> _2{}; inline constexpr lambda2_arg<2> _2{};
inline constexpr lambda2_arg<1> _3{}; inline constexpr lambda2_arg<3> _3{};
inline constexpr lambda2_arg<1> _4{}; inline constexpr lambda2_arg<4> _4{};
inline constexpr lambda2_arg<1> _5{}; inline constexpr lambda2_arg<5> _5{};
inline constexpr lambda2_arg<1> _6{}; inline constexpr lambda2_arg<6> _6{};
inline constexpr lambda2_arg<1> _7{}; inline constexpr lambda2_arg<7> _7{};
inline constexpr lambda2_arg<1> _8{}; inline constexpr lambda2_arg<8> _8{};
inline constexpr lambda2_arg<1> _9{}; inline constexpr lambda2_arg<9> _9{};
// arithmetic operators // arithmetic operators
@@ -90,6 +90,11 @@ template<class A, class B> auto operator>>=( A && a, B && b );
template<class A, class B> auto operator->*( A && a, B && b ); template<class A, class B> auto operator->*( A && a, B && b );
// projections
inline constexpr /unspecified/ first{};
inline constexpr /unspecified/ second{};
} // namespace lambda2 } // namespace lambda2
} // namespace boost } // namespace boost
``` ```
@@ -405,3 +410,26 @@ Returns: :: `std::bind( std::forward<B>(b), std::forward<A>(a) );`
Notes: :: This operator is intended to be used with "projection" function Notes: :: This operator is intended to be used with "projection" function
objects such as member pointers or member functions taking zero arguments, objects such as member pointers or member functions taking zero arguments,
as in `_1\->*&X::m` or `_1\->*&X::f`. as in `_1\->*&X::m` or `_1\->*&X::f`.
### Projections
```
inline constexpr /unspecified/ first{};
```
A function object such that `first(x)` returns `std::get<0>(x)`.
```
inline constexpr /unspecified/ second{};
```
A function object such that `second(x)` returns `std::get<1>(x)`.
.Using first and second to print out a map
```
void print( std::map<int, std::string> const & m )
{
using namespace boost::lambda2;
std::for_each( m.begin(), m.end(), std::cout << _1->*first << ": " << _1->*second << '\n' );
}
```

View File

@@ -14,7 +14,7 @@
// Same format as BOOST_VERSION: // Same format as BOOST_VERSION:
// major * 100000 + minor * 100 + patch // major * 100000 + minor * 100 + patch
#define BOOST_LAMBDA2_VERSION 107800 #define BOOST_LAMBDA2_VERSION 109100
namespace boost namespace boost
{ {
@@ -32,6 +32,14 @@ struct subscript
} }
}; };
template<int I> struct get
{
template<class T> decltype(auto) operator()( T&& t ) const
{
return std::get<I>( std::forward<T>(t) );
}
};
} // namespace lambda2_detail } // namespace lambda2_detail
// placeholders // placeholders
@@ -65,6 +73,11 @@ BOOST_LAMBDA2_INLINE_VAR constexpr lambda2_arg<7> _7{};
BOOST_LAMBDA2_INLINE_VAR constexpr lambda2_arg<8> _8{}; BOOST_LAMBDA2_INLINE_VAR constexpr lambda2_arg<8> _8{};
BOOST_LAMBDA2_INLINE_VAR constexpr lambda2_arg<9> _9{}; BOOST_LAMBDA2_INLINE_VAR constexpr lambda2_arg<9> _9{};
// first, second
BOOST_LAMBDA2_INLINE_VAR constexpr lambda2_detail::get<0> first{};
BOOST_LAMBDA2_INLINE_VAR constexpr lambda2_detail::get<1> second{};
#undef BOOST_LAMBDA2_INLINE_VAR #undef BOOST_LAMBDA2_INLINE_VAR
} // namespace lambda2 } // namespace lambda2

View File

@@ -10,5 +10,6 @@
"description": "A C++14 lambda library.", "description": "A C++14 lambda library.",
"category": [ "category": [
"Function-objects" "Function-objects"
] ],
"cxxstd": "14"
} }

11
test/CMakeLists.txt Normal file
View File

@@ -0,0 +1,11 @@
# Copyright 2018, 2019 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
include(BoostTestJamfile OPTIONAL RESULT_VARIABLE HAVE_BOOST_TEST)
if(HAVE_BOOST_TEST)
boost_test_jamfile(FILE Jamfile LINK_LIBRARIES Boost::lambda2 Boost::core)
endif()

View File

@@ -2,10 +2,15 @@
# Distributed under the Boost Software License, Version 1.0. # Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt # https://www.boost.org/LICENSE_1_0.txt
import-search /boost/config/checks ;
import testing ; import testing ;
import ../../config/checks/config : requires ; import config : requires ;
project : requirements project : requirements
<library>/boost/lambda2//boost_lambda2
<library>/boost/config//boost_config
<library>/boost/core//boost_core
<warnings>extra <warnings>extra
@@ -13,7 +18,8 @@ project : requirements
<toolset>msvc:<warnings-as-errors>on <toolset>msvc:<warnings-as-errors>on
<toolset>clang:<warnings-as-errors>on <toolset>clang:<warnings-as-errors>on
<toolset>gcc:<warnings-as-errors>on ; <toolset>gcc:<warnings-as-errors>on
;
run quick.cpp ; run quick.cpp ;
run lambda2_test.cpp ; run lambda2_test.cpp ;

View File

@@ -0,0 +1,17 @@
# Copyright 2018, 2019 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
cmake_minimum_required(VERSION 3.5...3.16)
project(cmake_install_test LANGUAGES CXX)
find_package(boost_lambda2 REQUIRED)
add_executable(quick ../quick.cpp)
target_link_libraries(quick Boost::lambda2)
enable_testing()
add_test(quick quick)
add_custom_target(check VERBATIM COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)

View File

@@ -0,0 +1,17 @@
# Copyright 2018, 2019 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
cmake_minimum_required(VERSION 3.5...3.16)
project(cmake_subdir_test LANGUAGES CXX)
add_subdirectory(../.. boostorg/lambda2)
add_executable(quick ../quick.cpp)
target_link_libraries(quick Boost::lambda2)
enable_testing()
add_test(quick quick)
add_custom_target(check VERBATIM COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)

View File

@@ -63,6 +63,16 @@ int main()
BOOST_TEST_EQ( (_1->*&std::pair<int, int>::first)( x ), 1 ); BOOST_TEST_EQ( (_1->*&std::pair<int, int>::first)( x ), 1 );
BOOST_TEST_EQ( (_1->*&std::pair<int, int>::second)( x ), 2 ); BOOST_TEST_EQ( (_1->*&std::pair<int, int>::second)( x ), 2 );
#if defined(_LIBCPP_VERSION)
// https://bugs.llvm.org/show_bug.cgi?id=51753
using std::placeholders::_1;
#endif
BOOST_TEST_EQ( (_1->*first)( x ), 1 );
BOOST_TEST_EQ( (_1->*second)( x ), 2 );
} }
return boost::report_errors(); return boost::report_errors();

View File

@@ -1,15 +1,11 @@
// Copyright 2020 Peter Dimov // Copyright 2020, 2022 Peter Dimov
// Distributed under the Boost Software License, Version 1.0. // Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt // https://www.boost.org/LICENSE_1_0.txt
#include <boost/lambda2.hpp> #include <boost/lambda2.hpp>
#include <boost/core/lightweight_test.hpp>
int main() int main()
{ {
using namespace boost::lambda2; using namespace boost::lambda2;
return (_1 + _2 * _3)( 1, 2, 3) == 1 + 2 * 3? 0: 1;
BOOST_TEST_EQ( (_1 + _2 * _3)( 1, 2, 3), 1 + 2 * 3 );
return boost::report_errors();
} }