Compare commits

...

23 Commits

Author SHA1 Message Date
6fba35ace5 Regenerate CMakeLists.txt 2024-09-18 18:18:26 +03:00
68d6dbea89 Add test/CMakeLists.txt 2024-09-18 18:14:18 +03:00
174e8855ca Disable _ccs tests on clang-cl 32 bit 2024-09-18 18:12:30 +03:00
1d88010ae0 Update test/Jamfile 2024-09-18 18:09:07 +03:00
b8acb9aae8 Remove GCC 4.7 from ci.yml 2024-09-18 18:04:16 +03:00
9a89d9184d Update build.jam 2024-09-18 18:03:39 +03:00
e7b9acf2f3 Merge branch 'modular' of https://github.com/grafikrobot/boostorg.function_types into feature/modular-b2 2024-09-18 17:56:58 +03:00
cdef91bff7 Disable _ccs tests when _M_IX86 isn't defined (MSVC 32 bit) 2024-09-18 17:53:14 +03:00
6403460e99 Update example/fast_mem_fn_example.cpp 2024-09-18 17:39:56 +03:00
71cc514bc9 Add .github/workflows/ci.yml 2024-09-18 17:16:38 +03:00
57b36d9810 Update build deps. 2024-08-03 12:08:46 -05:00
60bfa72618 Move inter-lib dependencies to a project variable and into the build targets. 2024-07-23 22:34:23 -05:00
2d31274929 Update copyright dates. 2024-07-20 22:52:04 -05:00
a96648bffd Bump B2 require to 5.2 2024-06-14 11:33:55 -05:00
51a1f7df12 Add requires-b2 check to top-level build file. 2024-05-05 09:00:01 -05:00
d0d3b742c7 Switch to library requirements instead of source. As source puts extra source in install targets. 2024-03-29 21:15:58 -05:00
937c7bb75c Make the library modular usable. 2024-03-11 08:38:17 -05:00
895335874d Update CMakeLists.txt 2021-06-10 01:02:01 +03:00
f285a08088 Add "cxxstd" json field. The "cxxstd" json field is being added to each Boost library's meta json information for libraries whose minumum C++ standard compilation level is C++11 on up. The value of this field matches one of the values for 'cxxstd' in Boost.Build. The purpose of doing this is to provide information for the Boost website documentation for each library which will specify the minimum C++ standard compilation that an end-user must employ in order to use the particular library. This will aid end-users who want to know if they can successfully use a Boost library based on their C++ compiler's compilation level, without having to search the library's documentation to find this out. 2021-01-11 11:26:46 -05:00
9dc87ec137 VC++ 10 and VC++ 11 are only supported for 32 bits in Appveyor 2020-11-24 16:00:31 -05:00
95997705ed Merge pull request #10 from eldiener/develop
Changes for Embarcadero C++ clang-based compilers, targeting Boost 1.74. Change __BORLANDC__ to BOOST_BORLANDC, which is defined in Boost conf…
2020-04-17 11:09:22 -04:00
72ccfa3b96 Updated Appveyor configuration 2020-04-17 09:51:46 -04:00
867588b91e Change __BORLANDC__ to BOOST_BORLANDC, which is defined in Boost config for the Embarcadero non-clang-based compilers. 2020-03-30 16:55:12 -04:00
22 changed files with 951 additions and 107 deletions

