2
0
mirror of https://github.com/boostorg/lambda2.git synced 2026-01-19 16:22:20 +00:00

Compare commits

...

49 Commits

Author SHA1 Message Date
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 627 additions and 53 deletions

View File

@@ -19,88 +19,199 @@ jobs:
include:
- toolset: gcc-5
cxxstd: "03,11,14,1z"
os: ubuntu-18.04
container: ubuntu:18.04
os: ubuntu-latest
install: g++-5
- toolset: gcc-6
cxxstd: "03,11,14,1z"
os: ubuntu-18.04
container: ubuntu:18.04
os: ubuntu-latest
install: g++-6
- toolset: gcc-7
cxxstd: "03,11,14,17"
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-18.04
container: ubuntu:20.04
os: ubuntu-latest
install: g++-10
- toolset: gcc-11
cxxstd: "03,11,14,17,2a"
os: ubuntu-18.04
install: g++-11
os: ubuntu-22.04
- 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: 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
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,2a"
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
cxxstd: "03,11,14,17,2a"
os: macos-10.15
compiler: clang++-13
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
cxxstd: "03,11,14,17,20,2b"
os: macos-13
- toolset: clang
cxxstd: "03,11,14,17,20,2b"
os: macos-14
- toolset: clang
cxxstd: "03,11,14,17,20,2b"
os: macos-15
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@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
if: matrix.install
run: sudo apt install ${{matrix.install}}
run: sudo apt-get -y install ${{matrix.install}}
- name: Setup Boost
run: |
@@ -120,7 +231,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
@@ -139,23 +250,23 @@ jobs:
fail-fast: false
matrix:
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"
addrmd: 32,64
os: windows-2016
- toolset: msvc-14.2
cxxstd: "14,17,latest"
addrmd: 32,64
os: windows-2019
os: windows-2022
- toolset: gcc
cxxstd: "03,11,14,17,2a"
addrmd: 64
os: windows-2019
os: windows-2022
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup Boost
shell: cmd
@@ -183,4 +294,346 @@ jobs:
shell: cmd
run: |
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-13
- os: macos-14
- os: macos-15
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-13
- os: macos-14
- os: macos-15
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-13
- os: macos-14
- os: macos-15
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`
# Copyright 2020 Peter Dimov
# Copyright 2020, 2021 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# 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)
@@ -12,9 +12,10 @@ add_library(Boost::lambda2 ALIAS boost_lambda2)
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")
add_subdirectory(test)
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
:toclevels: 4
:idprefix:
:listing-caption: Code Example
:docinfo: private-footer
:source-highlighter: rouge
:source-language: c++
:leveloffset: +1

View File

@@ -12,3 +12,5 @@ https://www.boost.org/LICENSE_1_0.txt
* Added special cases in `operator<<` and `operator>>` when
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;
inline constexpr lambda2_arg<1> _1{};
inline constexpr lambda2_arg<1> _2{};
inline constexpr lambda2_arg<1> _3{};
inline constexpr lambda2_arg<1> _4{};
inline constexpr lambda2_arg<1> _5{};
inline constexpr lambda2_arg<1> _6{};
inline constexpr lambda2_arg<1> _7{};
inline constexpr lambda2_arg<1> _8{};
inline constexpr lambda2_arg<1> _9{};
inline constexpr lambda2_arg<2> _2{};
inline constexpr lambda2_arg<3> _3{};
inline constexpr lambda2_arg<4> _4{};
inline constexpr lambda2_arg<5> _5{};
inline constexpr lambda2_arg<6> _6{};
inline constexpr lambda2_arg<7> _7{};
inline constexpr lambda2_arg<8> _8{};
inline constexpr lambda2_arg<9> _9{};
// 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 );
// projections
inline constexpr /unspecified/ first{};
inline constexpr /unspecified/ second{};
} // namespace lambda2
} // 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
objects such as member pointers or member functions taking zero arguments,
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:
// major * 100000 + minor * 100 + patch
#define BOOST_LAMBDA2_VERSION 107800
#define BOOST_LAMBDA2_VERSION 109000
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
// 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<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
} // namespace lambda2

View File

@@ -10,5 +10,6 @@
"description": "A C++14 lambda library.",
"category": [
"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.
# https://www.boost.org/LICENSE_1_0.txt
import-search /boost/config/checks ;
import testing ;
import ../../config/checks/config : requires ;
import config : requires ;
project : requirements
<library>/boost/lambda2//boost_lambda2
<library>/boost/config//boost_config
<library>/boost/core//boost_core
<warnings>extra
@@ -13,7 +18,8 @@ project : requirements
<toolset>msvc:<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 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>::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();

View File

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