mirror of
https://github.com/boostorg/bind.git
synced 2026-04-18 15:38:38 +02:00
Compare commits
24 Commits
feature/cm
...
boost-1.77
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
34a3ee580c | ||
|
|
ebc0c07e96 | ||
|
|
12e2ca325d | ||
|
|
1e3efb361b | ||
|
|
bb50844171 | ||
|
|
ee25007a9f | ||
|
|
c85b31e3d2 | ||
|
|
6c84518748 | ||
|
|
725fc8f73f | ||
|
|
a373d662b4 | ||
|
|
df4e0530e8 | ||
|
|
dbd3d09ede | ||
|
|
f50f42aae9 | ||
|
|
d67c22ff44 | ||
|
|
e41ba84da8 | ||
|
|
9ce9a7ce99 | ||
|
|
1aac698358 | ||
|
|
3cbcd02965 | ||
|
|
8cea63f1c9 | ||
|
|
b601e8924d | ||
|
|
c4fc8e5065 | ||
|
|
ba0ca52695 | ||
|
|
24242b037f | ||
|
|
5340508c16 |
208
.github/workflows/ci.yml
vendored
Normal file
208
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,208 @@
|
|||||||
|
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.7
|
||||||
|
cxxstd: "03,11"
|
||||||
|
os: ubuntu-16.04
|
||||||
|
install: g++-4.7
|
||||||
|
- toolset: gcc-4.8
|
||||||
|
cxxstd: "03,11"
|
||||||
|
os: ubuntu-16.04
|
||||||
|
install: g++-4.8
|
||||||
|
- toolset: gcc-4.9
|
||||||
|
cxxstd: "03,11"
|
||||||
|
os: ubuntu-16.04
|
||||||
|
install: g++-4.9
|
||||||
|
- toolset: gcc-5
|
||||||
|
cxxstd: "03,11,14,1z"
|
||||||
|
os: ubuntu-16.04
|
||||||
|
- toolset: gcc-6
|
||||||
|
cxxstd: "03,11,14,1z"
|
||||||
|
os: ubuntu-16.04
|
||||||
|
install: g++-6
|
||||||
|
- toolset: gcc-7
|
||||||
|
cxxstd: "03,11,14,17"
|
||||||
|
os: ubuntu-18.04
|
||||||
|
- toolset: gcc-8
|
||||||
|
cxxstd: "03,11,14,17,2a"
|
||||||
|
os: ubuntu-18.04
|
||||||
|
install: g++-8
|
||||||
|
- toolset: gcc-9
|
||||||
|
cxxstd: "03,11,14,17,2a"
|
||||||
|
os: ubuntu-18.04
|
||||||
|
- toolset: gcc-10
|
||||||
|
cxxstd: "03,11,14,17,2a"
|
||||||
|
os: ubuntu-18.04
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-3.5
|
||||||
|
cxxstd: "03,11,14"
|
||||||
|
os: ubuntu-16.04
|
||||||
|
install: clang-3.5
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-3.6
|
||||||
|
cxxstd: "03,11,14"
|
||||||
|
os: ubuntu-16.04
|
||||||
|
install: clang-3.6
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-3.7
|
||||||
|
cxxstd: "03,11,14"
|
||||||
|
os: ubuntu-16.04
|
||||||
|
install: clang-3.7
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-3.8
|
||||||
|
cxxstd: "03,11,14"
|
||||||
|
os: ubuntu-16.04
|
||||||
|
install: clang-3.8
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-3.9
|
||||||
|
cxxstd: "03,11,14"
|
||||||
|
os: ubuntu-16.04
|
||||||
|
install: clang-3.9
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-4.0
|
||||||
|
cxxstd: "03,11,14"
|
||||||
|
os: ubuntu-16.04
|
||||||
|
install: clang-4.0
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-5.0
|
||||||
|
cxxstd: "03,11,14,1z"
|
||||||
|
os: ubuntu-16.04
|
||||||
|
install: clang-5.0
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-6.0
|
||||||
|
cxxstd: "03,11,14,17"
|
||||||
|
os: ubuntu-18.04
|
||||||
|
install: clang-6.0
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-7
|
||||||
|
cxxstd: "03,11,14,17"
|
||||||
|
os: ubuntu-18.04
|
||||||
|
install: clang-7
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-8
|
||||||
|
cxxstd: "03,11,14,17,2a"
|
||||||
|
os: ubuntu-20.04
|
||||||
|
install: clang-8
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-9
|
||||||
|
cxxstd: "03,11,14,17,2a"
|
||||||
|
os: ubuntu-20.04
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-10
|
||||||
|
cxxstd: "03,11,14,17,2a"
|
||||||
|
os: ubuntu-20.04
|
||||||
|
- toolset: clang
|
||||||
|
compiler: clang++-11
|
||||||
|
cxxstd: "03,11,14,17,2a"
|
||||||
|
os: ubuntu-20.04
|
||||||
|
- toolset: clang
|
||||||
|
cxxstd: "03,11,14,17,2a"
|
||||||
|
os: macos-10.15
|
||||||
|
|
||||||
|
runs-on: ${{matrix.os}}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- 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
|
||||||
|
./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
|
||||||
|
./b2 -j3 libs/$LIBRARY/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} variant=debug,release
|
||||||
|
|
||||||
|
windows:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- toolset: msvc-14.1
|
||||||
|
cxxstd: "14,17,latest"
|
||||||
|
addrmd: 32,64
|
||||||
|
os: windows-2016
|
||||||
|
- toolset: msvc-14.2
|
||||||
|
cxxstd: "14,17,latest"
|
||||||
|
addrmd: 32,64
|
||||||
|
os: windows-2019
|
||||||
|
- toolset: gcc
|
||||||
|
cxxstd: "03,11,14,17,2a"
|
||||||
|
addrmd: 64
|
||||||
|
os: windows-2019
|
||||||
|
|
||||||
|
runs-on: ${{matrix.os}}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- 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%
|
||||||
|
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
|
||||||
36
.travis.yml
36
.travis.yml
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
language: cpp
|
language: cpp
|
||||||
|
|
||||||
sudo: false
|
|
||||||
|
|
||||||
dist: xenial
|
dist: xenial
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
@@ -128,6 +126,17 @@ matrix:
|
|||||||
sources:
|
sources:
|
||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
dist: bionic
|
||||||
|
compiler: g++-10
|
||||||
|
env: TOOLSET=gcc COMPILER=g++-10 CXXSTD=03,11,14,17,2a
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- g++-10
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang++
|
compiler: clang++
|
||||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11
|
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11
|
||||||
@@ -264,6 +273,18 @@ matrix:
|
|||||||
- sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main'
|
- sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main'
|
||||||
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
|
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: clang++-10
|
||||||
|
env: TOOLSET=clang COMPILER=clang++-10 CXXSTD=03,11,14,17,2a
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- clang-10
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
- sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-10 main'
|
||||||
|
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
dist: trusty
|
dist: trusty
|
||||||
compiler: clang++-libc++
|
compiler: clang++-libc++
|
||||||
@@ -273,6 +294,15 @@ matrix:
|
|||||||
packages:
|
packages:
|
||||||
- libc++-dev
|
- libc++-dev
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
dist: bionic
|
||||||
|
compiler: clang++-libc++
|
||||||
|
env: TOOLSET=clang COMPILER=clang++-libc++ CXXSTD=03,11,14,17,2a
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- libc++-dev
|
||||||
|
|
||||||
- os: osx
|
- os: osx
|
||||||
compiler: clang++
|
compiler: clang++
|
||||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z
|
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z
|
||||||
@@ -281,7 +311,7 @@ matrix:
|
|||||||
env: CMAKE_TEST=1
|
env: CMAKE_TEST=1
|
||||||
script:
|
script:
|
||||||
- mkdir __build__ && cd __build__
|
- mkdir __build__ && cd __build__
|
||||||
- cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 -DBOOST_INCLUDE_LIBRARIES=bind ..
|
- cmake -DBOOST_ENABLE_CMAKE=1 -DBUILD_TESTING=ON -DBoost_VERBOSE=1 -DBOOST_INCLUDE_LIBRARIES=bind ..
|
||||||
- ctest --output-on-failure -R boost_bind
|
- ctest --output-on-failure -R boost_bind
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
|
|||||||
13
appveyor.yml
13
appveyor.yml
@@ -16,17 +16,18 @@ environment:
|
|||||||
matrix:
|
matrix:
|
||||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||||
TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0
|
TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0
|
||||||
|
ADDRMD: 32
|
||||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||||
TOOLSET: msvc-12.0,msvc-14.0
|
TOOLSET: msvc-12.0,msvc-14.0
|
||||||
ADDRESS_MODEL: 32,64
|
ADDRMD: 32,64
|
||||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||||
TOOLSET: msvc-14.1,clang-win
|
TOOLSET: msvc-14.1,clang-win
|
||||||
CXXSTD: 14,17
|
CXXSTD: 14,17
|
||||||
ADDRESS_MODEL: 32,64
|
ADDRMD: 32,64
|
||||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
||||||
TOOLSET: msvc-14.2
|
TOOLSET: msvc-14.2
|
||||||
CXXSTD: 14,17
|
CXXSTD: 14,17,latest
|
||||||
ADDRESS_MODEL: 32,64
|
ADDRMD: 32,64
|
||||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||||
ADDPATH: C:\cygwin\bin;
|
ADDPATH: C:\cygwin\bin;
|
||||||
TOOLSET: gcc
|
TOOLSET: gcc
|
||||||
@@ -61,5 +62,5 @@ build: off
|
|||||||
test_script:
|
test_script:
|
||||||
- PATH=%ADDPATH%%PATH%
|
- PATH=%ADDPATH%%PATH%
|
||||||
- if not "%CXXSTD%" == "" set CXXSTD=cxxstd=%CXXSTD%
|
- if not "%CXXSTD%" == "" set CXXSTD=cxxstd=%CXXSTD%
|
||||||
- if not "%ADDRESS_MODEL%" == "" set ADDRESS_MODEL=address-model=%ADDRESS_MODEL%
|
- if not "%ADDRMD%" == "" set ADDRMD=address-model=%ADDRMD%
|
||||||
- b2 -j3 libs/bind/test toolset=%TOOLSET% %CXXSTD% %ADDRESS_MODEL% variant=debug,release
|
- b2 -j3 libs/bind/test toolset=%TOOLSET% %CXXSTD% %ADDRMD% variant=debug,release
|
||||||
|
|||||||
@@ -11,6 +11,8 @@
|
|||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -18,6 +20,15 @@ template<class R> struct apply
|
|||||||
{
|
{
|
||||||
typedef R result_type;
|
typedef R result_type;
|
||||||
|
|
||||||
|
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||||
|
|
||||||
|
template<class F, class... A> result_type operator()( F&& f, A&&... a ) const
|
||||||
|
{
|
||||||
|
return static_cast<F&&>( f )( static_cast<A&&>( a )... );
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
template<class F> result_type operator()(F & f) const
|
template<class F> result_type operator()(F & f) const
|
||||||
{
|
{
|
||||||
return f();
|
return f();
|
||||||
@@ -67,6 +78,8 @@ template<class R> struct apply
|
|||||||
{
|
{
|
||||||
return f(a1, a2, a3, a4, a5, a6, a7, a8, a9);
|
return f(a1, a2, a3, a4, a5, a6, a7, a8, a9);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|||||||
@@ -27,6 +27,8 @@
|
|||||||
#include <boost/type.hpp>
|
#include <boost/type.hpp>
|
||||||
#include <boost/is_placeholder.hpp>
|
#include <boost/is_placeholder.hpp>
|
||||||
#include <boost/bind/arg.hpp>
|
#include <boost/bind/arg.hpp>
|
||||||
|
#include <boost/bind/detail/result_traits.hpp>
|
||||||
|
#include <boost/bind/std_placeholders.hpp>
|
||||||
#include <boost/detail/workaround.hpp>
|
#include <boost/detail/workaround.hpp>
|
||||||
#include <boost/visit_each.hpp>
|
#include <boost/visit_each.hpp>
|
||||||
#include <boost/core/enable_if.hpp>
|
#include <boost/core/enable_if.hpp>
|
||||||
@@ -59,29 +61,6 @@ template<class T> class weak_ptr;
|
|||||||
namespace _bi // implementation details
|
namespace _bi // implementation details
|
||||||
{
|
{
|
||||||
|
|
||||||
// result_traits
|
|
||||||
|
|
||||||
template<class R, class F> struct result_traits
|
|
||||||
{
|
|
||||||
typedef R type;
|
|
||||||
};
|
|
||||||
|
|
||||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
|
|
||||||
|
|
||||||
struct unspecified {};
|
|
||||||
|
|
||||||
template<class F> struct result_traits<unspecified, F>
|
|
||||||
{
|
|
||||||
typedef typename F::result_type type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<class F> struct result_traits< unspecified, reference_wrapper<F> >
|
|
||||||
{
|
|
||||||
typedef typename F::result_type type;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ref_compare
|
// ref_compare
|
||||||
|
|
||||||
template<class T> bool ref_compare( T const & a, T const & b, long )
|
template<class T> bool ref_compare( T const & a, T const & b, long )
|
||||||
@@ -2191,6 +2170,7 @@ template<class F, class A1, class A2, class A3, class A4, class A5, class A6, cl
|
|||||||
# undef BOOST_BIND_MF_NOEXCEPT
|
# undef BOOST_BIND_MF_NOEXCEPT
|
||||||
# define BOOST_BIND_MF_NOEXCEPT noexcept
|
# define BOOST_BIND_MF_NOEXCEPT noexcept
|
||||||
# include <boost/bind/bind_mf_cc.hpp>
|
# include <boost/bind/bind_mf_cc.hpp>
|
||||||
|
# include <boost/bind/bind_mf2_cc.hpp>
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#undef BOOST_BIND_MF_NAME
|
#undef BOOST_BIND_MF_NAME
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
template<class Rt2, class R, class T,
|
template<class Rt2, class R, class T,
|
||||||
class A1>
|
class A1>
|
||||||
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf0)<R, T>, typename _bi::list_av_1<A1>::type>
|
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf0)<R, T>, typename _bi::list_av_1<A1>::type>
|
||||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (), A1 a1)
|
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) () BOOST_BIND_MF_NOEXCEPT, A1 a1)
|
||||||
{
|
{
|
||||||
typedef _mfi::BOOST_BIND_MF_NAME(mf0)<R, T> F;
|
typedef _mfi::BOOST_BIND_MF_NAME(mf0)<R, T> F;
|
||||||
typedef typename _bi::list_av_1<A1>::type list_type;
|
typedef typename _bi::list_av_1<A1>::type list_type;
|
||||||
@@ -28,7 +28,7 @@ template<class Rt2, class R, class T,
|
|||||||
template<class Rt2, class R, class T,
|
template<class Rt2, class R, class T,
|
||||||
class A1>
|
class A1>
|
||||||
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf0)<R, T>, typename _bi::list_av_1<A1>::type>
|
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf0)<R, T>, typename _bi::list_av_1<A1>::type>
|
||||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) () const, A1 a1)
|
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) () const BOOST_BIND_MF_NOEXCEPT, A1 a1)
|
||||||
{
|
{
|
||||||
typedef _mfi::BOOST_BIND_MF_NAME(cmf0)<R, T> F;
|
typedef _mfi::BOOST_BIND_MF_NAME(cmf0)<R, T> F;
|
||||||
typedef typename _bi::list_av_1<A1>::type list_type;
|
typedef typename _bi::list_av_1<A1>::type list_type;
|
||||||
@@ -41,7 +41,7 @@ template<class Rt2, class R, class T,
|
|||||||
class B1,
|
class B1,
|
||||||
class A1, class A2>
|
class A1, class A2>
|
||||||
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf1)<R, T, B1>, typename _bi::list_av_2<A1, A2>::type>
|
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf1)<R, T, B1>, typename _bi::list_av_2<A1, A2>::type>
|
||||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1), A1 a1, A2 a2)
|
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2)
|
||||||
{
|
{
|
||||||
typedef _mfi::BOOST_BIND_MF_NAME(mf1)<R, T, B1> F;
|
typedef _mfi::BOOST_BIND_MF_NAME(mf1)<R, T, B1> F;
|
||||||
typedef typename _bi::list_av_2<A1, A2>::type list_type;
|
typedef typename _bi::list_av_2<A1, A2>::type list_type;
|
||||||
@@ -52,7 +52,7 @@ template<class Rt2, class R, class T,
|
|||||||
class B1,
|
class B1,
|
||||||
class A1, class A2>
|
class A1, class A2>
|
||||||
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf1)<R, T, B1>, typename _bi::list_av_2<A1, A2>::type>
|
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf1)<R, T, B1>, typename _bi::list_av_2<A1, A2>::type>
|
||||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1) const, A1 a1, A2 a2)
|
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2)
|
||||||
{
|
{
|
||||||
typedef _mfi::BOOST_BIND_MF_NAME(cmf1)<R, T, B1> F;
|
typedef _mfi::BOOST_BIND_MF_NAME(cmf1)<R, T, B1> F;
|
||||||
typedef typename _bi::list_av_2<A1, A2>::type list_type;
|
typedef typename _bi::list_av_2<A1, A2>::type list_type;
|
||||||
@@ -65,7 +65,7 @@ template<class Rt2, class R, class T,
|
|||||||
class B1, class B2,
|
class B1, class B2,
|
||||||
class A1, class A2, class A3>
|
class A1, class A2, class A3>
|
||||||
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf2)<R, T, B1, B2>, typename _bi::list_av_3<A1, A2, A3>::type>
|
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf2)<R, T, B1, B2>, typename _bi::list_av_3<A1, A2, A3>::type>
|
||||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2), A1 a1, A2 a2, A3 a3)
|
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3)
|
||||||
{
|
{
|
||||||
typedef _mfi::BOOST_BIND_MF_NAME(mf2)<R, T, B1, B2> F;
|
typedef _mfi::BOOST_BIND_MF_NAME(mf2)<R, T, B1, B2> F;
|
||||||
typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
|
typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
|
||||||
@@ -76,7 +76,7 @@ template<class Rt2, class R, class T,
|
|||||||
class B1, class B2,
|
class B1, class B2,
|
||||||
class A1, class A2, class A3>
|
class A1, class A2, class A3>
|
||||||
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf2)<R, T, B1, B2>, typename _bi::list_av_3<A1, A2, A3>::type>
|
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf2)<R, T, B1, B2>, typename _bi::list_av_3<A1, A2, A3>::type>
|
||||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2) const, A1 a1, A2 a2, A3 a3)
|
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3)
|
||||||
{
|
{
|
||||||
typedef _mfi::BOOST_BIND_MF_NAME(cmf2)<R, T, B1, B2> F;
|
typedef _mfi::BOOST_BIND_MF_NAME(cmf2)<R, T, B1, B2> F;
|
||||||
typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
|
typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
|
||||||
@@ -89,7 +89,7 @@ template<class Rt2, class R, class T,
|
|||||||
class B1, class B2, class B3,
|
class B1, class B2, class B3,
|
||||||
class A1, class A2, class A3, class A4>
|
class A1, class A2, class A3, class A4>
|
||||||
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf3)<R, T, B1, B2, B3>, typename _bi::list_av_4<A1, A2, A3, A4>::type>
|
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf3)<R, T, B1, B2, B3>, typename _bi::list_av_4<A1, A2, A3, A4>::type>
|
||||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3), A1 a1, A2 a2, A3 a3, A4 a4)
|
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4)
|
||||||
{
|
{
|
||||||
typedef _mfi::BOOST_BIND_MF_NAME(mf3)<R, T, B1, B2, B3> F;
|
typedef _mfi::BOOST_BIND_MF_NAME(mf3)<R, T, B1, B2, B3> F;
|
||||||
typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
|
typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
|
||||||
@@ -100,7 +100,7 @@ template<class Rt2, class R, class T,
|
|||||||
class B1, class B2, class B3,
|
class B1, class B2, class B3,
|
||||||
class A1, class A2, class A3, class A4>
|
class A1, class A2, class A3, class A4>
|
||||||
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf3)<R, T, B1, B2, B3>, typename _bi::list_av_4<A1, A2, A3, A4>::type>
|
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf3)<R, T, B1, B2, B3>, typename _bi::list_av_4<A1, A2, A3, A4>::type>
|
||||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) const, A1 a1, A2 a2, A3 a3, A4 a4)
|
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4)
|
||||||
{
|
{
|
||||||
typedef _mfi::BOOST_BIND_MF_NAME(cmf3)<R, T, B1, B2, B3> F;
|
typedef _mfi::BOOST_BIND_MF_NAME(cmf3)<R, T, B1, B2, B3> F;
|
||||||
typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
|
typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
|
||||||
@@ -113,7 +113,7 @@ template<class Rt2, class R, class T,
|
|||||||
class B1, class B2, class B3, class B4,
|
class B1, class B2, class B3, class B4,
|
||||||
class A1, class A2, class A3, class A4, class A5>
|
class A1, class A2, class A3, class A4, class A5>
|
||||||
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf4)<R, T, B1, B2, B3, B4>, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
|
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf4)<R, T, B1, B2, B3, B4>, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
|
||||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
|
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
|
||||||
{
|
{
|
||||||
typedef _mfi::BOOST_BIND_MF_NAME(mf4)<R, T, B1, B2, B3, B4> F;
|
typedef _mfi::BOOST_BIND_MF_NAME(mf4)<R, T, B1, B2, B3, B4> F;
|
||||||
typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
|
typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
|
||||||
@@ -124,7 +124,7 @@ template<class Rt2, class R, class T,
|
|||||||
class B1, class B2, class B3, class B4,
|
class B1, class B2, class B3, class B4,
|
||||||
class A1, class A2, class A3, class A4, class A5>
|
class A1, class A2, class A3, class A4, class A5>
|
||||||
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf4)<R, T, B1, B2, B3, B4>, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
|
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf4)<R, T, B1, B2, B3, B4>, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
|
||||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
|
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
|
||||||
{
|
{
|
||||||
typedef _mfi::BOOST_BIND_MF_NAME(cmf4)<R, T, B1, B2, B3, B4> F;
|
typedef _mfi::BOOST_BIND_MF_NAME(cmf4)<R, T, B1, B2, B3, B4> F;
|
||||||
typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
|
typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
|
||||||
@@ -137,7 +137,7 @@ template<class Rt2, class R, class T,
|
|||||||
class B1, class B2, class B3, class B4, class B5,
|
class B1, class B2, class B3, class B4, class B5,
|
||||||
class A1, class A2, class A3, class A4, class A5, class A6>
|
class A1, class A2, class A3, class A4, class A5, class A6>
|
||||||
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf5)<R, T, B1, B2, B3, B4, B5>, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
|
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf5)<R, T, B1, B2, B3, B4, B5>, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
|
||||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
|
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
|
||||||
{
|
{
|
||||||
typedef _mfi::BOOST_BIND_MF_NAME(mf5)<R, T, B1, B2, B3, B4, B5> F;
|
typedef _mfi::BOOST_BIND_MF_NAME(mf5)<R, T, B1, B2, B3, B4, B5> F;
|
||||||
typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
|
typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
|
||||||
@@ -148,7 +148,7 @@ template<class Rt2, class R, class T,
|
|||||||
class B1, class B2, class B3, class B4, class B5,
|
class B1, class B2, class B3, class B4, class B5,
|
||||||
class A1, class A2, class A3, class A4, class A5, class A6>
|
class A1, class A2, class A3, class A4, class A5, class A6>
|
||||||
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf5)<R, T, B1, B2, B3, B4, B5>, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
|
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf5)<R, T, B1, B2, B3, B4, B5>, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
|
||||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
|
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
|
||||||
{
|
{
|
||||||
typedef _mfi::BOOST_BIND_MF_NAME(cmf5)<R, T, B1, B2, B3, B4, B5> F;
|
typedef _mfi::BOOST_BIND_MF_NAME(cmf5)<R, T, B1, B2, B3, B4, B5> F;
|
||||||
typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
|
typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
|
||||||
@@ -161,7 +161,7 @@ template<class Rt2, class R, class T,
|
|||||||
class B1, class B2, class B3, class B4, class B5, class B6,
|
class B1, class B2, class B3, class B4, class B5, class B6,
|
||||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7>
|
class A1, class A2, class A3, class A4, class A5, class A6, class A7>
|
||||||
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf6)<R, T, B1, B2, B3, B4, B5, B6>, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
|
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf6)<R, T, B1, B2, B3, B4, B5, B6>, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
|
||||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
|
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
|
||||||
{
|
{
|
||||||
typedef _mfi::BOOST_BIND_MF_NAME(mf6)<R, T, B1, B2, B3, B4, B5, B6> F;
|
typedef _mfi::BOOST_BIND_MF_NAME(mf6)<R, T, B1, B2, B3, B4, B5, B6> F;
|
||||||
typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
|
typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
|
||||||
@@ -172,7 +172,7 @@ template<class Rt2, class R, class T,
|
|||||||
class B1, class B2, class B3, class B4, class B5, class B6,
|
class B1, class B2, class B3, class B4, class B5, class B6,
|
||||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7>
|
class A1, class A2, class A3, class A4, class A5, class A6, class A7>
|
||||||
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf6)<R, T, B1, B2, B3, B4, B5, B6>, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
|
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf6)<R, T, B1, B2, B3, B4, B5, B6>, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
|
||||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
|
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
|
||||||
{
|
{
|
||||||
typedef _mfi::BOOST_BIND_MF_NAME(cmf6)<R, T, B1, B2, B3, B4, B5, B6> F;
|
typedef _mfi::BOOST_BIND_MF_NAME(cmf6)<R, T, B1, B2, B3, B4, B5, B6> F;
|
||||||
typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
|
typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
|
||||||
@@ -185,7 +185,7 @@ template<class Rt2, class R, class T,
|
|||||||
class B1, class B2, class B3, class B4, class B5, class B6, class B7,
|
class B1, class B2, class B3, class B4, class B5, class B6, class B7,
|
||||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
|
class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
|
||||||
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf7)<R, T, B1, B2, B3, B4, B5, B6, B7>, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
|
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf7)<R, T, B1, B2, B3, B4, B5, B6, B7>, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
|
||||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
|
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
|
||||||
{
|
{
|
||||||
typedef _mfi::BOOST_BIND_MF_NAME(mf7)<R, T, B1, B2, B3, B4, B5, B6, B7> F;
|
typedef _mfi::BOOST_BIND_MF_NAME(mf7)<R, T, B1, B2, B3, B4, B5, B6, B7> F;
|
||||||
typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
|
typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
|
||||||
@@ -196,7 +196,7 @@ template<class Rt2, class R, class T,
|
|||||||
class B1, class B2, class B3, class B4, class B5, class B6, class B7,
|
class B1, class B2, class B3, class B4, class B5, class B6, class B7,
|
||||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
|
class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
|
||||||
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf7)<R, T, B1, B2, B3, B4, B5, B6, B7>, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
|
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf7)<R, T, B1, B2, B3, B4, B5, B6, B7>, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
|
||||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
|
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
|
||||||
{
|
{
|
||||||
typedef _mfi::BOOST_BIND_MF_NAME(cmf7)<R, T, B1, B2, B3, B4, B5, B6, B7> F;
|
typedef _mfi::BOOST_BIND_MF_NAME(cmf7)<R, T, B1, B2, B3, B4, B5, B6, B7> F;
|
||||||
typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
|
typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
|
||||||
@@ -209,7 +209,7 @@ template<class Rt2, class R, class T,
|
|||||||
class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
|
class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
|
||||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
|
class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
|
||||||
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8>, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
|
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8>, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
|
||||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
|
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
|
||||||
{
|
{
|
||||||
typedef _mfi::BOOST_BIND_MF_NAME(mf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8> F;
|
typedef _mfi::BOOST_BIND_MF_NAME(mf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8> F;
|
||||||
typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
|
typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
|
||||||
@@ -220,7 +220,7 @@ template<class Rt2, class R, class T,
|
|||||||
class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
|
class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
|
||||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
|
class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
|
||||||
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8>, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
|
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8>, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
|
||||||
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
|
BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
|
||||||
{
|
{
|
||||||
typedef _mfi::BOOST_BIND_MF_NAME(cmf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8> F;
|
typedef _mfi::BOOST_BIND_MF_NAME(cmf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8> F;
|
||||||
typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
|
typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
|
||||||
|
|||||||
154
include/boost/bind/detail/result_traits.hpp
Normal file
154
include/boost/bind/detail/result_traits.hpp
Normal file
@@ -0,0 +1,154 @@
|
|||||||
|
#ifndef BOOST_BIND_DETAIL_RESULT_TRAITS_HPP_INCLUDED
|
||||||
|
#define BOOST_BIND_DETAIL_RESULT_TRAITS_HPP_INCLUDED
|
||||||
|
|
||||||
|
// MS compatible compilers support #pragma once
|
||||||
|
|
||||||
|
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||||
|
# pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//
|
||||||
|
// bind/detail/result_traits.hpp
|
||||||
|
//
|
||||||
|
// boost/bind.hpp support header, return type deduction
|
||||||
|
//
|
||||||
|
// Copyright 2006, 2020 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
|
||||||
|
//
|
||||||
|
// See http://www.boost.org/libs/bind/bind.html for documentation.
|
||||||
|
//
|
||||||
|
|
||||||
|
#if defined(_MSVC_LANG) && _MSVC_LANG >= 17
|
||||||
|
#include <functional>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace boost
|
||||||
|
{
|
||||||
|
|
||||||
|
namespace _bi
|
||||||
|
{
|
||||||
|
|
||||||
|
template<class R, class F> struct result_traits
|
||||||
|
{
|
||||||
|
typedef R type;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct unspecified {};
|
||||||
|
|
||||||
|
template<class F> struct result_traits<unspecified, F>
|
||||||
|
{
|
||||||
|
typedef typename F::result_type type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class F> struct result_traits< unspecified, reference_wrapper<F> >
|
||||||
|
{
|
||||||
|
typedef typename F::result_type type;
|
||||||
|
};
|
||||||
|
|
||||||
|
#if defined(_MSVC_LANG) && _MSVC_LANG >= 17
|
||||||
|
|
||||||
|
template<class T> struct result_traits< unspecified, std::plus<T> >
|
||||||
|
{
|
||||||
|
typedef T type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class T> struct result_traits< unspecified, std::minus<T> >
|
||||||
|
{
|
||||||
|
typedef T type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class T> struct result_traits< unspecified, std::multiplies<T> >
|
||||||
|
{
|
||||||
|
typedef T type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class T> struct result_traits< unspecified, std::divides<T> >
|
||||||
|
{
|
||||||
|
typedef T type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class T> struct result_traits< unspecified, std::modulus<T> >
|
||||||
|
{
|
||||||
|
typedef T type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class T> struct result_traits< unspecified, std::negate<T> >
|
||||||
|
{
|
||||||
|
typedef T type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class T> struct result_traits< unspecified, std::equal_to<T> >
|
||||||
|
{
|
||||||
|
typedef bool type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class T> struct result_traits< unspecified, std::not_equal_to<T> >
|
||||||
|
{
|
||||||
|
typedef bool type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class T> struct result_traits< unspecified, std::greater<T> >
|
||||||
|
{
|
||||||
|
typedef bool type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class T> struct result_traits< unspecified, std::less<T> >
|
||||||
|
{
|
||||||
|
typedef bool type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class T> struct result_traits< unspecified, std::greater_equal<T> >
|
||||||
|
{
|
||||||
|
typedef bool type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class T> struct result_traits< unspecified, std::less_equal<T> >
|
||||||
|
{
|
||||||
|
typedef bool type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class T> struct result_traits< unspecified, std::logical_and<T> >
|
||||||
|
{
|
||||||
|
typedef bool type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class T> struct result_traits< unspecified, std::logical_or<T> >
|
||||||
|
{
|
||||||
|
typedef bool type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class T> struct result_traits< unspecified, std::logical_not<T> >
|
||||||
|
{
|
||||||
|
typedef bool type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class T> struct result_traits< unspecified, std::bit_and<T> >
|
||||||
|
{
|
||||||
|
typedef T type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class T> struct result_traits< unspecified, std::bit_or<T> >
|
||||||
|
{
|
||||||
|
typedef T type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class T> struct result_traits< unspecified, std::bit_xor<T> >
|
||||||
|
{
|
||||||
|
typedef T type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class T> struct result_traits< unspecified, std::bit_not<T> >
|
||||||
|
{
|
||||||
|
typedef T type;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
} // namespace _bi
|
||||||
|
|
||||||
|
} // namespace boost
|
||||||
|
|
||||||
|
#endif // #ifndef BOOST_BIND_DETAIL_RESULT_TRAITS_HPP_INCLUDED
|
||||||
@@ -41,6 +41,18 @@ inline boost::arg<7> _7() { return boost::arg<7>(); }
|
|||||||
inline boost::arg<8> _8() { return boost::arg<8>(); }
|
inline boost::arg<8> _8() { return boost::arg<8>(); }
|
||||||
inline boost::arg<9> _9() { return boost::arg<9>(); }
|
inline boost::arg<9> _9() { return boost::arg<9>(); }
|
||||||
|
|
||||||
|
#elif !defined(BOOST_NO_CXX17_INLINE_VARIABLES)
|
||||||
|
|
||||||
|
BOOST_INLINE_CONSTEXPR boost::arg<1> _1;
|
||||||
|
BOOST_INLINE_CONSTEXPR boost::arg<2> _2;
|
||||||
|
BOOST_INLINE_CONSTEXPR boost::arg<3> _3;
|
||||||
|
BOOST_INLINE_CONSTEXPR boost::arg<4> _4;
|
||||||
|
BOOST_INLINE_CONSTEXPR boost::arg<5> _5;
|
||||||
|
BOOST_INLINE_CONSTEXPR boost::arg<6> _6;
|
||||||
|
BOOST_INLINE_CONSTEXPR boost::arg<7> _7;
|
||||||
|
BOOST_INLINE_CONSTEXPR boost::arg<8> _8;
|
||||||
|
BOOST_INLINE_CONSTEXPR boost::arg<9> _9;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
BOOST_STATIC_CONSTEXPR boost::arg<1> _1;
|
BOOST_STATIC_CONSTEXPR boost::arg<1> _1;
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
#define BOOST_BIND_PROTECT_HPP_INCLUDED
|
#define BOOST_BIND_PROTECT_HPP_INCLUDED
|
||||||
|
|
||||||
//
|
//
|
||||||
// protect.hpp
|
// protect.hpp
|
||||||
//
|
//
|
||||||
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
|
// Copyright 2002, 2020 Peter Dimov
|
||||||
// Copyright (c) 2009 Steven Watanabe
|
// Copyright 2009 Steven Watanabe
|
||||||
//
|
//
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See
|
// Distributed under the Boost Software License, Version 1.0. (See
|
||||||
// accompanying file LICENSE_1_0.txt or copy at
|
// accompanying file LICENSE_1_0.txt or copy at
|
||||||
@@ -13,7 +13,8 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
#include <boost/detail/workaround.hpp>
|
#include <boost/config/workaround.hpp>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
@@ -21,8 +22,53 @@ namespace boost
|
|||||||
namespace _bi
|
namespace _bi
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_DECLTYPE)
|
||||||
|
|
||||||
|
template<class T> struct protect_make_void
|
||||||
|
{
|
||||||
|
typedef void type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class F, class E = void> struct protect_result_type
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class F> struct protect_result_type< F, typename protect_make_void<typename F::result_type>::type >
|
||||||
|
{
|
||||||
|
typedef typename F::result_type result_type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class F> class protected_bind_t: public protect_result_type<F>
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
|
||||||
|
F f_;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
explicit protected_bind_t( F f ): f_( f )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class... A> auto operator()( A&&... a ) -> decltype( f_( std::forward<A>(a)... ) )
|
||||||
|
{
|
||||||
|
return f_( std::forward<A>(a)... );
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class... A> auto operator()( A&&... a ) const -> decltype( f_( std::forward<A>(a)... ) )
|
||||||
|
{
|
||||||
|
return f_( std::forward<A>(a)... );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
template<class F> class protected_bind_t
|
template<class F> class protected_bind_t
|
||||||
{
|
{
|
||||||
|
private:
|
||||||
|
|
||||||
|
F f_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef typename F::result_type result_type;
|
typedef typename F::result_type result_type;
|
||||||
@@ -286,12 +332,10 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
F f_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
} // namespace _bi
|
} // namespace _bi
|
||||||
|
|
||||||
template<class F> _bi::protected_bind_t<F> protect(F f)
|
template<class F> _bi::protected_bind_t<F> protect(F f)
|
||||||
|
|||||||
39
include/boost/bind/std_placeholders.hpp
Normal file
39
include/boost/bind/std_placeholders.hpp
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
#ifndef BOOST_BIND_STD_PLACEHOLDERS_HPP_INCLUDED
|
||||||
|
#define BOOST_BIND_STD_PLACEHOLDERS_HPP_INCLUDED
|
||||||
|
|
||||||
|
// MS compatible compilers support #pragma once
|
||||||
|
|
||||||
|
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
|
||||||
|
# pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Copyright 2021 Peter Dimov
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
#include <boost/is_placeholder.hpp>
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
|
||||||
|
#if !defined(BOOST_NO_CXX11_HDR_FUNCTIONAL) && !defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
#include <type_traits>
|
||||||
|
|
||||||
|
namespace boost
|
||||||
|
{
|
||||||
|
|
||||||
|
template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_1)>::type > { enum _vt { value = 1 }; };
|
||||||
|
template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_2)>::type > { enum _vt { value = 2 }; };
|
||||||
|
template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_3)>::type > { enum _vt { value = 3 }; };
|
||||||
|
template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_4)>::type > { enum _vt { value = 4 }; };
|
||||||
|
template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_5)>::type > { enum _vt { value = 5 }; };
|
||||||
|
template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_6)>::type > { enum _vt { value = 6 }; };
|
||||||
|
template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_7)>::type > { enum _vt { value = 7 }; };
|
||||||
|
template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_8)>::type > { enum _vt { value = 8 }; };
|
||||||
|
template<> struct is_placeholder< typename std::decay<decltype(std::placeholders::_9)>::type > { enum _vt { value = 9 }; };
|
||||||
|
|
||||||
|
} // namespace boost
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // #ifndef BOOST_BIND_STD_PLACEHOLDERS_HPP_INCLUDED
|
||||||
@@ -13,8 +13,9 @@
|
|||||||
"Function-objects"
|
"Function-objects"
|
||||||
],
|
],
|
||||||
"maintainers": [
|
"maintainers": [
|
||||||
"Peter Dimov <pdimov -at- pdimov.com>"
|
"Peter Dimov <pdimov -at- gmail.com>"
|
||||||
]
|
],
|
||||||
|
"cxxstd": "03"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "bind/mem_fn",
|
"key": "bind/mem_fn",
|
||||||
@@ -29,6 +30,7 @@
|
|||||||
],
|
],
|
||||||
"category": [
|
"category": [
|
||||||
"Function-objects"
|
"Function-objects"
|
||||||
]
|
],
|
||||||
|
"cxxstd": "03"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -74,3 +74,12 @@ run bind_noexcept_test.cpp ;
|
|||||||
run bind_noexcept_mf_test.cpp ;
|
run bind_noexcept_mf_test.cpp ;
|
||||||
run global_placeholders.cpp ;
|
run global_placeholders.cpp ;
|
||||||
run mem_fn_noexcept_test.cpp ;
|
run mem_fn_noexcept_test.cpp ;
|
||||||
|
run bind_cpp20_test.cpp ;
|
||||||
|
run protect_test2.cpp ;
|
||||||
|
run protect_cpp20_test.cpp ;
|
||||||
|
run bind_noexcept_mf2_test.cpp ;
|
||||||
|
run std_placeholders_test.cpp ;
|
||||||
|
run apply_test.cpp ;
|
||||||
|
run apply_test2.cpp ;
|
||||||
|
run apply_rv_test.cpp ;
|
||||||
|
run apply_rv_test2.cpp ;
|
||||||
|
|||||||
77
test/apply_rv_test.cpp
Normal file
77
test/apply_rv_test.cpp
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
// Copyright 2021 Peter Dimov
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
#include<boost/bind/apply.hpp>
|
||||||
|
#include<boost/bind/bind.hpp>
|
||||||
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
#include <boost/config/pragma_message.hpp>
|
||||||
|
|
||||||
|
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||||
|
|
||||||
|
BOOST_PRAGMA_MESSAGE("Skipping test because BOOST_NO_CXX11_RVALUE_REFERENCES is defined")
|
||||||
|
int main() {}
|
||||||
|
|
||||||
|
#elif defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||||
|
|
||||||
|
BOOST_PRAGMA_MESSAGE("Skipping test because BOOST_NO_CXX11_VARIADIC_TEMPLATES is defined")
|
||||||
|
int main() {}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
struct F
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
int operator()( int & x ) const
|
||||||
|
{
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
int operator()( int && x ) const
|
||||||
|
{
|
||||||
|
return -x;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
int& get_lvalue_arg()
|
||||||
|
{
|
||||||
|
static int a = 1;
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
|
||||||
|
int get_prvalue_arg()
|
||||||
|
{
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
F& get_lvalue_f()
|
||||||
|
{
|
||||||
|
static F f;
|
||||||
|
return f;
|
||||||
|
}
|
||||||
|
|
||||||
|
F get_prvalue_f()
|
||||||
|
{
|
||||||
|
return F();
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
using namespace boost::placeholders;
|
||||||
|
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(get_lvalue_f), boost::bind(get_lvalue_arg))(), 1 );
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(get_lvalue_f), boost::bind(get_prvalue_arg))(), -2 );
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(get_prvalue_f), boost::bind(get_lvalue_arg))(), 1 );
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(get_prvalue_f), boost::bind(get_prvalue_arg))(), -2 );
|
||||||
|
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(boost::apply<F&>(), _1), boost::bind(boost::apply<int&>(), _2))(get_lvalue_f, get_lvalue_arg), 1 );
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(boost::apply<F&>(), _1), boost::bind(boost::apply<int>(), _2))(get_lvalue_f, get_prvalue_arg), -2 );
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(boost::apply<F>(), _1), boost::bind(boost::apply<int&>(), _2))(get_prvalue_f, get_lvalue_arg), 1 );
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(boost::apply<F>(), _1), boost::bind(boost::apply<int>(), _2))(get_prvalue_f, get_prvalue_arg), -2 );
|
||||||
|
|
||||||
|
return boost::report_errors();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
92
test/apply_rv_test2.cpp
Normal file
92
test/apply_rv_test2.cpp
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
// Copyright 2021 Peter Dimov
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
#include<boost/bind/apply.hpp>
|
||||||
|
#include<boost/bind/bind.hpp>
|
||||||
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
#include <boost/config/pragma_message.hpp>
|
||||||
|
|
||||||
|
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||||
|
|
||||||
|
BOOST_PRAGMA_MESSAGE("Skipping test because BOOST_NO_CXX11_RVALUE_REFERENCES is defined")
|
||||||
|
int main() {}
|
||||||
|
|
||||||
|
#elif defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||||
|
|
||||||
|
BOOST_PRAGMA_MESSAGE("Skipping test because BOOST_NO_CXX11_VARIADIC_TEMPLATES is defined")
|
||||||
|
int main() {}
|
||||||
|
|
||||||
|
#elif defined(BOOST_NO_CXX11_REF_QUALIFIERS)
|
||||||
|
|
||||||
|
BOOST_PRAGMA_MESSAGE("Skipping test because BOOST_NO_CXX11_REF_QUALIFIERS is defined")
|
||||||
|
int main() {}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
struct F
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
int operator()( int & x ) &
|
||||||
|
{
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
int operator()( int && x ) &
|
||||||
|
{
|
||||||
|
return -x;
|
||||||
|
}
|
||||||
|
|
||||||
|
int operator()( int & x ) &&
|
||||||
|
{
|
||||||
|
return x + 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
int operator()( int && x ) &&
|
||||||
|
{
|
||||||
|
return -x - 10;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
int& get_lvalue_arg()
|
||||||
|
{
|
||||||
|
static int a = 1;
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
|
||||||
|
int get_prvalue_arg()
|
||||||
|
{
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
F& get_lvalue_f()
|
||||||
|
{
|
||||||
|
static F f;
|
||||||
|
return f;
|
||||||
|
}
|
||||||
|
|
||||||
|
F get_prvalue_f()
|
||||||
|
{
|
||||||
|
return F();
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
using namespace boost::placeholders;
|
||||||
|
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(get_lvalue_f), boost::bind(get_lvalue_arg))(), 1 );
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(get_lvalue_f), boost::bind(get_prvalue_arg))(), -2 );
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(get_prvalue_f), boost::bind(get_lvalue_arg))(), 11 );
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(get_prvalue_f), boost::bind(get_prvalue_arg))(), -12 );
|
||||||
|
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(boost::apply<F&>(), _1), boost::bind(boost::apply<int&>(), _2))(get_lvalue_f, get_lvalue_arg), 1 );
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(boost::apply<F&>(), _1), boost::bind(boost::apply<int>(), _2))(get_lvalue_f, get_prvalue_arg), -2 );
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(boost::apply<F>(), _1), boost::bind(boost::apply<int&>(), _2))(get_prvalue_f, get_lvalue_arg), 11 );
|
||||||
|
BOOST_TEST_EQ( boost::bind(boost::apply<int>(), boost::bind(boost::apply<F>(), _1), boost::bind(boost::apply<int>(), _2))(get_prvalue_f, get_prvalue_arg), -12 );
|
||||||
|
|
||||||
|
return boost::report_errors();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
29
test/apply_test.cpp
Normal file
29
test/apply_test.cpp
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
// Copyright 2021 Peter Dimov
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
#include <boost/bind/apply.hpp>
|
||||||
|
#include <boost/bind/protect.hpp>
|
||||||
|
#include <boost/bind/bind.hpp>
|
||||||
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
|
||||||
|
using namespace boost::placeholders;
|
||||||
|
|
||||||
|
int f( int x )
|
||||||
|
{
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
BOOST_TEST_EQ( boost::bind( boost::apply<int>(), boost::protect( boost::bind( f, _1 ) ), 1 )(), 1 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( boost::apply<int>(), boost::protect( boost::bind( f, _2 ) ), 1, 2 )(), 2 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( boost::apply<int>(), boost::protect( boost::bind( f, _3 ) ), 1, 2, 3 )(), 3 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( boost::apply<int>(), boost::protect( boost::bind( f, _4 ) ), 1, 2, 3, 4 )(), 4 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( boost::apply<int>(), boost::protect( boost::bind( f, _5 ) ), 1, 2, 3, 4, 5 )(), 5 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( boost::apply<int>(), boost::protect( boost::bind( f, _6 ) ), 1, 2, 3, 4, 5, 6 )(), 6 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( boost::apply<int>(), boost::protect( boost::bind( f, _7 ) ), 1, 2, 3, 4, 5, 6, 7 )(), 7 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( boost::apply<int>(), boost::protect( boost::bind( f, _8 ) ), 1, 2, 3, 4, 5, 6, 7, 8 )(), 8 );
|
||||||
|
|
||||||
|
return boost::report_errors();
|
||||||
|
}
|
||||||
15
test/apply_test2.cpp
Normal file
15
test/apply_test2.cpp
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
// Copyright 2021 Peter Dimov
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
#include <boost/bind/apply.hpp>
|
||||||
|
#include <boost/core/lightweight_test_trait.hpp>
|
||||||
|
#include <boost/core/is_same.hpp>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
BOOST_TEST_TRAIT_TRUE((boost::core::is_same<void, boost::apply<void>::result_type>));
|
||||||
|
BOOST_TEST_TRAIT_TRUE((boost::core::is_same<int&, boost::apply<int&>::result_type>));
|
||||||
|
|
||||||
|
return boost::report_errors();
|
||||||
|
}
|
||||||
42
test/bind_cpp20_test.cpp
Normal file
42
test/bind_cpp20_test.cpp
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
// Copyright 2020 Peter Dimov
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// https://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
#include <boost/bind/bind.hpp>
|
||||||
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
#include <boost/config/workaround.hpp>
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
BOOST_TEST_EQ( boost::bind( std::plus<int>(), 1, 2 )(), 3 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( std::minus<int>(), 1, 2 )(), -1 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( std::multiplies<int>(), 1, 2 )(), 2 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( std::divides<int>(), 1, 2 )(), 0 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( std::modulus<int>(), 1, 2 )(), 1 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( std::negate<int>(), 1 )(), -1 );
|
||||||
|
|
||||||
|
BOOST_TEST_EQ( boost::bind( std::equal_to<int>(), 1, 2 )(), false );
|
||||||
|
BOOST_TEST_EQ( boost::bind( std::not_equal_to<int>(), 1, 2 )(), true );
|
||||||
|
BOOST_TEST_EQ( boost::bind( std::greater<int>(), 1, 2 )(), false );
|
||||||
|
BOOST_TEST_EQ( boost::bind( std::less<int>(), 1, 2 )(), true );
|
||||||
|
BOOST_TEST_EQ( boost::bind( std::greater_equal<int>(), 1, 2 )(), false );
|
||||||
|
BOOST_TEST_EQ( boost::bind( std::less_equal<int>(), 1, 2 )(), true );
|
||||||
|
|
||||||
|
BOOST_TEST_EQ( boost::bind( std::logical_and<int>(), 1, 2 )(), true );
|
||||||
|
BOOST_TEST_EQ( boost::bind( std::logical_or<int>(), 1, 2 )(), true );
|
||||||
|
BOOST_TEST_EQ( boost::bind( std::logical_not<int>(), 1 )(), false );
|
||||||
|
|
||||||
|
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1600)
|
||||||
|
|
||||||
|
BOOST_TEST_EQ( boost::bind( std::bit_and<int>(), 1, 2 )(), 0 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( std::bit_or<int>(), 1, 2 )(), 3 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( std::bit_xor<int>(), 1, 2 )(), 3 );
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return boost::report_errors();
|
||||||
|
}
|
||||||
154
test/bind_noexcept_mf2_test.cpp
Normal file
154
test/bind_noexcept_mf2_test.cpp
Normal file
@@ -0,0 +1,154 @@
|
|||||||
|
//
|
||||||
|
// bind_noexcept_mf2_test.cpp - noexcept member functions w/ the type<> syntax
|
||||||
|
//
|
||||||
|
// Copyright 2017 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 <boost/bind/bind.hpp>
|
||||||
|
#include <boost/ref.hpp>
|
||||||
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
|
||||||
|
#if defined(BOOST_NO_CXX11_NOEXCEPT)
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
|
struct X
|
||||||
|
{
|
||||||
|
mutable unsigned int hash;
|
||||||
|
|
||||||
|
X(): hash(0) {}
|
||||||
|
|
||||||
|
int f0() noexcept { f1(17); return 0; }
|
||||||
|
int g0() const noexcept { g1(17); return 0; }
|
||||||
|
|
||||||
|
int f1(int a1) noexcept { hash = (hash * 17041 + a1) % 32768; return 0; }
|
||||||
|
int g1(int a1) const noexcept { hash = (hash * 17041 + a1 * 2) % 32768; return 0; }
|
||||||
|
|
||||||
|
int f2(int a1, int a2) noexcept { f1(a1); f1(a2); return 0; }
|
||||||
|
int g2(int a1, int a2) const noexcept { g1(a1); g1(a2); return 0; }
|
||||||
|
|
||||||
|
int f3(int a1, int a2, int a3) noexcept { f2(a1, a2); f1(a3); return 0; }
|
||||||
|
int g3(int a1, int a2, int a3) const noexcept { g2(a1, a2); g1(a3); return 0; }
|
||||||
|
|
||||||
|
int f4(int a1, int a2, int a3, int a4) noexcept { f3(a1, a2, a3); f1(a4); return 0; }
|
||||||
|
int g4(int a1, int a2, int a3, int a4) const noexcept { g3(a1, a2, a3); g1(a4); return 0; }
|
||||||
|
|
||||||
|
int f5(int a1, int a2, int a3, int a4, int a5) noexcept { f4(a1, a2, a3, a4); f1(a5); return 0; }
|
||||||
|
int g5(int a1, int a2, int a3, int a4, int a5) const noexcept { g4(a1, a2, a3, a4); g1(a5); return 0; }
|
||||||
|
|
||||||
|
int f6(int a1, int a2, int a3, int a4, int a5, int a6) noexcept { f5(a1, a2, a3, a4, a5); f1(a6); return 0; }
|
||||||
|
int g6(int a1, int a2, int a3, int a4, int a5, int a6) const noexcept { g5(a1, a2, a3, a4, a5); g1(a6); return 0; }
|
||||||
|
|
||||||
|
int f7(int a1, int a2, int a3, int a4, int a5, int a6, int a7) noexcept { f6(a1, a2, a3, a4, a5, a6); f1(a7); return 0; }
|
||||||
|
int g7(int a1, int a2, int a3, int a4, int a5, int a6, int a7) const noexcept { g6(a1, a2, a3, a4, a5, a6); g1(a7); return 0; }
|
||||||
|
|
||||||
|
int f8(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) noexcept { f7(a1, a2, a3, a4, a5, a6, a7); f1(a8); return 0; }
|
||||||
|
int g8(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) const noexcept { g7(a1, a2, a3, a4, a5, a6, a7); g1(a8); return 0; }
|
||||||
|
};
|
||||||
|
|
||||||
|
void member_function_test()
|
||||||
|
{
|
||||||
|
X x;
|
||||||
|
|
||||||
|
// 0
|
||||||
|
|
||||||
|
boost::bind(boost::type<void>(), &X::f0, &x)();
|
||||||
|
boost::bind(boost::type<void>(), &X::f0, boost::ref(x))();
|
||||||
|
|
||||||
|
boost::bind(boost::type<void>(), &X::g0, &x)();
|
||||||
|
boost::bind(boost::type<void>(), &X::g0, x)();
|
||||||
|
boost::bind(boost::type<void>(), &X::g0, boost::ref(x))();
|
||||||
|
|
||||||
|
// 1
|
||||||
|
|
||||||
|
boost::bind(boost::type<void>(), &X::f1, &x, 1)();
|
||||||
|
boost::bind(boost::type<void>(), &X::f1, boost::ref(x), 1)();
|
||||||
|
|
||||||
|
boost::bind(boost::type<void>(), &X::g1, &x, 1)();
|
||||||
|
boost::bind(boost::type<void>(), &X::g1, x, 1)();
|
||||||
|
boost::bind(boost::type<void>(), &X::g1, boost::ref(x), 1)();
|
||||||
|
|
||||||
|
// 2
|
||||||
|
|
||||||
|
boost::bind(boost::type<void>(), &X::f2, &x, 1, 2)();
|
||||||
|
boost::bind(boost::type<void>(), &X::f2, boost::ref(x), 1, 2)();
|
||||||
|
|
||||||
|
boost::bind(boost::type<void>(), &X::g2, &x, 1, 2)();
|
||||||
|
boost::bind(boost::type<void>(), &X::g2, x, 1, 2)();
|
||||||
|
boost::bind(boost::type<void>(), &X::g2, boost::ref(x), 1, 2)();
|
||||||
|
|
||||||
|
// 3
|
||||||
|
|
||||||
|
boost::bind(boost::type<void>(), &X::f3, &x, 1, 2, 3)();
|
||||||
|
boost::bind(boost::type<void>(), &X::f3, boost::ref(x), 1, 2, 3)();
|
||||||
|
|
||||||
|
boost::bind(boost::type<void>(), &X::g3, &x, 1, 2, 3)();
|
||||||
|
boost::bind(boost::type<void>(), &X::g3, x, 1, 2, 3)();
|
||||||
|
boost::bind(boost::type<void>(), &X::g3, boost::ref(x), 1, 2, 3)();
|
||||||
|
|
||||||
|
// 4
|
||||||
|
|
||||||
|
boost::bind(boost::type<void>(), &X::f4, &x, 1, 2, 3, 4)();
|
||||||
|
boost::bind(boost::type<void>(), &X::f4, boost::ref(x), 1, 2, 3, 4)();
|
||||||
|
|
||||||
|
boost::bind(boost::type<void>(), &X::g4, &x, 1, 2, 3, 4)();
|
||||||
|
boost::bind(boost::type<void>(), &X::g4, x, 1, 2, 3, 4)();
|
||||||
|
boost::bind(boost::type<void>(), &X::g4, boost::ref(x), 1, 2, 3, 4)();
|
||||||
|
|
||||||
|
// 5
|
||||||
|
|
||||||
|
boost::bind(boost::type<void>(), &X::f5, &x, 1, 2, 3, 4, 5)();
|
||||||
|
boost::bind(boost::type<void>(), &X::f5, boost::ref(x), 1, 2, 3, 4, 5)();
|
||||||
|
|
||||||
|
boost::bind(boost::type<void>(), &X::g5, &x, 1, 2, 3, 4, 5)();
|
||||||
|
boost::bind(boost::type<void>(), &X::g5, x, 1, 2, 3, 4, 5)();
|
||||||
|
boost::bind(boost::type<void>(), &X::g5, boost::ref(x), 1, 2, 3, 4, 5)();
|
||||||
|
|
||||||
|
// 6
|
||||||
|
|
||||||
|
boost::bind(boost::type<void>(), &X::f6, &x, 1, 2, 3, 4, 5, 6)();
|
||||||
|
boost::bind(boost::type<void>(), &X::f6, boost::ref(x), 1, 2, 3, 4, 5, 6)();
|
||||||
|
|
||||||
|
boost::bind(boost::type<void>(), &X::g6, &x, 1, 2, 3, 4, 5, 6)();
|
||||||
|
boost::bind(boost::type<void>(), &X::g6, x, 1, 2, 3, 4, 5, 6)();
|
||||||
|
boost::bind(boost::type<void>(), &X::g6, boost::ref(x), 1, 2, 3, 4, 5, 6)();
|
||||||
|
|
||||||
|
// 7
|
||||||
|
|
||||||
|
boost::bind(boost::type<void>(), &X::f7, &x, 1, 2, 3, 4, 5, 6, 7)();
|
||||||
|
boost::bind(boost::type<void>(), &X::f7, boost::ref(x), 1, 2, 3, 4, 5, 6, 7)();
|
||||||
|
|
||||||
|
boost::bind(boost::type<void>(), &X::g7, &x, 1, 2, 3, 4, 5, 6, 7)();
|
||||||
|
boost::bind(boost::type<void>(), &X::g7, x, 1, 2, 3, 4, 5, 6, 7)();
|
||||||
|
boost::bind(boost::type<void>(), &X::g7, boost::ref(x), 1, 2, 3, 4, 5, 6, 7)();
|
||||||
|
|
||||||
|
// 8
|
||||||
|
|
||||||
|
boost::bind(boost::type<void>(), &X::f8, &x, 1, 2, 3, 4, 5, 6, 7, 8)();
|
||||||
|
boost::bind(boost::type<void>(), &X::f8, boost::ref(x), 1, 2, 3, 4, 5, 6, 7, 8)();
|
||||||
|
|
||||||
|
boost::bind(boost::type<void>(), &X::g8, &x, 1, 2, 3, 4, 5, 6, 7, 8)();
|
||||||
|
boost::bind(boost::type<void>(), &X::g8, x, 1, 2, 3, 4, 5, 6, 7, 8)();
|
||||||
|
boost::bind(boost::type<void>(), &X::g8, boost::ref(x), 1, 2, 3, 4, 5, 6, 7, 8)();
|
||||||
|
|
||||||
|
BOOST_TEST( x.hash == 23558 );
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
member_function_test();
|
||||||
|
return boost::report_errors();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
42
test/protect_cpp20_test.cpp
Normal file
42
test/protect_cpp20_test.cpp
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
// Copyright 2020 Peter Dimov
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// https://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
#include <boost/bind/protect.hpp>
|
||||||
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
#include <boost/config/workaround.hpp>
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
BOOST_TEST_EQ( boost::protect( std::plus<int>() )( 1, 2 ), 3 );
|
||||||
|
BOOST_TEST_EQ( boost::protect( std::minus<int>() )( 1, 2 ), -1 );
|
||||||
|
BOOST_TEST_EQ( boost::protect( std::multiplies<int>() )( 1, 2 ), 2 );
|
||||||
|
BOOST_TEST_EQ( boost::protect( std::divides<int>() )( 1, 2 ), 0 );
|
||||||
|
BOOST_TEST_EQ( boost::protect( std::modulus<int>() )( 1, 2 ), 1 );
|
||||||
|
BOOST_TEST_EQ( boost::protect( std::negate<int>() )( 1 ), -1 );
|
||||||
|
|
||||||
|
BOOST_TEST_EQ( boost::protect( std::equal_to<int>() )( 1, 2 ), false );
|
||||||
|
BOOST_TEST_EQ( boost::protect( std::not_equal_to<int>() )( 1, 2 ), true );
|
||||||
|
BOOST_TEST_EQ( boost::protect( std::greater<int>() )( 1, 2 ), false );
|
||||||
|
BOOST_TEST_EQ( boost::protect( std::less<int>() )( 1, 2 ), true );
|
||||||
|
BOOST_TEST_EQ( boost::protect( std::greater_equal<int>() )( 1, 2 ), false );
|
||||||
|
BOOST_TEST_EQ( boost::protect( std::less_equal<int>() )( 1, 2 ), true );
|
||||||
|
|
||||||
|
BOOST_TEST_EQ( boost::protect( std::logical_and<int>() )( 1, 2 ), true );
|
||||||
|
BOOST_TEST_EQ( boost::protect( std::logical_or<int>() )( 1, 2 ), true );
|
||||||
|
BOOST_TEST_EQ( boost::protect( std::logical_not<int>() )( 1 ), false );
|
||||||
|
|
||||||
|
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1600)
|
||||||
|
|
||||||
|
BOOST_TEST_EQ( boost::protect( std::bit_and<int>() )( 1, 2 ), 0 );
|
||||||
|
BOOST_TEST_EQ( boost::protect( std::bit_or<int>() )( 1, 2 ), 3 );
|
||||||
|
BOOST_TEST_EQ( boost::protect( std::bit_xor<int>() )( 1, 2 ), 3 );
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return boost::report_errors();
|
||||||
|
}
|
||||||
46
test/protect_test2.cpp
Normal file
46
test/protect_test2.cpp
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
// protect_test2.cpp
|
||||||
|
//
|
||||||
|
// Copyright 2020 Peter Dimov
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
#include <boost/bind/protect.hpp>
|
||||||
|
#include <boost/core/lightweight_test_trait.hpp>
|
||||||
|
#include <boost/core/is_same.hpp>
|
||||||
|
|
||||||
|
template<class T, class F> void test( F )
|
||||||
|
{
|
||||||
|
BOOST_TEST_TRAIT_TRUE((boost::core::is_same<typename T::result_type, typename F::result_type>));
|
||||||
|
}
|
||||||
|
|
||||||
|
struct X
|
||||||
|
{
|
||||||
|
struct result_type {};
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Y
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class T, class U> struct inherit: T, U
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class F> void test2( F )
|
||||||
|
{
|
||||||
|
// test that F doesn't have ::result_type
|
||||||
|
BOOST_TEST_TRAIT_TRUE((boost::core::is_same<typename inherit<F, X>::result_type, typename X::result_type>));
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
test<X>( boost::protect( X() ) );
|
||||||
|
|
||||||
|
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_DECLTYPE)
|
||||||
|
|
||||||
|
test2( boost::protect( Y() ) );
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return boost::report_errors();
|
||||||
|
}
|
||||||
50
test/std_placeholders_test.cpp
Normal file
50
test/std_placeholders_test.cpp
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
// Copyright 2021 Peter Dimov
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// https://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
#include <boost/bind/bind.hpp>
|
||||||
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
#include <functional>
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
#include <boost/config/pragma_message.hpp>
|
||||||
|
|
||||||
|
#if defined(BOOST_NO_CXX11_HDR_FUNCTIONAL)
|
||||||
|
|
||||||
|
BOOST_PRAGMA_MESSAGE( "Skipping test due to BOOST_NO_CXX11_HDR_FUNCTIONAL being defined" )
|
||||||
|
int main() {}
|
||||||
|
|
||||||
|
#elif defined(BOOST_NO_CXX11_DECLTYPE)
|
||||||
|
|
||||||
|
BOOST_PRAGMA_MESSAGE( "Skipping test due to BOOST_NO_CXX11_DECLTYPE being defined" )
|
||||||
|
int main() {}
|
||||||
|
|
||||||
|
#elif defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
|
||||||
|
|
||||||
|
BOOST_PRAGMA_MESSAGE( "Skipping test due to BOOST_NO_CXX11_HDR_TYPE_TRAITS being defined" )
|
||||||
|
int main() {}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
int f( int x )
|
||||||
|
{
|
||||||
|
return -x;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
using namespace std::placeholders;
|
||||||
|
|
||||||
|
BOOST_TEST_EQ( boost::bind( f, _1 )( 1 ), -1 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( f, _2 )( 1, 2 ), -2 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( f, _3 )( 1, 2, 3 ), -3 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( f, _4 )( 1, 2, 3, 4 ), -4 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( f, _5 )( 1, 2, 3, 4, 5 ), -5 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( f, _6 )( 1, 2, 3, 4, 5, 6 ), -6 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( f, _7 )( 1, 2, 3, 4, 5, 6, 7 ), -7 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( f, _8 )( 1, 2, 3, 4, 5, 6, 7, 8 ), -8 );
|
||||||
|
BOOST_TEST_EQ( boost::bind( f, _9 )( 1, 2, 3, 4, 5, 6, 7, 8, 9 ), -9 );
|
||||||
|
|
||||||
|
return boost::report_errors();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user