640
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,640 @@
name: CI
on:
pull_request:
push:
branches:
- master
- develop
- feature/**
env:
UBSAN_OPTIONS: print_stacktrace=1
jobs:
posix:
strategy:
fail-fast: false
matrix:
include:
- toolset: gcc-4.8
cxxstd: "11"
container: ubuntu:16.04
os: ubuntu-latest
install: g++-4.8-multilib
address-model: 32,64
- toolset: gcc-4.9
cxxstd: "11"
container: ubuntu:16.04
os: ubuntu-latest
install: g++-4.9-multilib
address-model: 32,64
- toolset: gcc-5
cxxstd: "11,14,1z"
container: ubuntu:18.04
os: ubuntu-latest
install: g++-5-multilib
address-model: 32,64
- toolset: gcc-6
cxxstd: "11,14,1z"
container: ubuntu:18.04
os: ubuntu-latest
install: g++-6-multilib
address-model: 32,64
- toolset: gcc-7
cxxstd: "11,14,17"
os: ubuntu-20.04
install: g++-7-multilib
address-model: 32,64
- toolset: gcc-8
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
install: g++-8-multilib
address-model: 32,64
- toolset: gcc-9
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
install: g++-9-multilib
address-model: 32,64
- toolset: gcc-10
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
install: g++-10-multilib
address-model: 32,64
- toolset: gcc-11
cxxstd: "11,14,17,20,2b"
os: ubuntu-22.04
install: g++-11-multilib
address-model: 32,64
- toolset: gcc-12
cxxstd: "11,14,17,20,2b"
os: ubuntu-22.04
install: g++-12-multilib
address-model: 32,64
- toolset: gcc-13
cxxstd: "11,14,17,20,2b"
container: ubuntu:23.04
os: ubuntu-latest
install: g++-13-multilib
address-model: 32,64
- toolset: gcc-14
cxxstd: "11,14,17,20,2b"
container: ubuntu:24.04
os: ubuntu-latest
install: g++-14-multilib
address-model: 32,64
- toolset: clang
compiler: clang++-3.9
cxxstd: "11,14"
container: ubuntu:18.04
os: ubuntu-latest
install: clang-3.9
- toolset: clang
compiler: clang++-4.0
cxxstd: "11,14"
container: ubuntu:18.04
os: ubuntu-latest
install: clang-4.0
- toolset: clang
compiler: clang++-5.0
cxxstd: "11,14,1z"
container: ubuntu:18.04
os: ubuntu-latest
install: clang-5.0
- toolset: clang
compiler: clang++-6.0
cxxstd: "11,14,17"
os: ubuntu-20.04
install: clang-6.0
- toolset: clang
compiler: clang++-7
cxxstd: "11,14,17"
os: ubuntu-20.04
install: clang-7
- toolset: clang
compiler: clang++-8
cxxstd: "11,14,17"
os: ubuntu-20.04
install: clang-8
- toolset: clang
compiler: clang++-9
cxxstd: "11,14,17"
os: ubuntu-20.04
install: clang-9
- toolset: clang
compiler: clang++-10
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
- toolset: clang
compiler: clang++-11
cxxstd: "11,14,17,2a"
os: ubuntu-20.04
- toolset: clang
compiler: clang++-12
cxxstd: "11,14,17,20"
os: ubuntu-20.04
- toolset: clang
compiler: clang++-13
cxxstd: "11,14,17,20"
container: ubuntu:22.04
os: ubuntu-latest
install: clang-13
- toolset: clang
compiler: clang++-14
cxxstd: "11,14,17,20,2b"
container: ubuntu:22.04
os: ubuntu-latest
install: clang-14
- toolset: clang
compiler: clang++-15
cxxstd: "11,14,17,20,2b"
container: ubuntu:22.04
os: ubuntu-latest
install: clang-15
- toolset: clang
compiler: clang++-16
cxxstd: "11,14,17,20,2b"
container: ubuntu:23.04
os: ubuntu-latest
install: clang-16
- toolset: clang
compiler: clang++-17
cxxstd: "11,14,17,20,2b"
container: ubuntu:23.10
os: ubuntu-latest
install: clang-17
- toolset: clang
compiler: clang++-18
cxxstd: "11,14,17,20,2b"
container: ubuntu:24.04
os: ubuntu-latest
install: clang-18
- toolset: clang
cxxstd: "11,14,17,20,2b"
os: macos-12
- toolset: clang
cxxstd: "11,14,17,20,2b"
os: macos-13
- toolset: clang
cxxstd: "11,14,17,20,2b"
os: macos-14
runs-on: ${{matrix.os}}
container: ${{matrix.container}}
defaults:
run:
shell: bash
steps:
- name: Enable Node 16
run: |
echo "ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true" >> $GITHUB_ENV
- uses: actions/checkout@v3
- name: Setup container environment
if: matrix.container
run: |
apt-get update
apt-get -y install sudo python3 git g++
- name: Install packages
if: matrix.install
run: |
sudo apt-get update
sudo apt-get -y 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
python3 tools/boostdep/depinst/depinst.py -I example $LIBRARY
./bootstrap.sh
./b2 -d0 headers
- name: Create user-config.jam
if: matrix.compiler
run: |
echo "using ${{matrix.toolset}} : : ${{matrix.compiler}} ;" > ~/user-config.jam
- name: Run tests
run: |
cd ../boost-root
export ADDRMD=${{matrix.address-model}}
./b2 -j3 libs/$LIBRARY/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} ${ADDRMD:+address-model=$ADDRMD} variant=debug,release
windows:
strategy:
fail-fast: false
matrix:
include:
- toolset: msvc-14.0
cxxstd: 14,latest
addrmd: 32,64
os: windows-2019
- toolset: msvc-14.2
cxxstd: "14,17,20,latest"
addrmd: 32,64
os: windows-2019
- toolset: msvc-14.3
cxxstd: "14,17,20,latest"
addrmd: 32,64
os: windows-2022
- toolset: clang-win
cxxstd: "14,17,latest"
addrmd: 32,64
os: windows-2022
- toolset: gcc
cxxstd: "11,14,17,2a"
addrmd: 64
os: windows-2019
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" -I example %LIBRARY%
cmd /c bootstrap
b2 -d0 headers
- name: Run tests
shell: cmd
run: |
cd ../boost-root
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-20.04
- os: ubuntu-22.04
- os: macos-12
- os: macos-13
- os: macos-14
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Install packages
if: matrix.install
run: sudo apt-get -y 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-20.04
- os: ubuntu-22.04
- os: macos-12
- os: macos-13
- os: macos-14
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Install packages
if: matrix.install
run: sudo apt-get -y 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-20.04
- os: ubuntu-22.04
- os: macos-12
- os: macos-13
- os: macos-14
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Install packages
if: matrix.install
run: sudo apt-get -y 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-2019
- os: windows-2022
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-2019
- os: windows-2022
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-2019
- os: windows-2022
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,25 +1,29 @@
# Copyright 2019 Mike Dev
# Generated by `boostdep --cmake function_types`
# Copyright 2020, 2021 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
#
# NOTE: CMake support for Boost.FunctionTypes is currently experimental at best
# and the interface is likely to change in the future
# https://www.boost.org/LICENSE_1_0.txt
cmake_minimum_required( VERSION 3.5 )
project( BoostFunctionTypes LANGUAGES CXX )
cmake_minimum_required(VERSION 3.5...3.20)
add_library( boost_function_types INTERFACE )
add_library( Boost::function_types ALIAS boost_function_types )
project(boost_function_types VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
target_include_directories( boost_function_types INTERFACE include )
add_library(boost_function_types INTERFACE)
add_library(Boost::function_types ALIAS boost_function_types)
target_link_libraries( boost_function_types
INTERFACE
Boost::config
Boost::core
Boost::detail
Boost::mpl
Boost::preprocessor
Boost::type_traits
target_include_directories(boost_function_types INTERFACE include)
target_link_libraries(boost_function_types
INTERFACE
Boost::config
Boost::core
Boost::detail
Boost::mpl
Boost::preprocessor
Boost::type_traits
)
if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
add_subdirectory(test)
endif()

View File

@ -14,9 +14,19 @@ branches:
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0,msvc-12.0,msvc-14.0
TOOLSET: msvc-10.0,msvc-11.0
ADDRMD: 32
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
TOOLSET: msvc-12.0,msvc-14.0
ADDRESS_MODEL: 32,64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
TOOLSET: msvc-14.1
CXXSTD: 14,17
ADDRESS_MODEL: 32,64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
TOOLSET: msvc-14.2
CXXSTD: 14,17
ADDRESS_MODEL: 32,64
install:
- cd ..

25
build.jam Normal file
View File

@ -0,0 +1,25 @@
# Copyright 2023-2024 René Ferdinand Rivera Morell
# Copyright 2024 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt
require-b2 5.2 ;
constant boost_dependencies :
/boost/config//boost_config
/boost/core//boost_core
/boost/detail//boost_detail
/boost/mpl//boost_mpl
/boost/preprocessor//boost_preprocessor
/boost/type_traits//boost_type_traits
;
project /boost/function_types ;
explicit
[ alias boost_function_types : : : : <include>include <library>$(boost_dependencies) ]
[ alias all : boost_function_types example test ]
;
call-if : boost-library function_types
;

View File

@ -1,19 +1,27 @@
# (C) Copyright Tobias Schwinger
# (C) Copyright Tobias Schwinger
#
# Use, modification and distribution are subject to the Boost Software License,
# Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).
#-------------------------------------------------------------------------------
exe interpreter_example : interpreter_example.cpp ;
project : requirements <library>/boost/function_types//boost_function_types ;
exe interpreter_example : interpreter_example.cpp
: <library>/boost/tokenizer//boost_tokenizer
<library>/boost/lexical_cast//boost_lexical_cast
;
exe result_of_example : result_of_example.cpp ;
exe interface_example : interface_example.cpp ;
exe fast_mem_fn_example : fast_mem_fn_example.cpp
: <include>. ; # needed for Boost.PP file iteration with some compilers
exe fast_mem_fn_example : fast_mem_fn_example.cpp
: <include>. # needed for Boost.PP file iteration with some compilers
<library>/boost/timer//boost_timer
<library>/boost/bind//boost_bind
;
exe macro_type_args_example : macro_type_args_example.cpp ;

View File

@ -13,7 +13,7 @@
#include <algorithm>
#include <functional>
#include <boost/timer.hpp>
#include <boost/timer/timer.hpp>
#include <boost/mem_fn.hpp>
#include "fast_mem_fn.hpp"
@ -91,28 +91,28 @@ template<typename F> void do_test(test_vector & v, F criterion)
int main()
{
test_vector v;
boost::timer t;
boost::timer::cpu_timer t;
double time1, time2;
std::cout <<
"Test case: sorting " << N << " objects.\n\n"
"Criterion accessor called with | elasped seconds\n"
"Criterion accessor called with | elapsed seconds\n"
"-------------------------------|----------------" << std::endl;
setup_test(v);
t.restart();
t.start();
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1400)
do_test(v, BOOST_EXAMPLE_FAST_MEM_FN(& test::id));
#else // MSVC<8 does not like the implementation of the deduction macro:
do_test(v, ::example::fast_mem_fn< int (test::*)() const, & test::id >());
#endif
time1 = t.elapsed();
time1 = t.elapsed().wall * 1e-9;
std::cout << "fast_mem_fn | " << time1 << std::endl;
setup_test(v);
t.restart();
t.start();
do_test(v, boost::mem_fn(& test::id));
time2 = t.elapsed();
time2 = t.elapsed().wall * 1e-9;
std::cout << "mem_fn | " << time2 << std::endl;
std::cout << '\n' << (time2/time1-1)*100 << "% speedup" << std::endl;

View File

@ -57,7 +57,7 @@ namespace example
typedef typename F::template result<Desc>::type type;
};
#if !BOOST_WORKAROUND(__BORLANDC__,BOOST_TESTED_AT(0x564))
#if !BOOST_WORKAROUND(BOOST_BORLANDC,BOOST_TESTED_AT(0x564))
template<typename F>
struct result_member_template< F, F(void) >
{

View File

@ -22,7 +22,7 @@
#include <boost/mpl/integral_c.hpp>
#include <boost/mpl/vector/vector0.hpp>
#if BOOST_WORKAROUND(__BORLANDC__, <= 0x565)
#if BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x565)
# include <boost/type_traits/remove_cv.hpp>
# include <boost/mpl/identity.hpp>
@ -76,14 +76,14 @@ namespace boost
namespace detail
{
template<typename T, typename L> struct components_impl;
#if BOOST_WORKAROUND(__BORLANDC__, <= 0x565)
#if BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x565)
template<typename T, typename OrigT, typename L> struct components_bcc;
#endif
}
template<typename T, typename ClassTypeTransform>
struct components
#if !BOOST_WORKAROUND(__BORLANDC__, <= 0x565)
#if !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x565)
: detail::components_impl<T, ClassTypeTransform>
#else
: detail::components_bcc<typename remove_cv<T>::type,T,
@ -255,7 +255,7 @@ namespace boost
typename detail::class_transform<C,L>::type > types;
};
#if !BOOST_WORKAROUND(__BORLANDC__, <= 0x565)
#if !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x565)
# define BOOST_FT_variations BOOST_FT_pointer|BOOST_FT_member_pointer
template<typename T, class C, typename L>

View File

@ -91,11 +91,11 @@
# define __fastcall __attribute__((__fastcall__))
# endif
#elif defined(__BORLANDC__)
#elif defined(BOOST_BORLANDC)
# if __BORLANDC__ < 0x550
# if BOOST_BORLANDC < 0x550
# error "unsupported compiler version"
# elif __BORLANDC__ > 0x565
# elif BOOST_BORLANDC > 0x565
# pragma message("WARNING: library untested with this compiler version")
# endif

View File

@ -30,7 +30,7 @@ template<bits_t Flags, bits_t CCID, std::size_t Arity> struct encode_charr
>::type type;
};
#if defined(BOOST_MSVC) || (defined(__BORLANDC__) && !defined(BOOST_DISABLE_WIN32))
#if defined(BOOST_MSVC) || (defined(BOOST_BORLANDC) && !defined(BOOST_DISABLE_WIN32))
# define BOOST_FT_DECL __cdecl
#else
# define BOOST_FT_DECL /**/

View File

@ -12,7 +12,7 @@
#include <cstddef>
#include <boost/detail/workaround.hpp>
#if BOOST_WORKAROUND(__BORLANDC__, <= 0x582)
#if BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x582)
# include <boost/type_traits/remove_cv.hpp>
# include <boost/type_traits/remove_pointer.hpp>
# include <boost/type_traits/remove_reference.hpp>
@ -22,7 +22,7 @@
namespace boost { namespace function_types { namespace detail {
#if !BOOST_WORKAROUND(__BORLANDC__, <= 0x582)
#if !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x582)
template<typename T> struct cv_traits
{ typedef non_cv tag; typedef T type; };

View File

@ -11,5 +11,6 @@
],
"maintainers": [
"Tobias Schwinger <tschwinger -at- isonews2.com>"
]
],
"cxxstd": "03"
}

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::function_types Boost::core)
endif()

View File

@ -1,5 +1,5 @@
# (C) Copyright Tobias Schwinger
# (C) Copyright Tobias Schwinger
#
# Use, modification and distribution are subject to the Boost Software License,
# Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).
@ -8,82 +8,78 @@
import testing ;
{
test-suite function_types :
project : requirements <library>/boost/function_types//boost_function_types ;
# Classification
# Classification
[ compile classification/is_function.cpp ]
[ compile classification/is_function_pointer.cpp ]
[ compile classification/is_function_reference.cpp ]
[ compile classification/is_member_function_pointer.cpp ]
[ compile classification/is_member_object_pointer.cpp ]
[ compile classification/is_callable_builtin.cpp ]
[ compile classification/is_nonmember_callable_builtin.cpp ]
[ compile classification/is_member_pointer.cpp ]
compile classification/is_function.cpp ;
compile classification/is_function_pointer.cpp ;
compile classification/is_function_reference.cpp ;
compile classification/is_member_function_pointer.cpp ;
compile classification/is_member_object_pointer.cpp ;
compile classification/is_callable_builtin.cpp ;
compile classification/is_nonmember_callable_builtin.cpp ;
compile classification/is_member_pointer.cpp ;
[ compile classification/is_cv_mem_func_ptr.cpp ]
[ compile classification/is_variadic.cpp ]
[ compile classification/is_cv_pointer.cpp ]
# [ compile classification/is_cv_function.cpp ]
compile classification/is_cv_mem_func_ptr.cpp ;
compile classification/is_variadic.cpp ;
compile classification/is_cv_pointer.cpp ;
# compile classification/is_cv_function.cpp ;
# Decomposition
[ compile decomposition/components.cpp ]
[ compile decomposition/result_type.cpp ]
[ compile decomposition/function_arity.cpp ]
[ compile decomposition/parameter_types.cpp ]
# Decomposition
[ compile decomposition/components_seq.cpp ]
[ compile decomposition/class_type_transform.cpp ]
compile decomposition/components.cpp ;
compile decomposition/result_type.cpp ;
compile decomposition/function_arity.cpp ;
compile decomposition/parameter_types.cpp ;
[ compile-fail decomposition/result_type_fail.cpp ]
[ compile-fail decomposition/parameter_types_fail.cpp ]
[ compile-fail decomposition/function_arity_fail.cpp ]
compile decomposition/components_seq.cpp ;
compile decomposition/class_type_transform.cpp ;
# Synthesis
compile-fail decomposition/result_type_fail.cpp ;
compile-fail decomposition/parameter_types_fail.cpp ;
compile-fail decomposition/function_arity_fail.cpp ;
[ compile synthesis/function_type.cpp ]
[ compile synthesis/function_pointer.cpp ]
[ compile synthesis/function_reference.cpp ]
[ compile synthesis/member_function_pointer.cpp ]
[ compile synthesis/member_object_pointer.cpp ]
# Synthesis
[ compile synthesis/transformation.cpp ]
[ compile synthesis/mem_func_ptr_cv1.cpp ]
[ compile synthesis/mem_func_ptr_cv2.cpp ]
[ compile synthesis/mem_func_ptr_cv_ptr_to_this.cpp ]
[ compile synthesis/variadic_function_synthesis.cpp ]
# [ compile synthesis/cv_function_synthesis.cpp ]
compile synthesis/function_type.cpp ;
compile synthesis/function_pointer.cpp ;
compile synthesis/function_reference.cpp ;
compile synthesis/member_function_pointer.cpp ;
compile synthesis/member_object_pointer.cpp ;
# Reconfiguration
compile synthesis/transformation.cpp ;
compile synthesis/mem_func_ptr_cv1.cpp ;
compile synthesis/mem_func_ptr_cv2.cpp ;
compile synthesis/mem_func_ptr_cv_ptr_to_this.cpp ;
compile synthesis/variadic_function_synthesis.cpp ;
# compile synthesis/cv_function_synthesis.cpp ;
[ compile reconfiguration/preprocessing_mode.cpp ]
[ compile reconfiguration/partial_arity_preprocessing.cpp ]
[ compile reconfiguration/cc_preprocessing.cpp ]
# Reconfiguration
# Custom calling conventions
compile reconfiguration/preprocessing_mode.cpp ;
compile reconfiguration/partial_arity_preprocessing.cpp ;
compile reconfiguration/cc_preprocessing.cpp ;
[ compile custom_ccs/nonmember_ccs.cpp : <address-model>64:<build>no ]
[ compile custom_ccs/nonmember_ccs_exact.cpp : <address-model>64:<build>no ]
[ compile custom_ccs/member_ccs.cpp : <address-model>64:<build>no ]
[ compile custom_ccs/member_ccs_exact.cpp : <address-model>64:<build>no ]
# Custom calling conventions
# Property tag
[ compile custom_ccs/property_tag.cpp ]
# Code from the examples
compile custom_ccs/nonmember_ccs.cpp ;
compile custom_ccs/nonmember_ccs_exact.cpp ;
compile custom_ccs/member_ccs.cpp ;
compile custom_ccs/member_ccs_exact.cpp ;
[ compile ../example/interpreter_example.cpp ]
[ compile ../example/result_of_example.cpp ]
[ compile ../example/interface_example.cpp ]
[ compile ../example/fast_mem_fn_example.cpp
# needed for Boost.PP file iteration with some compilers
: <include>../example
]
[ compile ../example/macro_type_args_example.cpp ]
;
}
# Property tag
compile custom_ccs/property_tag.cpp ;
# Code from the examples
compile ../example/interpreter_example.cpp : <library>/boost/tokenizer//boost_tokenizer <library>/boost/lexical_cast//boost_lexical_cast ;
compile ../example/result_of_example.cpp ;
compile ../example/interface_example.cpp ;
compile ../example/fast_mem_fn_example.cpp : <library>/boost/timer//boost_timer <library>/boost/bind//boost_bind
# needed for Boost.PP file iteration with some compilers
<include>../example ;
compile ../example/macro_type_args_example.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_function_types REQUIRED)
add_executable(main main.cpp)
target_link_libraries(main Boost::function_types)
enable_testing()
add_test(main main)
add_custom_target(check VERBATIM COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)

View File

@ -0,0 +1,14 @@
// Copyright 2017, 2021 Peter Dimov.
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/function_types/function_arity.hpp>
#include <cassert>
#define BOOST_TEST(expr) assert(expr)
#define BOOST_TEST_EQ(x1, x2) assert((x1)==(x2))
int main()
{
BOOST_TEST_EQ( boost::function_types::function_arity<void(int, int)>::value, 2 );
}

View File

@ -0,0 +1,46 @@
# 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.20)
project(cmake_subdir_test LANGUAGES CXX)
add_subdirectory(../.. boostorg/function_types)
set(deps
# Primary dependencies
config
core
detail
mpl
preprocessor
type_traits
# Secondary dependencies
assert
static_assert
throw_exception
predef
utility
io
)
foreach(dep IN LISTS deps)
add_subdirectory(../../../${dep} boostorg/${dep})
endforeach()
# --target check
add_executable(main main.cpp)
target_link_libraries(main Boost::function_types)
enable_testing()
add_test(main main)
add_custom_target(check VERBATIM COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)

View File

@ -0,0 +1,14 @@
// Copyright 2017, 2021 Peter Dimov.
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/function_types/function_arity.hpp>
#include <cassert>
#define BOOST_TEST(expr) assert(expr)
#define BOOST_TEST_EQ(x1, x2) assert((x1)==(x2))
int main()
{
BOOST_TEST_EQ( boost::function_types::function_arity<void(int, int)>::value, 2 );
}

View File

@ -6,6 +6,20 @@
//------------------------------------------------------------------------------
#if !defined(_M_IX86)
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE("Test skipped because _M_IX86 is not defined")
#elif defined(__clang__)
// Clang-cl 32 bit supports __stdcall, but BOOST_FT_CC_STDCALL isn't defined so the test errors out
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE("Test skipped because _M_IX86 is defined, but __clang__ is also defined")
#else
#define BOOST_FT_AUTODETECT_CALLING_CONVENTIONS
#include <boost/mpl/assert.hpp>
@ -48,3 +62,4 @@ BOOST_MPL_ASSERT((
>
));
#endif

View File

@ -6,6 +6,20 @@
//------------------------------------------------------------------------------
#if !defined(_M_IX86)
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE("Test skipped because _M_IX86 is not defined")
#elif defined(__clang__)
// Clang-cl 32 bit supports __stdcall, but BOOST_FT_CC_STDCALL isn't defined so the test errors out
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE("Test skipped because _M_IX86 is defined, but __clang__ is also defined")
#else
#define BOOST_FT_AUTODETECT_CALLING_CONVENTIONS
#include <boost/mpl/assert.hpp>
@ -69,3 +83,4 @@ BOOST_MPL_ASSERT_NOT((
ft::is_callable_builtin< ft::member_function_pointer<mpl::vector<int, C &>, cc>::type, dc >
));
#endif

View File

@ -6,6 +6,20 @@
//------------------------------------------------------------------------------
#if !defined(_M_IX86)
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE("Test skipped because _M_IX86 is not defined")
#elif defined(__clang__)
// Clang-cl 32 bit supports __stdcall, but BOOST_FT_CC_STDCALL isn't defined so the test errors out
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE("Test skipped because _M_IX86 is defined, but __clang__ is also defined")
#else
#define BOOST_FT_AUTODETECT_CALLING_CONVENTIONS
#include <boost/mpl/assert.hpp>
@ -43,3 +57,4 @@ BOOST_MPL_ASSERT((
>
));
#endif

View File

@ -6,6 +6,20 @@
//------------------------------------------------------------------------------
#if !defined(_M_IX86)
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE("Test skipped because _M_IX86 is not defined")
#elif defined(__clang__)
// Clang-cl 32 bit supports __stdcall, but BOOST_FT_CC_STDCALL isn't defined so the test errors out
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE("Test skipped because _M_IX86 is defined, but __clang__ is also defined")
#else
#define BOOST_FT_AUTODETECT_CALLING_CONVENTIONS
#include <boost/mpl/assert.hpp>
@ -58,5 +72,4 @@ BOOST_MPL_ASSERT_NOT((
ft::is_callable_builtin< ft::function_pointer<mpl::vector<void> >::type, cc >
));
#endif