mirror of
https://github.com/boostorg/bind.git
synced 2026-04-13 21:25:59 +02:00
Compare commits
97 Commits
boost-1.59
...
feature/us
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dab3578e44 | ||
|
|
bf17d15d3c | ||
|
|
d6ac20c4fd | ||
|
|
4c263bff9e | ||
|
|
d051c452ea | ||
|
|
b0f3b3fbab | ||
|
|
be7a2d9212 | ||
|
|
c8973a7027 | ||
|
|
f52ef4b659 | ||
|
|
42fe00190e | ||
|
|
9ded210338 | ||
|
|
bce6f5ff79 | ||
|
|
bd22f0e4de | ||
|
|
98fbd87b9e | ||
|
|
791c3a0b1f | ||
|
|
9d4ca0ede4 | ||
|
|
7a4b89856d | ||
|
|
d67200bd2a | ||
|
|
e9b0d46d0f | ||
|
|
070185914d | ||
|
|
59713eab65 | ||
|
|
c2f03d66a0 | ||
|
|
669898bc14 | ||
|
|
436cc4577f | ||
|
|
90aea45e9b | ||
|
|
6b216514d4 | ||
|
|
bf05a29b56 | ||
|
|
f25070d982 | ||
|
|
05a56f08e3 | ||
|
|
ddfaa05ae4 | ||
|
|
f75d27469a | ||
|
|
e1bba7094b | ||
|
|
e939a651c3 | ||
|
|
6fe48ae184 | ||
|
|
e3d5ee50b6 | ||
|
|
1f240d07d6 | ||
|
|
4771d24ad8 | ||
|
|
d6abae3bd6 | ||
|
|
fe1d62dc41 | ||
|
|
734fca6e12 | ||
|
|
2f9ea82c62 | ||
|
|
7273e1d6d0 | ||
|
|
5856dd356b | ||
|
|
ce4df8a666 | ||
|
|
ecc0e72841 | ||
|
|
b51caf1934 | ||
|
|
2a29af7e4f | ||
|
|
2e23da9630 | ||
|
|
6587f1f05d | ||
|
|
60d3e0f4f3 | ||
|
|
b4ff3ca541 | ||
|
|
209bda011d | ||
|
|
1340966709 | ||
|
|
c61026bb81 | ||
|
|
473155eebe | ||
|
|
a1f6206a49 | ||
|
|
03a25d41da | ||
|
|
808996b70f | ||
|
|
3c56630b54 | ||
|
|
494d2fede7 | ||
|
|
2821b51a50 | ||
|
|
6616add21d | ||
|
|
3d957988d0 | ||
|
|
b3e40992ca | ||
|
|
8bca02ab4d | ||
|
|
cea67e705b | ||
|
|
154f70cf7a | ||
|
|
7a2d6aeaf3 | ||
|
|
ad4ac867ce | ||
|
|
42c1323df9 | ||
|
|
36b157c3e8 | ||
|
|
d6e4fab051 | ||
|
|
4d83ab068f | ||
|
|
5500f3363c | ||
|
|
cb7e7f179b | ||
|
|
679ff6b5ba | ||
|
|
8dbd26692f | ||
|
|
21a6662b35 | ||
|
|
41ba1a07c0 | ||
|
|
59b0379969 | ||
|
|
bf402c726c | ||
|
|
5ac488c223 | ||
|
|
4300db5db8 | ||
|
|
017258c983 | ||
|
|
90bd9b1684 | ||
|
|
20a07a05f7 | ||
|
|
8647ccca80 | ||
|
|
5727d4f46e | ||
|
|
da16abf365 | ||
|
|
2ee272fa8d | ||
|
|
92549594f0 | ||
|
|
37a5201a55 | ||
|
|
6bee84b285 | ||
|
|
cf266d22e4 | ||
|
|
12b976939c | ||
|
|
377014f1a4 | ||
|
|
db56733e4e |
293
.travis.yml
Normal file
293
.travis.yml
Normal file
@@ -0,0 +1,293 @@
|
||||
# Copyright 2016-2019 Peter Dimov
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
language: cpp
|
||||
|
||||
sudo: false
|
||||
|
||||
dist: trusty
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- develop
|
||||
- /feature\/.*/
|
||||
|
||||
env:
|
||||
matrix:
|
||||
- BOGUS_JOB=true
|
||||
|
||||
matrix:
|
||||
|
||||
exclude:
|
||||
- env: BOGUS_JOB=true
|
||||
|
||||
include:
|
||||
- os: linux
|
||||
compiler: g++
|
||||
env: TOOLSET=gcc COMPILER=g++ CXXSTD=11
|
||||
|
||||
- os: linux
|
||||
compiler: g++-4.6
|
||||
env: TOOLSET=gcc COMPILER=g++-4.6 CXXSTD=0x
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-4.6
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-4.7
|
||||
env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-4.7
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-4.8
|
||||
env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-4.8
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- os: linux
|
||||
compiler: g++-4.9
|
||||
env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-4.9
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-5
|
||||
env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-5
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-6
|
||||
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-6
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
dist: trusty
|
||||
compiler: g++-7
|
||||
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=11,14,17
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-7
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-8
|
||||
env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=11,14,17,2a
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-8
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-9
|
||||
env: TOOLSET=gcc COMPILER=g++-9 CXXSTD=11,14,17,2a
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-9
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: clang++
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=11
|
||||
|
||||
- os: linux
|
||||
compiler: /usr/bin/clang++
|
||||
env: TOOLSET=clang COMPILER=/usr/bin/clang++ CXXSTD=11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.3
|
||||
|
||||
- os: linux
|
||||
compiler: /usr/bin/clang++
|
||||
env: TOOLSET=clang COMPILER=/usr/bin/clang++ CXXSTD=11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.4
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-3.5
|
||||
env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.5
|
||||
- libstdc++-4.9-dev
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.5
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-3.6
|
||||
env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.6
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.6
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-3.7
|
||||
env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.7
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.7
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-3.8
|
||||
env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.8
|
||||
- libstdc++-4.9-dev
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.8
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-3.9
|
||||
env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.9
|
||||
- libstdc++-4.9-dev
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.9
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-4.0
|
||||
env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-4.0
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-4.0
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-5.0
|
||||
env: TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-5.0
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-5.0
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-6.0
|
||||
env: TOOLSET=clang COMPILER=clang++-6.0 CXXSTD=11,14,17,2a
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-6.0
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-6.0
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-7
|
||||
env: TOOLSET=clang COMPILER=clang++-7 CXXSTD=11,14,17,2a
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-7
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-7
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-8
|
||||
env: TOOLSET=clang COMPILER=clang++-8 CXXSTD=11,14,17,2a
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-8
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-trusty-8
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-libc++
|
||||
env: TOOLSET=clang COMPILER=clang++-libc++ CXXSTD=11,14,1z VARIANT=release
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- libc++-dev
|
||||
|
||||
- os: osx
|
||||
compiler: clang++
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=11,14,1z
|
||||
|
||||
- os: linux
|
||||
compiler: g++
|
||||
env: CMAKE_SUBDIR_TEST=1
|
||||
script:
|
||||
- cd libs/bind/test/cmake_subdir_test && mkdir __build__ && cd __build__
|
||||
- cmake ..
|
||||
- cmake --build .
|
||||
- cmake --build . --target check
|
||||
|
||||
install:
|
||||
- BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
|
||||
- cd ..
|
||||
- git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||
- cd boost-root
|
||||
- git submodule update --init tools/boostdep
|
||||
- cp -r $TRAVIS_BUILD_DIR/* libs/bind
|
||||
- python tools/boostdep/depinst/depinst.py bind
|
||||
- ./bootstrap.sh
|
||||
- ./b2 headers
|
||||
|
||||
script:
|
||||
- |-
|
||||
echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam
|
||||
- ./b2 -j 3 libs/bind/test toolset=$TOOLSET cxxstd=$CXXSTD
|
||||
|
||||
notifications:
|
||||
email:
|
||||
on_success: always
|
||||
20
CMakeLists.txt
Normal file
20
CMakeLists.txt
Normal file
@@ -0,0 +1,20 @@
|
||||
# Copyright 2018 Mike Dev
|
||||
# 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
|
||||
|
||||
# Partial (add_subdirectory only) and experimental CMake support
|
||||
# Subject to change; please do not rely on the contents of this file yet
|
||||
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
project(BoostBind LANGUAGES CXX)
|
||||
|
||||
add_library(boost_bind INTERFACE)
|
||||
add_library(Boost::bind ALIAS boost_bind)
|
||||
|
||||
target_include_directories(boost_bind INTERFACE include)
|
||||
|
||||
target_link_libraries(boost_bind
|
||||
INTERFACE
|
||||
Boost::config
|
||||
Boost::core
|
||||
)
|
||||
6
README.md
Normal file
6
README.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# Boost.Bind
|
||||
|
||||
Branch | Travis | Appveyor
|
||||
---------|--------|---------
|
||||
Develop | [](https://travis-ci.org/boostorg/bind) | [](https://ci.appveyor.com/project/pdimov/bind)
|
||||
Master | [](https://travis-ci.org/boostorg/bind) | [](https://ci.appveyor.com/project/pdimov/bind)
|
||||
61
appveyor.yml
Normal file
61
appveyor.yml
Normal file
@@ -0,0 +1,61 @@
|
||||
# Copyright 2016-2019 Peter Dimov
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
version: 1.0.{build}-{branch}
|
||||
|
||||
shallow_clone: true
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- develop
|
||||
- /feature\/.*/
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0
|
||||
- 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,clang-win
|
||||
CXXSTD: 14,17
|
||||
ADDRESS_MODEL: 32,64
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
ADDPATH: C:\cygwin\bin;
|
||||
TOOLSET: gcc
|
||||
CXXSTD: 03,11,14,1z
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
ADDPATH: C:\cygwin64\bin;
|
||||
TOOLSET: gcc
|
||||
CXXSTD: 03,11,14,1z
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
ADDPATH: C:\mingw\bin;
|
||||
TOOLSET: gcc
|
||||
CXXSTD: 03,11,14,1z
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
ADDPATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;
|
||||
TOOLSET: gcc
|
||||
CXXSTD: 03,11,14,1z
|
||||
|
||||
install:
|
||||
- set BOOST_BRANCH=develop
|
||||
- if "%APPVEYOR_REPO_BRANCH%" == "master" set BOOST_BRANCH=master
|
||||
- cd ..
|
||||
- git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||
- cd boost-root
|
||||
- git submodule update --init tools/boostdep
|
||||
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\bind\
|
||||
- python tools/boostdep/depinst/depinst.py bind
|
||||
- cmd /c bootstrap
|
||||
- b2 -d0 headers
|
||||
|
||||
build: off
|
||||
|
||||
test_script:
|
||||
- PATH=%ADDPATH%%PATH%
|
||||
- if not "%CXXSTD%" == "" set CXXSTD=cxxstd=%CXXSTD%
|
||||
- if not "%ADDRESS_MODEL%" == "" set ADDRESS_MODEL=address-model=%ADDRESS_MODEL%
|
||||
- b2 -j3 libs/bind/test toolset=%TOOLSET% %CXXSTD% %ADDRESS_MODEL% variant=debug,release
|
||||
1
doc/.gitignore
vendored
1
doc/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
/html/
|
||||
@@ -4,8 +4,6 @@
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
project doc/bind ;
|
||||
|
||||
import boostbook ;
|
||||
import quickbook ;
|
||||
|
||||
@@ -27,6 +25,8 @@ boostbook standalone_bind
|
||||
<xsl:param>toc.max.depth=2
|
||||
# How far down we go with TOC's
|
||||
<xsl:param>generate.section.toc.level=0
|
||||
|
||||
<xsl:param>generate.manifest=0
|
||||
;
|
||||
|
||||
xml mem_fn_ : mem_fn.qbk ;
|
||||
@@ -47,4 +47,12 @@ boostbook standalone_mem_fn
|
||||
<xsl:param>toc.max.depth=2
|
||||
# How far down we go with TOC's
|
||||
<xsl:param>generate.section.toc.level=0
|
||||
|
||||
<xsl:param>generate.manifest=0
|
||||
;
|
||||
|
||||
###############################################################################
|
||||
alias boostdoc ;
|
||||
explicit boostdoc ;
|
||||
alias boostrelease : standalone_bind standalone_mem_fn ;
|
||||
explicit boostrelease ;
|
||||
|
||||
@@ -11,15 +11,15 @@
|
||||
|
||||
[section Files]
|
||||
|
||||
* [@../../include/boost/bind.hpp boost/bind.hpp] (main header)
|
||||
* [@../../include/boost/bind/bind_cc.hpp boost/bind/bind_cc.hpp] (used by `bind.hpp`, do not include directly)
|
||||
* [@../../include/boost/bind/bind_mf_cc.hpp boost/bind/bind_mf_cc.hpp] (used by `bind.hpp`, do not include directly)
|
||||
* [@../../include/boost/bind/bind_template.hpp boost/bind/bind_template.hpp] (used by `bind.hpp`, do not include directly)
|
||||
* [@../../include/boost/bind/arg.hpp boost/bind/arg.hpp] (defines the type of the placeholder arguments)
|
||||
* [@../../include/boost/bind/placeholders.hpp boost/bind/placeholders.hpp] (defines the `_1`, `_2`, ... `_9` placeholders)
|
||||
* [@../../include/boost/bind/apply.hpp boost/bind/apply.hpp] (`apply` helper function object)
|
||||
* [@../../include/boost/bind/protect.hpp boost/bind/protect.hpp] (`protect` helper function)
|
||||
* [@../../include/boost/bind/make_adaptable.hpp boost/bind/make_adaptable.hpp] (`make_adaptable` helper function)
|
||||
* [@../../../../boost/bind.hpp boost/bind.hpp] (main header)
|
||||
* [@../../../../boost/bind/bind_cc.hpp boost/bind/bind_cc.hpp] (used by `bind.hpp`, do not include directly)
|
||||
* [@../../../../boost/bind/bind_mf_cc.hpp boost/bind/bind_mf_cc.hpp] (used by `bind.hpp`, do not include directly)
|
||||
* [@../../../../boost/bind/bind_template.hpp boost/bind/bind_template.hpp] (used by `bind.hpp`, do not include directly)
|
||||
* [@../../../../boost/bind/arg.hpp boost/bind/arg.hpp] (defines the type of the placeholder arguments)
|
||||
* [@../../../../boost/bind/placeholders.hpp boost/bind/placeholders.hpp] (defines the `_1`, `_2`, ... `_9` placeholders)
|
||||
* [@../../../../boost/bind/apply.hpp boost/bind/apply.hpp] (`apply` helper function object)
|
||||
* [@../../../../boost/bind/protect.hpp boost/bind/protect.hpp] (`protect` helper function)
|
||||
* [@../../../../boost/bind/make_adaptable.hpp boost/bind/make_adaptable.hpp] (`make_adaptable` helper function)
|
||||
* [@../../test/bind_test.cpp libs/bind/test/bind_test.cpp] (test)
|
||||
* [@../../bind_as_compose.cpp libs/bind/bind_as_compose.cpp] (function composition example)
|
||||
* [@../../bind_visitor.cpp libs/bind/bind_visitor.cpp] (visitor example)
|
||||
|
||||
@@ -178,7 +178,7 @@ Example:
|
||||
The last two examples are interesting in that they produce "self-contained"
|
||||
function objects. `bind(&X::f, x, _1)` stores a copy of `x`.
|
||||
`bind(&X::f, p, _1)` stores a copy of `p`, and since `p` is a
|
||||
[@boost:/libs/smart_ptr/shared_ptr.htm `boost::shared_ptr`], the function
|
||||
[@boost:/libs/smart_ptr/doc/html/smart_ptr.html#shared_ptr `boost::shared_ptr`], the function
|
||||
object retains a reference to its instance of `X` and will remain valid even
|
||||
when `p` goes out of scope or is `reset()`.
|
||||
|
||||
@@ -215,7 +215,7 @@ argument, so the example below does not work as expected:
|
||||
The desired effect can be achieved via a helper function object `apply` that
|
||||
applies its first argument, as a function object, to the rest of its argument
|
||||
list. For convenience, an implementation of `apply` is provided in the
|
||||
[@../../include/boost/bind/apply.hpp apply.hpp] header file. Here is how the
|
||||
[@../../../../boost/bind/apply.hpp apply.hpp] header file. Here is how the
|
||||
modified version of the previous example looks like:
|
||||
|
||||
typedef void (*pf)(int);
|
||||
@@ -230,7 +230,7 @@ with the help of another function object, `protect`, that masks the type so
|
||||
that `bind` does not recognize and evaluate it. When called, protect simply
|
||||
forwards the argument list to the other function object unmodified.
|
||||
|
||||
The header [@../../include/boost/bind/protect.hpp protect.hpp] contains an
|
||||
The header [@../../../../boost/bind/protect.hpp protect.hpp] contains an
|
||||
implementation of `protect`. To `protect` a bind function object from
|
||||
evaluation, use `protect(bind(f, ...))`.
|
||||
|
||||
|
||||
@@ -167,8 +167,8 @@ variable:
|
||||
[section Modeling STL function object concepts]
|
||||
|
||||
The function objects that are produced by `bind` do not model the STL
|
||||
[@http://www.sgi.com/tech/stl/UnaryFunction.html /Unary Function/] or
|
||||
[@http://www.sgi.com/tech/stl/BinaryFunction.html /Binary Function/] concepts,
|
||||
[@https://boost.org/sgi/stl/UnaryFunction.html /Unary Function/] or
|
||||
[@https://boost.org/sgi/stl/BinaryFunction.html /Binary Function/] concepts,
|
||||
even when the function objects are unary or binary operations, because the
|
||||
function object types are missing public typedefs `result_type` and
|
||||
`argument_type` or `first_argument_type` and `second_argument_type`. In cases
|
||||
@@ -179,9 +179,9 @@ these concepts. This allows unary and binary function objects resulting from
|
||||
[@http://en.cppreference.com/w/cpp/utility/functional/unary_negate `std::unary_negate`]
|
||||
and [@http://en.cppreference.com/w/cpp/utility/functional/binary_negate `std::binary_negate`].
|
||||
|
||||
The `make_adaptable` function is defined in [@../../include/boost/bind/make_adaptable.hpp
|
||||
The `make_adaptable` function is defined in [@../../../../boost/bind/make_adaptable.hpp
|
||||
`<boost/bind/make_adaptable.hpp>`], which must be included explicitly in
|
||||
addition to [@../../include/boost/bind.hpp `<boost/bind.hpp>`]:
|
||||
addition to [@../../../../boost/bind.hpp `<boost/bind.hpp>`]:
|
||||
|
||||
#include <boost/bind/make_adaptable.hpp>
|
||||
|
||||
|
||||
1552
doc/html/bind.html
Normal file
1552
doc/html/bind.html
Normal file
File diff suppressed because it is too large
Load Diff
552
doc/html/mem_fn.html
Normal file
552
doc/html/mem_fn.html
Normal file
@@ -0,0 +1,552 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>Chapter 1. Boost.Member Function</title>
|
||||
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
|
||||
<link rel="home" href="mem_fn.html" title="Chapter 1. Boost.Member Function">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav"></div>
|
||||
<div class="chapter">
|
||||
<div class="titlepage"><div>
|
||||
<div><h2 class="title">
|
||||
<a name="mem_fn"></a>Chapter 1. Boost.Member Function</h2></div>
|
||||
<div><p class="copyright">Copyright © 2001, 2002 Peter Dimov and Multi Media Ltd.</p></div>
|
||||
<div><p class="copyright">Copyright © 2003-2005 Peter Dimov</p></div>
|
||||
<div><div class="legalnotice">
|
||||
<a name="mem_fn.legal"></a><p>
|
||||
Distributed under the <a href="http://boost.org/LICENSE_1_0.txt" target="_top">Boost
|
||||
Software License, Version 1.0</a>.
|
||||
</p>
|
||||
</div></div>
|
||||
</div></div>
|
||||
<div class="toc">
|
||||
<p><b>Table of Contents</b></p>
|
||||
<dl class="toc">
|
||||
<dt><span class="section"><a href="mem_fn.html#mem_fn.purpose">Purpose</a></span></dt>
|
||||
<dt><span class="section"><a href="mem_fn.html#mem_fn.faq">Frequently Asked Questions</a></span></dt>
|
||||
<dd><dl>
|
||||
<dt><span class="section"><a href="mem_fn.html#mem_fn.faq.can_mem_fn_be_used_instead_of_th">Can <code class="computeroutput"><span class="identifier">mem_fn</span></code> be used instead of the standard <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">mem_fun</span><span class="special">[</span><span class="identifier">_ref</span><span class="special">]</span></code>
|
||||
adaptors?</a></span></dt>
|
||||
<dt><span class="section"><a href="mem_fn.html#mem_fn.faq.should_i_replace_every_occurence">Should I
|
||||
replace every occurence of <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">mem_fun</span><span class="special">[</span><span class="identifier">_ref</span><span class="special">]</span></code>
|
||||
with <code class="computeroutput"><span class="identifier">mem_fn</span></code> in my existing
|
||||
code?</a></span></dt>
|
||||
<dt><span class="section"><a href="mem_fn.html#mem_fn.faq.does_mem_fn_work_with_com_method">Does <code class="computeroutput"><span class="identifier">mem_fn</span></code> work with COM methods?</a></span></dt>
|
||||
<dt><span class="section"><a href="mem_fn.html#mem_fn.faq.why_isn_t_boost_mem_fn_enable_st">Why isn't
|
||||
<code class="computeroutput"><span class="identifier">BOOST_MEM_FN_ENABLE_STDCALL</span></code>
|
||||
defined automatically?</a></span></dt>
|
||||
</dl></dd>
|
||||
<dt><span class="section"><a href="mem_fn.html#mem_fn.interface">Interface</a></span></dt>
|
||||
<dd><dl>
|
||||
<dt><span class="section"><a href="mem_fn.html#mem_fn.interface.synopsys">Synopsis</a></span></dt>
|
||||
<dt><span class="section"><a href="mem_fn.html#mem_fn.interface.common_requirements">Common requirements</a></span></dt>
|
||||
<dt><span class="section"><a href="mem_fn.html#mem_fn.interface.get_pointer"><code class="computeroutput"><span class="identifier">get_pointer</span></code></a></span></dt>
|
||||
<dt><span class="section"><a href="mem_fn.html#mem_fn.interface.mem_fn"><code class="computeroutput"><span class="identifier">mem_fn</span></code></a></span></dt>
|
||||
</dl></dd>
|
||||
<dt><span class="section"><a href="mem_fn.html#mem_fn.implementation">Implementation</a></span></dt>
|
||||
<dd><dl>
|
||||
<dt><span class="section"><a href="mem_fn.html#mem_fn.implementation.files">Files</a></span></dt>
|
||||
<dt><span class="section"><a href="mem_fn.html#mem_fn.implementation.dependencies">Dependencies</a></span></dt>
|
||||
<dt><span class="section"><a href="mem_fn.html#mem_fn.implementation.number_of_arguments">Number of
|
||||
Arguments</a></span></dt>
|
||||
<dt><span class="section"><a href="mem_fn.html#mem_fn.implementation.stdcall"><code class="computeroutput"><span class="identifier">__stdcall</span></code>,
|
||||
<code class="computeroutput"><span class="identifier">__cdecl</span></code>, and <code class="computeroutput"><span class="identifier">__fastcall</span></code> Support</a></span></dt>
|
||||
</dl></dd>
|
||||
<dt><span class="section"><a href="mem_fn.html#mem_fn.acknowledgements">Acknowledgements</a></span></dt>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="mem_fn.purpose"></a><a class="link" href="mem_fn.html#mem_fn.purpose" title="Purpose">Purpose</a>
|
||||
</h2></div></div></div>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mem_fn</span></code> is a generalization of the standard
|
||||
functions <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">mem_fun</span></code> and <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">mem_fun_ref</span></code>.
|
||||
It supports member function pointers with more than one argument, and the returned
|
||||
function object can take a pointer, a reference, or a smart pointer to an object
|
||||
instance as its first argument. <code class="computeroutput"><span class="identifier">mem_fn</span></code>
|
||||
also supports pointers to data members by treating them as functions taking
|
||||
no arguments and returning a (const) reference to the member.
|
||||
</p>
|
||||
<p>
|
||||
The purpose of <code class="computeroutput"><span class="identifier">mem_fn</span></code> is twofold.
|
||||
First, it allows users to invoke a member function on a container with the
|
||||
familiar
|
||||
</p>
|
||||
<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">mem_fn</span><span class="special">(&</span><span class="identifier">Shape</span><span class="special">::</span><span class="identifier">draw</span><span class="special">));</span>
|
||||
</pre>
|
||||
<p>
|
||||
syntax, even when the container stores smart pointers.
|
||||
</p>
|
||||
<p>
|
||||
Second, it can be used as a building block by library developers that want
|
||||
to treat a pointer to member function as a function object. A library might
|
||||
define an enhanced <code class="computeroutput"><span class="identifier">for_each</span></code>
|
||||
algorithm with an overload of the form:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">It</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="keyword">void</span> <span class="identifier">for_each</span><span class="special">(</span><span class="identifier">It</span> <span class="identifier">first</span><span class="special">,</span> <span class="identifier">It</span> <span class="identifier">last</span><span class="special">,</span> <span class="identifier">R</span> <span class="special">(</span><span class="identifier">T</span><span class="special">::*</span><span class="identifier">pmf</span><span class="special">)</span> <span class="special">())</span>
|
||||
<span class="special">{</span>
|
||||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">mem_fn</span><span class="special">(</span><span class="identifier">pmf</span><span class="special">));</span>
|
||||
<span class="special">}</span>
|
||||
</pre>
|
||||
<p>
|
||||
that will allow the convenient syntax:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> <span class="special">&</span><span class="identifier">Shape</span><span class="special">::</span><span class="identifier">draw</span><span class="special">);</span>
|
||||
</pre>
|
||||
<p>
|
||||
When documenting the feature, the library author will simply state:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">It</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="keyword">void</span> <span class="identifier">for_each</span><span class="special">(</span><span class="identifier">It</span> <span class="identifier">first</span><span class="special">,</span> <span class="identifier">It</span> <span class="identifier">last</span><span class="special">,</span> <span class="identifier">R</span> <span class="special">(</span><span class="identifier">T</span><span class="special">::*</span><span class="identifier">pmf</span><span class="special">)</span> <span class="special">());</span>
|
||||
</pre>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
|
||||
<span class="emphasis"><em>Effects:</em></span> Equivalent to <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">mem_fn</span><span class="special">(</span><span class="identifier">pmf</span><span class="special">))</span></code>.
|
||||
</li></ul></div>
|
||||
<p>
|
||||
where <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mem_fn</span></code> can be a link to this page. See the
|
||||
<a href="../../../../libs/bind/bind.html" target="_top">documentation of <code class="computeroutput"><span class="identifier">bind</span></code></a>
|
||||
for an example.
|
||||
</p>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="identifier">mem_fn</span></code> takes one argument,
|
||||
a pointer to a member, and returns a function object suitable for use with
|
||||
standard or user-defined algorithms:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">X</span>
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">void</span> <span class="identifier">f</span><span class="special">();</span>
|
||||
<span class="special">};</span>
|
||||
|
||||
<span class="keyword">void</span> <span class="identifier">g</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special"><</span><span class="identifier">X</span><span class="special">></span> <span class="special">&</span> <span class="identifier">v</span><span class="special">)</span>
|
||||
<span class="special">{</span>
|
||||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">mem_fn</span><span class="special">(&</span><span class="identifier">X</span><span class="special">::</span><span class="identifier">f</span><span class="special">));</span>
|
||||
<span class="special">};</span>
|
||||
|
||||
<span class="keyword">void</span> <span class="identifier">h</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special"><</span><span class="identifier">X</span> <span class="special">*></span> <span class="keyword">const</span> <span class="special">&</span> <span class="identifier">v</span><span class="special">)</span>
|
||||
<span class="special">{</span>
|
||||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">mem_fn</span><span class="special">(&</span><span class="identifier">X</span><span class="special">::</span><span class="identifier">f</span><span class="special">));</span>
|
||||
<span class="special">};</span>
|
||||
|
||||
<span class="keyword">void</span> <span class="identifier">k</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special"><</span><span class="identifier">X</span><span class="special">></span> <span class="special">></span> <span class="keyword">const</span> <span class="special">&</span> <span class="identifier">v</span><span class="special">)</span>
|
||||
<span class="special">{</span>
|
||||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">for_each</span><span class="special">(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">mem_fn</span><span class="special">(&</span><span class="identifier">X</span><span class="special">::</span><span class="identifier">f</span><span class="special">));</span>
|
||||
<span class="special">};</span>
|
||||
</pre>
|
||||
<p>
|
||||
The returned function object takes the same arguments as the input member function
|
||||
plus a "flexible" first argument that represents the object instance.
|
||||
</p>
|
||||
<p>
|
||||
When the function object is invoked with a first argument <code class="computeroutput"><span class="identifier">x</span></code>
|
||||
that is neither a pointer nor a reference to the appropriate class (<code class="computeroutput"><span class="identifier">X</span></code> in the example above), it uses <code class="computeroutput"><span class="identifier">get_pointer</span><span class="special">(</span><span class="identifier">x</span><span class="special">)</span></code> to obtain
|
||||
a pointer from <code class="computeroutput"><span class="identifier">x</span></code>. Library authors
|
||||
can "register" their smart pointer classes by supplying an appropriate
|
||||
<code class="computeroutput"><span class="identifier">get_pointer</span></code> overload, allowing
|
||||
<code class="computeroutput"><span class="identifier">mem_fn</span></code> to recognize and support
|
||||
them.
|
||||
</p>
|
||||
<p>
|
||||
<span class="emphasis"><em>[Note:</em></span> <code class="computeroutput"><span class="identifier">get_pointer</span></code>
|
||||
is not restricted to return a pointer. Any object that can be used in a member
|
||||
function call expression <code class="computeroutput"><span class="special">(</span><span class="identifier">x</span><span class="special">->*</span><span class="identifier">pmf</span><span class="special">)(...)</span></code> will work.<span class="emphasis"><em>]</em></span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="emphasis"><em>[Note:</em></span> the library uses an unqualified call to <code class="computeroutput"><span class="identifier">get_pointer</span></code>. Therefore, it will find, through
|
||||
argument-dependent lookup, <code class="computeroutput"><span class="identifier">get_pointer</span></code>
|
||||
overloads that are defined in the same namespace as the corresponding smart
|
||||
pointer class, in addition to any <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">get_pointer</span></code>
|
||||
overloads.<span class="emphasis"><em>]</em></span>
|
||||
</p>
|
||||
<p>
|
||||
All function objects returned by <code class="computeroutput"><span class="identifier">mem_fn</span></code>
|
||||
expose a <code class="computeroutput"><span class="identifier">result_type</span></code> typedef
|
||||
that represents the return type of the member function. For data members,
|
||||
<code class="computeroutput"><span class="identifier">result_type</span></code> is defined as the
|
||||
type of the member.
|
||||
</p>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="mem_fn.faq"></a><a class="link" href="mem_fn.html#mem_fn.faq" title="Frequently Asked Questions">Frequently Asked Questions</a>
|
||||
</h2></div></div></div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="mem_fn.faq.can_mem_fn_be_used_instead_of_th"></a><a class="link" href="mem_fn.html#mem_fn.faq.can_mem_fn_be_used_instead_of_th" title="Can mem_fn be used instead of the standard std::mem_fun[_ref] adaptors?">Can <code class="computeroutput"><span class="identifier">mem_fn</span></code> be used instead of the standard <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">mem_fun</span><span class="special">[</span><span class="identifier">_ref</span><span class="special">]</span></code>
|
||||
adaptors?</a>
|
||||
</h3></div></div></div>
|
||||
<p>
|
||||
Yes. For simple uses, <code class="computeroutput"><span class="identifier">mem_fn</span></code>
|
||||
provides additional functionality that the standard adaptors do not. Complicated
|
||||
expressions that use <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">bind1st</span></code>,
|
||||
<code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">bind2nd</span></code> or <a href="http://www.boost.org/doc/libs/1_31_0/libs/compose/index.htm" target="_top">Boost.Compose</a>
|
||||
along with the standard adaptors can be rewritten using <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">bind</span></code>
|
||||
that automatically takes advantage of <code class="computeroutput"><span class="identifier">mem_fn</span></code>.
|
||||
</p>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="mem_fn.faq.should_i_replace_every_occurence"></a><a class="link" href="mem_fn.html#mem_fn.faq.should_i_replace_every_occurence" title="Should I replace every occurence of std::mem_fun[_ref] with mem_fn in my existing code?">Should I
|
||||
replace every occurence of <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">mem_fun</span><span class="special">[</span><span class="identifier">_ref</span><span class="special">]</span></code>
|
||||
with <code class="computeroutput"><span class="identifier">mem_fn</span></code> in my existing
|
||||
code?</a>
|
||||
</h3></div></div></div>
|
||||
<p>
|
||||
No, unless you have good reasons to do so. <code class="computeroutput"><span class="identifier">mem_fn</span></code>
|
||||
is not 100% compatible with the standard adaptors, although it comes pretty
|
||||
close. In particular, <code class="computeroutput"><span class="identifier">mem_fn</span></code>
|
||||
does not return objects of type <code class="computeroutput"><span class="identifier">std</span><span class="special">::[</span><span class="identifier">const_</span><span class="special">]</span><span class="identifier">mem_fun</span><span class="special">[</span><span class="number">1</span><span class="special">][</span><span class="identifier">_ref</span><span class="special">]</span><span class="identifier">_t</span></code>,
|
||||
as the standard adaptors do, and it is not possible to fully describe the
|
||||
type of the first argument using the standard <code class="computeroutput"><span class="identifier">argument_type</span></code>
|
||||
and <code class="computeroutput"><span class="identifier">first_argument_type</span></code> nested
|
||||
typedefs. Libraries that need adaptable function objects in order to function
|
||||
might not like <code class="computeroutput"><span class="identifier">mem_fn</span></code>.
|
||||
</p>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="mem_fn.faq.does_mem_fn_work_with_com_method"></a><a class="link" href="mem_fn.html#mem_fn.faq.does_mem_fn_work_with_com_method" title="Does mem_fn work with COM methods?">Does <code class="computeroutput"><span class="identifier">mem_fn</span></code> work with COM methods?</a>
|
||||
</h3></div></div></div>
|
||||
<p>
|
||||
Yes, if you <a class="link" href="mem_fn.html#mem_fn.implementation.stdcall" title="__stdcall, __cdecl, and __fastcall Support">`#define BOOST_MEM_FN_ENABLE_STDCALL</a>.
|
||||
</p>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="mem_fn.faq.why_isn_t_boost_mem_fn_enable_st"></a><a class="link" href="mem_fn.html#mem_fn.faq.why_isn_t_boost_mem_fn_enable_st" title="Why isn't BOOST_MEM_FN_ENABLE_STDCALL defined automatically?">Why isn't
|
||||
<code class="computeroutput"><span class="identifier">BOOST_MEM_FN_ENABLE_STDCALL</span></code>
|
||||
defined automatically?</a>
|
||||
</h3></div></div></div>
|
||||
<p>
|
||||
Non-portable extensions, in general, should default to off to prevent vendor
|
||||
lock-in. Had <code class="computeroutput"><span class="identifier">BOOST_MEM_FN_ENABLE_STDCALL</span></code>
|
||||
been defined automatically, you could have accidentally taken advantage of
|
||||
it without realizing that your code is, perhaps, no longer portable. In addition,
|
||||
it is possible for the default calling convention to be <code class="computeroutput"><span class="identifier">__stdcall</span></code>,
|
||||
in which case enabling <code class="computeroutput"><span class="identifier">__stdcall</span></code>
|
||||
support will result in duplicate definitions.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="mem_fn.interface"></a><a class="link" href="mem_fn.html#mem_fn.interface" title="Interface">Interface</a>
|
||||
</h2></div></div></div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="mem_fn.interface.synopsys"></a><a class="link" href="mem_fn.html#mem_fn.interface.synopsys" title="Synopsis">Synopsis</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span>
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="identifier">T</span> <span class="special">*</span> <a class="link" href="mem_fn.html#get_pointer_1"><code class="computeroutput"><span class="identifier">get_pointer</span></code></a><span class="special">(</span><span class="identifier">T</span> <span class="special">*</span> <span class="identifier">p</span><span class="special">);</span>
|
||||
|
||||
<span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="emphasis"><em>unspecified-1</em></span> <a class="link" href="mem_fn.html#mem_fn_1"><code class="computeroutput"><span class="identifier">mem_fn</span></code></a><span class="special">(</span><span class="identifier">R</span> <span class="special">(</span><span class="identifier">T</span><span class="special">::*</span><span class="identifier">pmf</span><span class="special">)</span> <span class="special">());</span>
|
||||
|
||||
<span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="emphasis"><em>unspecified-2</em></span> <a class="link" href="mem_fn.html#mem_fn_2"><code class="computeroutput"><span class="identifier">mem_fn</span></code></a><span class="special">(</span><span class="identifier">R</span> <span class="special">(</span><span class="identifier">T</span><span class="special">::*</span><span class="identifier">pmf</span><span class="special">)</span> <span class="special">()</span> <span class="keyword">const</span><span class="special">);</span>
|
||||
|
||||
<span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="emphasis"><em>unspecified-2-1</em></span> <a class="link" href="mem_fn.html#mem_fn_2_1"><code class="computeroutput"><span class="identifier">mem_fn</span></code></a><span class="special">(</span><span class="identifier">R</span> <span class="identifier">T</span><span class="special">::*</span><span class="identifier">pm</span><span class="special">);</span>
|
||||
|
||||
<span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">A1</span><span class="special">></span> <span class="emphasis"><em>unspecified-3</em></span> <a class="link" href="mem_fn.html#mem_fn_3"><code class="computeroutput"><span class="identifier">mem_fn</span></code></a><span class="special">(</span><span class="identifier">R</span> <span class="special">(</span><span class="identifier">T</span><span class="special">::*</span><span class="identifier">pmf</span><span class="special">)</span> <span class="special">(</span><span class="identifier">A1</span><span class="special">));</span>
|
||||
|
||||
<span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">A1</span><span class="special">></span> <span class="emphasis"><em>unspecified-4</em></span> <a class="link" href="mem_fn.html#mem_fn_4"><code class="computeroutput"><span class="identifier">mem_fn</span></code></a><span class="special">(</span><span class="identifier">R</span> <span class="special">(</span><span class="identifier">T</span><span class="special">::*</span><span class="identifier">pmf</span><span class="special">)</span> <span class="special">(</span><span class="identifier">A1</span><span class="special">)</span> <span class="keyword">const</span><span class="special">);</span>
|
||||
|
||||
<span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">A1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">A2</span><span class="special">></span> <span class="emphasis"><em>unspecified-5</em></span> <a class="link" href="mem_fn.html#mem_fn_5"><code class="computeroutput"><span class="identifier">mem_fn</span></code></a><span class="special">(</span><span class="identifier">R</span> <span class="special">(</span><span class="identifier">T</span><span class="special">::*</span><span class="identifier">pmf</span><span class="special">)</span> <span class="special">(</span><span class="identifier">A1</span><span class="special">,</span> <span class="identifier">A2</span><span class="special">));</span>
|
||||
|
||||
<span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">A1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">A2</span><span class="special">></span> <span class="emphasis"><em>unspecified-6</em></span> <a class="link" href="mem_fn.html#mem_fn_6"><code class="computeroutput"><span class="identifier">mem_fn</span></code></a><span class="special">(</span><span class="identifier">R</span> <span class="special">(</span><span class="identifier">T</span><span class="special">::*</span><span class="identifier">pmf</span><span class="special">)</span> <span class="special">(</span><span class="identifier">A1</span><span class="special">,</span> <span class="identifier">A2</span><span class="special">)</span> <span class="keyword">const</span><span class="special">);</span>
|
||||
|
||||
<span class="comment">// implementation defined number of additional overloads for more arguments</span>
|
||||
<span class="special">}</span>
|
||||
</pre>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="mem_fn.interface.common_requirements"></a><a class="link" href="mem_fn.html#mem_fn.interface.common_requirements" title="Common requirements">Common requirements</a>
|
||||
</h3></div></div></div>
|
||||
<p>
|
||||
All <span class="emphasis"><em>unspecified-N</em></span> types mentioned in the Synopsis are
|
||||
<span class="emphasis"><em>CopyConstructible</em></span> and <span class="emphasis"><em>Assignable</em></span>.
|
||||
Their copy constructors and assignment operators do not throw exceptions.
|
||||
<span class="emphasis"><em>unspecified-N</em></span><code class="computeroutput"><span class="special">::</span><span class="identifier">result_type</span></code> is defined as the return type
|
||||
of the member function pointer passed as an argument to <code class="computeroutput"><span class="identifier">mem_fn</span></code>
|
||||
(<code class="computeroutput"><span class="identifier">R</span></code> in the Synopsis.) <span class="emphasis"><em>unspecified-2-1</em></span><code class="computeroutput"><span class="special">::</span><span class="identifier">result_type</span></code>
|
||||
is defined as <code class="computeroutput"><span class="identifier">R</span></code>.
|
||||
</p>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="mem_fn.interface.get_pointer"></a><a class="link" href="mem_fn.html#mem_fn.interface.get_pointer" title="get_pointer"><code class="computeroutput"><span class="identifier">get_pointer</span></code></a>
|
||||
</h3></div></div></div>
|
||||
<a name="get_pointer_1"></a><pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="identifier">T</span> <span class="special">*</span> <span class="identifier">get_pointer</span><span class="special">(</span><span class="identifier">T</span> <span class="special">*</span> <span class="identifier">p</span><span class="special">)</span>
|
||||
</pre>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||||
<li class="listitem">
|
||||
<span class="emphasis"><em>Returns:</em></span> <code class="computeroutput"><span class="identifier">p</span></code>.
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<span class="emphasis"><em>Throws:</em></span> Nothing.
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="mem_fn.interface.mem_fn"></a><a class="link" href="mem_fn.html#mem_fn.interface.mem_fn" title="mem_fn"><code class="computeroutput"><span class="identifier">mem_fn</span></code></a>
|
||||
</h3></div></div></div>
|
||||
<a name="mem_fn_1"></a><pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="emphasis"><em>unspecified-1</em></span> <span class="identifier">mem_fn</span><span class="special">(</span><span class="identifier">R</span> <span class="special">(</span><span class="identifier">T</span><span class="special">::*</span><span class="identifier">pmf</span><span class="special">)</span> <span class="special">())</span>
|
||||
</pre>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||||
<li class="listitem">
|
||||
<span class="emphasis"><em>Returns:</em></span> a function object ϝ such that the
|
||||
expression ϝ<code class="computeroutput"><span class="special">(</span><span class="identifier">t</span><span class="special">)</span></code> is equivalent to <code class="computeroutput"><span class="special">(</span><span class="identifier">t</span><span class="special">.*</span><span class="identifier">pmf</span><span class="special">)()</span></code>
|
||||
when <code class="computeroutput"><span class="identifier">t</span></code> is an l-value
|
||||
of type <code class="computeroutput"><span class="identifier">T</span></code> or derived,
|
||||
<code class="computeroutput"><span class="special">(</span><span class="identifier">get_pointer</span><span class="special">(</span><span class="identifier">t</span><span class="special">)->*</span><span class="identifier">pmf</span><span class="special">)()</span></code> otherwise.
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<span class="emphasis"><em>Throws:</em></span> Nothing.
|
||||
</li>
|
||||
</ul></div>
|
||||
<a name="mem_fn_2"></a><pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="emphasis"><em>unspecified-2</em></span> <span class="identifier">mem_fn</span><span class="special">(</span><span class="identifier">R</span> <span class="special">(</span><span class="identifier">T</span><span class="special">::*</span><span class="identifier">pmf</span><span class="special">)</span> <span class="special">()</span> <span class="keyword">const</span><span class="special">)</span>
|
||||
</pre>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||||
<li class="listitem">
|
||||
<span class="emphasis"><em>Returns:</em></span> a function object ϝ such that the
|
||||
expression ϝ<code class="computeroutput"><span class="special">(</span><span class="identifier">t</span><span class="special">)</span></code> is equivalent to <code class="computeroutput"><span class="special">(</span><span class="identifier">t</span><span class="special">.*</span><span class="identifier">pmf</span><span class="special">)()</span></code>
|
||||
when <code class="computeroutput"><span class="identifier">t</span></code> is of type <code class="computeroutput"><span class="identifier">T</span></code> <span class="emphasis"><em>[</em></span><code class="computeroutput"><span class="keyword">const</span></code><span class="emphasis"><em>]</em></span> or derived,
|
||||
<code class="computeroutput"><span class="special">(</span><span class="identifier">get_pointer</span><span class="special">(</span><span class="identifier">t</span><span class="special">)->*</span><span class="identifier">pmf</span><span class="special">)()</span></code> otherwise.
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<span class="emphasis"><em>Throws:</em></span> Nothing.
|
||||
</li>
|
||||
</ul></div>
|
||||
<a name="mem_fn_2_1"></a><pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="emphasis"><em>unspecified-2-1</em></span> <span class="identifier">mem_fn</span><span class="special">(</span><span class="identifier">R</span> <span class="identifier">T</span><span class="special">::*</span><span class="identifier">pm</span><span class="special">)</span>
|
||||
</pre>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||||
<li class="listitem">
|
||||
<span class="emphasis"><em>Returns:</em></span> a function object ϝ such that the
|
||||
expression ϝ<code class="computeroutput"><span class="special">(</span><span class="identifier">t</span><span class="special">)</span></code> is equivalent to <code class="computeroutput"><span class="identifier">t</span><span class="special">.*</span><span class="identifier">pm</span></code>
|
||||
when <code class="computeroutput"><span class="identifier">t</span></code> is of type <code class="computeroutput"><span class="identifier">T</span></code> <span class="emphasis"><em>[</em></span><code class="computeroutput"><span class="keyword">const</span></code><span class="emphasis"><em>]</em></span> or derived,
|
||||
<code class="computeroutput"><span class="identifier">get_pointer</span><span class="special">(</span><span class="identifier">t</span><span class="special">)->*</span><span class="identifier">pm</span></code> otherwise.
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<span class="emphasis"><em>Throws:</em></span> Nothing.
|
||||
</li>
|
||||
</ul></div>
|
||||
<a name="mem_fn_3"></a><pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">A1</span><span class="special">></span> <span class="emphasis"><em>unspecified-3</em></span> <span class="identifier">mem_fn</span><span class="special">(</span><span class="identifier">R</span> <span class="special">(</span><span class="identifier">T</span><span class="special">::*</span><span class="identifier">pmf</span><span class="special">)</span> <span class="special">(</span><span class="identifier">A1</span><span class="special">))</span>
|
||||
</pre>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||||
<li class="listitem">
|
||||
<span class="emphasis"><em>Returns:</em></span> a function object ϝ such that the
|
||||
expression ϝ<code class="computeroutput"><span class="special">(</span><span class="identifier">t</span><span class="special">,</span> <span class="identifier">a1</span><span class="special">)</span></code> is equivalent to <code class="computeroutput"><span class="special">(</span><span class="identifier">t</span><span class="special">.*</span><span class="identifier">pmf</span><span class="special">)(</span><span class="identifier">a1</span><span class="special">)</span></code>
|
||||
when <code class="computeroutput"><span class="identifier">t</span></code> is an l-value
|
||||
of type <code class="computeroutput"><span class="identifier">T</span></code> or derived,
|
||||
<code class="computeroutput"><span class="special">(</span><span class="identifier">get_pointer</span><span class="special">(</span><span class="identifier">t</span><span class="special">)->*</span><span class="identifier">pmf</span><span class="special">)(</span><span class="identifier">a1</span><span class="special">)</span></code> otherwise.
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<span class="emphasis"><em>Throws:</em></span> Nothing.
|
||||
</li>
|
||||
</ul></div>
|
||||
<a name="mem_fn_4"></a><pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">A1</span><span class="special">></span> <span class="emphasis"><em>unspecified-4</em></span> <span class="identifier">mem_fn</span><span class="special">(</span><span class="identifier">R</span> <span class="special">(</span><span class="identifier">T</span><span class="special">::*</span><span class="identifier">pmf</span><span class="special">)</span> <span class="special">(</span><span class="identifier">A1</span><span class="special">)</span> <span class="keyword">const</span><span class="special">)</span>
|
||||
</pre>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||||
<li class="listitem">
|
||||
<span class="emphasis"><em>Returns:</em></span> a function object ϝ such that the
|
||||
expression ϝ<code class="computeroutput"><span class="special">(</span><span class="identifier">t</span><span class="special">,</span> <span class="identifier">a1</span><span class="special">)</span></code> is equivalent to <code class="computeroutput"><span class="special">(</span><span class="identifier">t</span><span class="special">.*</span><span class="identifier">pmf</span><span class="special">)(</span><span class="identifier">a1</span><span class="special">)</span></code>
|
||||
when <code class="computeroutput"><span class="identifier">t</span></code> is of type <code class="computeroutput"><span class="identifier">T</span></code> <span class="emphasis"><em>[</em></span><code class="computeroutput"><span class="keyword">const</span></code><span class="emphasis"><em>]</em></span> or derived,
|
||||
<code class="computeroutput"><span class="special">(</span><span class="identifier">get_pointer</span><span class="special">(</span><span class="identifier">t</span><span class="special">)->*</span><span class="identifier">pmf</span><span class="special">)(</span><span class="identifier">a1</span><span class="special">)</span></code> otherwise.
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<span class="emphasis"><em>Throws:</em></span> Nothing.
|
||||
</li>
|
||||
</ul></div>
|
||||
<a name="mem_fn_5"></a><pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">A1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">A2</span><span class="special">></span> <span class="emphasis"><em>unspecified-5</em></span> <span class="identifier">mem_fn</span><span class="special">(</span><span class="identifier">R</span> <span class="special">(</span><span class="identifier">T</span><span class="special">::*</span><span class="identifier">pmf</span><span class="special">)</span> <span class="special">(</span><span class="identifier">A1</span><span class="special">,</span> <span class="identifier">A2</span><span class="special">))</span>
|
||||
</pre>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||||
<li class="listitem">
|
||||
<span class="emphasis"><em>Returns:</em></span> a function object ϝ such that the
|
||||
expression ϝ<code class="computeroutput"><span class="special">(</span><span class="identifier">t</span><span class="special">,</span> <span class="identifier">a1</span><span class="special">,</span> <span class="identifier">a2</span><span class="special">)</span></code> is equivalent to <code class="computeroutput"><span class="special">(</span><span class="identifier">t</span><span class="special">.*</span><span class="identifier">pmf</span><span class="special">)(</span><span class="identifier">a1</span><span class="special">,</span> <span class="identifier">a2</span><span class="special">)</span></code>
|
||||
when <code class="computeroutput"><span class="identifier">t</span></code> is an l-value
|
||||
of type <code class="computeroutput"><span class="identifier">T</span></code> or derived,
|
||||
<code class="computeroutput"><span class="special">(</span><span class="identifier">get_pointer</span><span class="special">(</span><span class="identifier">t</span><span class="special">)->*</span><span class="identifier">pmf</span><span class="special">)(</span><span class="identifier">a1</span><span class="special">,</span> <span class="identifier">a2</span><span class="special">)</span></code> otherwise.
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<span class="emphasis"><em>Throws:</em></span> Nothing.
|
||||
</li>
|
||||
</ul></div>
|
||||
<a name="mem_fn_6"></a><pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">A1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">A2</span><span class="special">></span> <span class="emphasis"><em>unspecified-6</em></span> <span class="identifier">mem_fn</span><span class="special">(</span><span class="identifier">R</span> <span class="special">(</span><span class="identifier">T</span><span class="special">::*</span><span class="identifier">pmf</span><span class="special">)</span> <span class="special">(</span><span class="identifier">A1</span><span class="special">,</span> <span class="identifier">A2</span><span class="special">)</span> <span class="keyword">const</span><span class="special">)</span>
|
||||
</pre>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||||
<li class="listitem">
|
||||
<span class="emphasis"><em>Returns:</em></span> a function object ϝ such that the
|
||||
expression ϝ<code class="computeroutput"><span class="special">(</span><span class="identifier">t</span><span class="special">,</span> <span class="identifier">a1</span><span class="special">,</span> <span class="identifier">a2</span><span class="special">)</span></code> is equivalent to <code class="computeroutput"><span class="special">(</span><span class="identifier">t</span><span class="special">.*</span><span class="identifier">pmf</span><span class="special">)(</span><span class="identifier">a1</span><span class="special">,</span> <span class="identifier">a2</span><span class="special">)</span></code>
|
||||
when <code class="computeroutput"><span class="identifier">t</span></code> is of type <code class="computeroutput"><span class="identifier">T</span></code> <span class="emphasis"><em>[</em></span><code class="computeroutput"><span class="keyword">const</span></code><span class="emphasis"><em>]</em></span> or derived,
|
||||
<code class="computeroutput"><span class="special">(</span><span class="identifier">get_pointer</span><span class="special">(</span><span class="identifier">t</span><span class="special">)->*</span><span class="identifier">pmf</span><span class="special">)(</span><span class="identifier">a1</span><span class="special">,</span> <span class="identifier">a2</span><span class="special">)</span></code> otherwise.
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<span class="emphasis"><em>Throws:</em></span> Nothing.
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="mem_fn.implementation"></a><a class="link" href="mem_fn.html#mem_fn.implementation" title="Implementation">Implementation</a>
|
||||
</h2></div></div></div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="mem_fn.implementation.files"></a><a class="link" href="mem_fn.html#mem_fn.implementation.files" title="Files">Files</a>
|
||||
</h3></div></div></div>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||||
<li class="listitem">
|
||||
<a href="../../../../boost/mem_fn.hpp" target="_top">boost/mem_fn.hpp</a> (main
|
||||
header)
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<a href="../../../../boost/bind/mem_fn_cc.hpp" target="_top">boost/bind/mem_fn_cc.hpp</a>
|
||||
(used by <code class="computeroutput"><span class="identifier">mem_fn</span><span class="special">.</span><span class="identifier">hpp</span></code>, do not include directly)
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<a href="../../../../boost/bind/mem_fn_vw.hpp" target="_top">boost/bind/mem_fn_vw.hpp</a>
|
||||
(used by <code class="computeroutput"><span class="identifier">mem_fn</span><span class="special">.</span><span class="identifier">hpp</span></code>, do not include directly)
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<a href="../../../../boost/bind/mem_fn_template.hpp" target="_top">boost/bind/mem_fn_template.hpp</a>
|
||||
(used by <code class="computeroutput"><span class="identifier">mem_fn</span><span class="special">.</span><span class="identifier">hpp</span></code>, do not include directly)
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<a href="../../test/mem_fn_test.cpp" target="_top">libs/bind/test/mem_fn_test.cpp</a>
|
||||
(test)
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<a href="../../test/mem_fn_derived_test.cpp" target="_top">libs/bind/test/mem_fn_derived_test.cpp</a>
|
||||
(test with derived objects)
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<a href="../../test/mem_fn_fastcall_test.cpp" target="_top">libs/bind/test/mem_fn_fastcall_test.cpp</a>
|
||||
(test for <code class="computeroutput"><span class="identifier">__fastcall</span></code>)
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<a href="../../test/mem_fn_stdcall_test.cpp" target="_top">libs/bind/test/mem_fn_stdcall_test.cpp</a>
|
||||
(test for <code class="computeroutput"><span class="identifier">__stdcall</span></code>)
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<a href="../../test/mem_fn_void_test.cpp" target="_top">libs/bind/test/mem_fn_void_test.cpp</a>
|
||||
(test for <code class="computeroutput"><span class="keyword">void</span></code> returns)
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="mem_fn.implementation.dependencies"></a><a class="link" href="mem_fn.html#mem_fn.implementation.dependencies" title="Dependencies">Dependencies</a>
|
||||
</h3></div></div></div>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
|
||||
<a href="../../../../libs/config/config.htm" target="_top">Boost.Config</a>
|
||||
</li></ul></div>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="mem_fn.implementation.number_of_arguments"></a><a class="link" href="mem_fn.html#mem_fn.implementation.number_of_arguments" title="Number of Arguments">Number of
|
||||
Arguments</a>
|
||||
</h3></div></div></div>
|
||||
<p>
|
||||
This implementation supports member functions with up to eight arguments.
|
||||
This is not an inherent limitation of the design, but an implementation detail.
|
||||
</p>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="mem_fn.implementation.stdcall"></a><a class="link" href="mem_fn.html#mem_fn.implementation.stdcall" title="__stdcall, __cdecl, and __fastcall Support"><code class="computeroutput"><span class="identifier">__stdcall</span></code>,
|
||||
<code class="computeroutput"><span class="identifier">__cdecl</span></code>, and <code class="computeroutput"><span class="identifier">__fastcall</span></code> Support</a>
|
||||
</h3></div></div></div>
|
||||
<p>
|
||||
Some platforms allow several types of member functions that differ by their
|
||||
calling convention (the rules by which the function is invoked: how are arguments
|
||||
passed, how is the return value handled, and who cleans up the stack - if
|
||||
any.)
|
||||
</p>
|
||||
<p>
|
||||
For example, Windows API functions and COM interface member functions use
|
||||
a calling convention known as <code class="computeroutput"><span class="identifier">__stdcall</span></code>.
|
||||
Borland VCL components use <code class="computeroutput"><span class="identifier">__fastcall</span></code>.
|
||||
UDK, the component model of OpenOffice.org, uses <code class="computeroutput"><span class="identifier">__cdecl</span></code>.
|
||||
</p>
|
||||
<p>
|
||||
To use <code class="computeroutput"><span class="identifier">mem_fn</span></code> with <code class="computeroutput"><span class="identifier">__stdcall</span></code> member functions, <code class="computeroutput"><span class="preprocessor">#define</span></code> the macro <code class="computeroutput"><span class="identifier">BOOST_MEM_FN_ENABLE_STDCALL</span></code>
|
||||
before including <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">mem_fn</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>.
|
||||
</p>
|
||||
<p>
|
||||
To use <code class="computeroutput"><span class="identifier">mem_fn</span></code> with <code class="computeroutput"><span class="identifier">__fastcall</span></code> member functions, <code class="computeroutput"><span class="preprocessor">#define</span></code> the macro <code class="computeroutput"><span class="identifier">BOOST_MEM_FN_ENABLE_FASTCALL</span></code>
|
||||
before including <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">mem_fn</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>.
|
||||
</p>
|
||||
<p>
|
||||
To use <code class="computeroutput"><span class="identifier">mem_fn</span></code> with <code class="computeroutput"><span class="identifier">__cdecl</span></code> member functions, <code class="computeroutput"><span class="preprocessor">#define</span></code> the macro <code class="computeroutput"><span class="identifier">BOOST_MEM_FN_ENABLE_CDECL</span></code>
|
||||
before including <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">mem_fn</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>It is best to define these macros in the project options,
|
||||
via <code class="computeroutput"><span class="special">-</span><span class="identifier">D</span></code>
|
||||
on the command line, or as the first line in the translation unit (.cpp file)
|
||||
where <code class="computeroutput"><span class="identifier">mem_fn</span></code> is used.</strong></span>
|
||||
Not following this rule can lead to obscure errors when a header includes
|
||||
<code class="computeroutput"><span class="identifier">mem_fn</span><span class="special">.</span><span class="identifier">hpp</span></code> before the macro has been defined.
|
||||
</p>
|
||||
<p>
|
||||
<span class="emphasis"><em>[Note:</em></span> this is a non-portable extension. It is not part
|
||||
of the interface.<span class="emphasis"><em>]</em></span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="emphasis"><em>[Note:</em></span> Some compilers provide only minimal support for
|
||||
the <code class="computeroutput"><span class="identifier">__stdcall</span></code> keyword.<span class="emphasis"><em>]</em></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="mem_fn.acknowledgements"></a><a class="link" href="mem_fn.html#mem_fn.acknowledgements" title="Acknowledgements">Acknowledgements</a>
|
||||
</h2></div></div></div>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||||
<li class="listitem">
|
||||
Rene Jager's initial suggestion of using traits classes to make <code class="computeroutput"><span class="identifier">mem_fn</span></code> adapt to user-defined smart pointers
|
||||
inspired the <code class="computeroutput"><span class="identifier">get_pointer</span></code>-based
|
||||
design.
|
||||
</li>
|
||||
<li class="listitem">
|
||||
Numerous improvements were suggested during the formal review period by
|
||||
Richard Crossley, Jens Maurer, Ed Brey, and others. Review manager was
|
||||
Darin Adler.
|
||||
</li>
|
||||
<li class="listitem">
|
||||
Steve Anichini pointed out that COM interfaces use <code class="computeroutput"><span class="identifier">__stdcall</span></code>.
|
||||
</li>
|
||||
<li class="listitem">
|
||||
Dave Abrahams modified <code class="computeroutput"><span class="identifier">bind</span></code>
|
||||
and <code class="computeroutput"><span class="identifier">mem_fn</span></code> to support
|
||||
<code class="computeroutput"><span class="keyword">void</span></code> returns on deficient
|
||||
compilers.
|
||||
</li>
|
||||
<li class="listitem">
|
||||
Daniel Boelzle pointed out that UDK uses <code class="computeroutput"><span class="identifier">__cdecl</span></code>.
|
||||
</li>
|
||||
</ul></div>
|
||||
<p>
|
||||
This documentation was ported to Quickbook by Agustín Bergé.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"><p><small>Last revised: July 07, 2017 at 11:19:31 GMT</small></p></td>
|
||||
<td align="right"><div class="copyright-footer"></div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav"></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -11,10 +11,10 @@
|
||||
|
||||
[section Files]
|
||||
|
||||
* [@../../include/boost/mem_fn.hpp boost/mem_fn.hpp] (main header)
|
||||
* [@../../include/boost/bind/mem_fn_cc.hpp boost/bind/mem_fn_cc.hpp] (used by `mem_fn.hpp`, do not include directly)
|
||||
* [@../../include/boost/bind/mem_fn_vw.hpp boost/bind/mem_fn_vw.hpp] (used by `mem_fn.hpp`, do not include directly)
|
||||
* [@../../include/boost/bind/mem_fn_template.hpp boost/bind/mem_fn_template.hpp] (used by `mem_fn.hpp`, do not include directly)
|
||||
* [@../../../../boost/mem_fn.hpp boost/mem_fn.hpp] (main header)
|
||||
* [@../../../../boost/bind/mem_fn_cc.hpp boost/bind/mem_fn_cc.hpp] (used by `mem_fn.hpp`, do not include directly)
|
||||
* [@../../../../boost/bind/mem_fn_vw.hpp boost/bind/mem_fn_vw.hpp] (used by `mem_fn.hpp`, do not include directly)
|
||||
* [@../../../../boost/bind/mem_fn_template.hpp boost/bind/mem_fn_template.hpp] (used by `mem_fn.hpp`, do not include directly)
|
||||
* [@../../test/mem_fn_test.cpp libs/bind/test/mem_fn_test.cpp] (test)
|
||||
* [@../../test/mem_fn_derived_test.cpp libs/bind/test/mem_fn_derived_test.cpp] (test with derived objects)
|
||||
* [@../../test/mem_fn_fastcall_test.cpp libs/bind/test/mem_fn_fastcall_test.cpp] (test for `__fastcall`)
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
//
|
||||
// bind.hpp - binds function objects to arguments
|
||||
//
|
||||
// Copyright (c) 2009 Peter Dimov
|
||||
// Copyright (c) 2009, 2015 Peter Dimov
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -21,4 +21,21 @@
|
||||
|
||||
#include <boost/bind/bind.hpp>
|
||||
|
||||
#ifndef BOOST_BIND_NO_PLACEHOLDERS
|
||||
|
||||
#if defined(BOOST_CLANG)
|
||||
# pragma clang diagnostic push
|
||||
# if __has_warning("-Wheader-hygiene")
|
||||
# pragma clang diagnostic ignored "-Wheader-hygiene"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
using namespace boost::placeholders;
|
||||
|
||||
#if defined(BOOST_CLANG)
|
||||
# pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
#endif // #ifndef BOOST_BIND_NO_PLACEHOLDERS
|
||||
|
||||
#endif // #ifndef BOOST_BIND_HPP_INCLUDED
|
||||
|
||||
@@ -21,24 +21,31 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/is_placeholder.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
template<bool Eq> struct _arg_eq
|
||||
{
|
||||
};
|
||||
|
||||
template<> struct _arg_eq<true>
|
||||
{
|
||||
typedef void type;
|
||||
};
|
||||
|
||||
template< int I > struct arg
|
||||
{
|
||||
arg()
|
||||
BOOST_CONSTEXPR arg()
|
||||
{
|
||||
}
|
||||
|
||||
template< class T > arg( T const & /* t */ )
|
||||
template< class T > BOOST_CONSTEXPR arg( T const & /* t */, typename _arg_eq< I == is_placeholder<T>::value >::type * = 0 )
|
||||
{
|
||||
BOOST_STATIC_ASSERT( I == is_placeholder<T>::value );
|
||||
}
|
||||
};
|
||||
|
||||
template< int I > bool operator==( arg<I> const &, arg<I> const & )
|
||||
template< int I > BOOST_CONSTEXPR bool operator==( arg<I> const &, arg<I> const & )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -21,6 +21,23 @@
|
||||
// See http://www.boost.org/libs/bind/bind.html for documentation.
|
||||
//
|
||||
|
||||
#if 1
|
||||
|
||||
#include <boost/ref.hpp>
|
||||
#include <boost/mem_fn.hpp>
|
||||
#include <functional>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
using std::bind;
|
||||
|
||||
namespace placeholders = std::placeholders;
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#else
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/ref.hpp>
|
||||
#include <boost/mem_fn.hpp>
|
||||
@@ -32,6 +49,10 @@
|
||||
#include <boost/core/enable_if.hpp>
|
||||
#include <boost/core/is_same.hpp>
|
||||
|
||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
#include <utility> // std::forward
|
||||
#endif
|
||||
|
||||
// Borland-specific bug, visit_each() silently fails to produce code
|
||||
|
||||
#if defined(__BORLANDC__)
|
||||
@@ -863,14 +884,409 @@ public:
|
||||
|
||||
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
|
||||
|
||||
template< class A > struct list_add_cref
|
||||
template< class A1 > class rrlist1
|
||||
{
|
||||
typedef A const & type;
|
||||
private:
|
||||
|
||||
A1 & a1_; // not A1&& because of msvc-10.0
|
||||
|
||||
public:
|
||||
|
||||
explicit rrlist1( A1 & a1 ): a1_( a1 ) {}
|
||||
|
||||
A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); } // not static_cast because of g++ 4.9
|
||||
|
||||
A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
|
||||
|
||||
template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
|
||||
|
||||
template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
|
||||
|
||||
template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
|
||||
|
||||
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
|
||||
{
|
||||
rrlist1<A1&> a( a1_ );
|
||||
return b.eval( a );
|
||||
}
|
||||
|
||||
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
|
||||
{
|
||||
rrlist1<A1&> a( a1_ );
|
||||
return b.eval( a );
|
||||
}
|
||||
};
|
||||
|
||||
template< class A > struct list_add_cref< A& >
|
||||
template< class A1, class A2 > class rrlist2
|
||||
{
|
||||
typedef A & type;
|
||||
private:
|
||||
|
||||
A1 & a1_;
|
||||
A2 & a2_;
|
||||
|
||||
public:
|
||||
|
||||
rrlist2( A1 & a1, A2 & a2 ): a1_( a1 ), a2_( a2 ) {}
|
||||
|
||||
A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
|
||||
A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
|
||||
|
||||
A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
|
||||
A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
|
||||
|
||||
template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
|
||||
|
||||
template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
|
||||
|
||||
template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
|
||||
|
||||
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
|
||||
{
|
||||
rrlist2<A1&, A2&> a( a1_, a2_ );
|
||||
return b.eval( a );
|
||||
}
|
||||
|
||||
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
|
||||
{
|
||||
rrlist2<A1&, A2&> a( a1_, a2_ );
|
||||
return b.eval( a );
|
||||
}
|
||||
};
|
||||
|
||||
template< class A1, class A2, class A3 > class rrlist3
|
||||
{
|
||||
private:
|
||||
|
||||
A1 & a1_;
|
||||
A2 & a2_;
|
||||
A3 & a3_;
|
||||
|
||||
public:
|
||||
|
||||
rrlist3( A1 & a1, A2 & a2, A3 & a3 ): a1_( a1 ), a2_( a2 ), a3_( a3 ) {}
|
||||
|
||||
A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
|
||||
A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
|
||||
A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
|
||||
|
||||
A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
|
||||
A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
|
||||
A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
|
||||
|
||||
template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
|
||||
|
||||
template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
|
||||
|
||||
template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
|
||||
|
||||
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
|
||||
{
|
||||
rrlist3<A1&, A2&, A3&> a( a1_, a2_, a3_ );
|
||||
return b.eval( a );
|
||||
}
|
||||
|
||||
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
|
||||
{
|
||||
rrlist3<A1&, A2&, A3&> a( a1_, a2_, a3_ );
|
||||
return b.eval( a );
|
||||
}
|
||||
};
|
||||
|
||||
template< class A1, class A2, class A3, class A4 > class rrlist4
|
||||
{
|
||||
private:
|
||||
|
||||
A1 & a1_;
|
||||
A2 & a2_;
|
||||
A3 & a3_;
|
||||
A4 & a4_;
|
||||
|
||||
public:
|
||||
|
||||
rrlist4( A1 & a1, A2 & a2, A3 & a3, A4 & a4 ): a1_( a1 ), a2_( a2 ), a3_( a3 ), a4_( a4 ) {}
|
||||
|
||||
A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
|
||||
A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
|
||||
A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
|
||||
A4 && operator[] (boost::arg<4>) const { return std::forward<A4>( a4_ ); }
|
||||
|
||||
A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
|
||||
A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
|
||||
A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
|
||||
A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward<A4>( a4_ ); }
|
||||
|
||||
template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
|
||||
|
||||
template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
|
||||
|
||||
template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
|
||||
|
||||
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
|
||||
{
|
||||
rrlist4<A1&, A2&, A3&, A4&> a( a1_, a2_, a3_, a4_ );
|
||||
return b.eval( a );
|
||||
}
|
||||
|
||||
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
|
||||
{
|
||||
rrlist4<A1&, A2&, A3&, A4&> a( a1_, a2_, a3_, a4_ );
|
||||
return b.eval( a );
|
||||
}
|
||||
};
|
||||
|
||||
template< class A1, class A2, class A3, class A4, class A5 > class rrlist5
|
||||
{
|
||||
private:
|
||||
|
||||
A1 & a1_;
|
||||
A2 & a2_;
|
||||
A3 & a3_;
|
||||
A4 & a4_;
|
||||
A5 & a5_;
|
||||
|
||||
public:
|
||||
|
||||
rrlist5( A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5 ): a1_( a1 ), a2_( a2 ), a3_( a3 ), a4_( a4 ), a5_( a5 ) {}
|
||||
|
||||
A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
|
||||
A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
|
||||
A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
|
||||
A4 && operator[] (boost::arg<4>) const { return std::forward<A4>( a4_ ); }
|
||||
A5 && operator[] (boost::arg<5>) const { return std::forward<A5>( a5_ ); }
|
||||
|
||||
A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
|
||||
A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
|
||||
A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
|
||||
A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward<A4>( a4_ ); }
|
||||
A5 && operator[] (boost::arg<5> (*) ()) const { return std::forward<A5>( a5_ ); }
|
||||
|
||||
template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
|
||||
|
||||
template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
|
||||
|
||||
template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
|
||||
|
||||
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
|
||||
{
|
||||
rrlist5<A1&, A2&, A3&, A4&, A5&> a( a1_, a2_, a3_, a4_, a5_ );
|
||||
return b.eval( a );
|
||||
}
|
||||
|
||||
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
|
||||
{
|
||||
rrlist5<A1&, A2&, A3&, A4&, A5&> a( a1_, a2_, a3_, a4_, a5_ );
|
||||
return b.eval( a );
|
||||
}
|
||||
};
|
||||
|
||||
template< class A1, class A2, class A3, class A4, class A5, class A6 > class rrlist6
|
||||
{
|
||||
private:
|
||||
|
||||
A1 & a1_;
|
||||
A2 & a2_;
|
||||
A3 & a3_;
|
||||
A4 & a4_;
|
||||
A5 & a5_;
|
||||
A6 & a6_;
|
||||
|
||||
public:
|
||||
|
||||
rrlist6( A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6 ): a1_( a1 ), a2_( a2 ), a3_( a3 ), a4_( a4 ), a5_( a5 ), a6_( a6 ) {}
|
||||
|
||||
A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
|
||||
A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
|
||||
A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
|
||||
A4 && operator[] (boost::arg<4>) const { return std::forward<A4>( a4_ ); }
|
||||
A5 && operator[] (boost::arg<5>) const { return std::forward<A5>( a5_ ); }
|
||||
A6 && operator[] (boost::arg<6>) const { return std::forward<A6>( a6_ ); }
|
||||
|
||||
A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
|
||||
A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
|
||||
A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
|
||||
A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward<A4>( a4_ ); }
|
||||
A5 && operator[] (boost::arg<5> (*) ()) const { return std::forward<A5>( a5_ ); }
|
||||
A6 && operator[] (boost::arg<6> (*) ()) const { return std::forward<A6>( a6_ ); }
|
||||
|
||||
template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
|
||||
|
||||
template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
|
||||
|
||||
template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
|
||||
|
||||
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
|
||||
{
|
||||
rrlist6<A1&, A2&, A3&, A4&, A5&, A6&> a( a1_, a2_, a3_, a4_, a5_, a6_ );
|
||||
return b.eval( a );
|
||||
}
|
||||
|
||||
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
|
||||
{
|
||||
rrlist6<A1&, A2&, A3&, A4&, A5&, A6&> a( a1_, a2_, a3_, a4_, a5_, a6_ );
|
||||
return b.eval( a );
|
||||
}
|
||||
};
|
||||
|
||||
template< class A1, class A2, class A3, class A4, class A5, class A6, class A7 > class rrlist7
|
||||
{
|
||||
private:
|
||||
|
||||
A1 & a1_;
|
||||
A2 & a2_;
|
||||
A3 & a3_;
|
||||
A4 & a4_;
|
||||
A5 & a5_;
|
||||
A6 & a6_;
|
||||
A7 & a7_;
|
||||
|
||||
public:
|
||||
|
||||
rrlist7( A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7 ): a1_( a1 ), a2_( a2 ), a3_( a3 ), a4_( a4 ), a5_( a5 ), a6_( a6 ), a7_( a7 ) {}
|
||||
|
||||
A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
|
||||
A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
|
||||
A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
|
||||
A4 && operator[] (boost::arg<4>) const { return std::forward<A4>( a4_ ); }
|
||||
A5 && operator[] (boost::arg<5>) const { return std::forward<A5>( a5_ ); }
|
||||
A6 && operator[] (boost::arg<6>) const { return std::forward<A6>( a6_ ); }
|
||||
A7 && operator[] (boost::arg<7>) const { return std::forward<A7>( a7_ ); }
|
||||
|
||||
A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
|
||||
A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
|
||||
A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
|
||||
A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward<A4>( a4_ ); }
|
||||
A5 && operator[] (boost::arg<5> (*) ()) const { return std::forward<A5>( a5_ ); }
|
||||
A6 && operator[] (boost::arg<6> (*) ()) const { return std::forward<A6>( a6_ ); }
|
||||
A7 && operator[] (boost::arg<7> (*) ()) const { return std::forward<A7>( a7_ ); }
|
||||
|
||||
template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
|
||||
|
||||
template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
|
||||
|
||||
template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
|
||||
|
||||
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
|
||||
{
|
||||
rrlist7<A1&, A2&, A3&, A4&, A5&, A6&, A7&> a( a1_, a2_, a3_, a4_, a5_, a6_, a7_ );
|
||||
return b.eval( a );
|
||||
}
|
||||
|
||||
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
|
||||
{
|
||||
rrlist7<A1&, A2&, A3&, A4&, A5&, A6&, A7&> a( a1_, a2_, a3_, a4_, a5_, a6_, a7_ );
|
||||
return b.eval( a );
|
||||
}
|
||||
};
|
||||
|
||||
template< class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 > class rrlist8
|
||||
{
|
||||
private:
|
||||
|
||||
A1 & a1_;
|
||||
A2 & a2_;
|
||||
A3 & a3_;
|
||||
A4 & a4_;
|
||||
A5 & a5_;
|
||||
A6 & a6_;
|
||||
A7 & a7_;
|
||||
A8 & a8_;
|
||||
|
||||
public:
|
||||
|
||||
rrlist8( A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8 ): a1_( a1 ), a2_( a2 ), a3_( a3 ), a4_( a4 ), a5_( a5 ), a6_( a6 ), a7_( a7 ), a8_( a8 ) {}
|
||||
|
||||
A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
|
||||
A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
|
||||
A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
|
||||
A4 && operator[] (boost::arg<4>) const { return std::forward<A4>( a4_ ); }
|
||||
A5 && operator[] (boost::arg<5>) const { return std::forward<A5>( a5_ ); }
|
||||
A6 && operator[] (boost::arg<6>) const { return std::forward<A6>( a6_ ); }
|
||||
A7 && operator[] (boost::arg<7>) const { return std::forward<A7>( a7_ ); }
|
||||
A8 && operator[] (boost::arg<8>) const { return std::forward<A8>( a8_ ); }
|
||||
|
||||
A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
|
||||
A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
|
||||
A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
|
||||
A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward<A4>( a4_ ); }
|
||||
A5 && operator[] (boost::arg<5> (*) ()) const { return std::forward<A5>( a5_ ); }
|
||||
A6 && operator[] (boost::arg<6> (*) ()) const { return std::forward<A6>( a6_ ); }
|
||||
A7 && operator[] (boost::arg<7> (*) ()) const { return std::forward<A7>( a7_ ); }
|
||||
A8 && operator[] (boost::arg<8> (*) ()) const { return std::forward<A8>( a8_ ); }
|
||||
|
||||
template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
|
||||
|
||||
template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
|
||||
|
||||
template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
|
||||
|
||||
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
|
||||
{
|
||||
rrlist8<A1&, A2&, A3&, A4&, A5&, A6&, A7&, A8&> a( a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_ );
|
||||
return b.eval( a );
|
||||
}
|
||||
|
||||
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
|
||||
{
|
||||
rrlist8<A1&, A2&, A3&, A4&, A5&, A6&, A7&, A8&> a( a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_ );
|
||||
return b.eval( a );
|
||||
}
|
||||
};
|
||||
|
||||
template< class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 > class rrlist9
|
||||
{
|
||||
private:
|
||||
|
||||
A1 & a1_;
|
||||
A2 & a2_;
|
||||
A3 & a3_;
|
||||
A4 & a4_;
|
||||
A5 & a5_;
|
||||
A6 & a6_;
|
||||
A7 & a7_;
|
||||
A8 & a8_;
|
||||
A9 & a9_;
|
||||
|
||||
public:
|
||||
|
||||
rrlist9( A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9 ): a1_( a1 ), a2_( a2 ), a3_( a3 ), a4_( a4 ), a5_( a5 ), a6_( a6 ), a7_( a7 ), a8_( a8 ), a9_( a9 ) {}
|
||||
|
||||
A1 && operator[] (boost::arg<1>) const { return std::forward<A1>( a1_ ); }
|
||||
A2 && operator[] (boost::arg<2>) const { return std::forward<A2>( a2_ ); }
|
||||
A3 && operator[] (boost::arg<3>) const { return std::forward<A3>( a3_ ); }
|
||||
A4 && operator[] (boost::arg<4>) const { return std::forward<A4>( a4_ ); }
|
||||
A5 && operator[] (boost::arg<5>) const { return std::forward<A5>( a5_ ); }
|
||||
A6 && operator[] (boost::arg<6>) const { return std::forward<A6>( a6_ ); }
|
||||
A7 && operator[] (boost::arg<7>) const { return std::forward<A7>( a7_ ); }
|
||||
A8 && operator[] (boost::arg<8>) const { return std::forward<A8>( a8_ ); }
|
||||
A9 && operator[] (boost::arg<9>) const { return std::forward<A9>( a9_ ); }
|
||||
|
||||
A1 && operator[] (boost::arg<1> (*) ()) const { return std::forward<A1>( a1_ ); }
|
||||
A2 && operator[] (boost::arg<2> (*) ()) const { return std::forward<A2>( a2_ ); }
|
||||
A3 && operator[] (boost::arg<3> (*) ()) const { return std::forward<A3>( a3_ ); }
|
||||
A4 && operator[] (boost::arg<4> (*) ()) const { return std::forward<A4>( a4_ ); }
|
||||
A5 && operator[] (boost::arg<5> (*) ()) const { return std::forward<A5>( a5_ ); }
|
||||
A6 && operator[] (boost::arg<6> (*) ()) const { return std::forward<A6>( a6_ ); }
|
||||
A7 && operator[] (boost::arg<7> (*) ()) const { return std::forward<A7>( a7_ ); }
|
||||
A8 && operator[] (boost::arg<8> (*) ()) const { return std::forward<A8>( a8_ ); }
|
||||
A9 && operator[] (boost::arg<9> (*) ()) const { return std::forward<A9>( a9_ ); }
|
||||
|
||||
template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
|
||||
|
||||
template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
|
||||
|
||||
template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
|
||||
|
||||
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const
|
||||
{
|
||||
rrlist9<A1&, A2&, A3&, A4&, A5&, A6&, A7&, A8&, A9&> a( a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_ );
|
||||
return b.eval( a );
|
||||
}
|
||||
|
||||
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const
|
||||
{
|
||||
rrlist9<A1&, A2&, A3&, A4&, A5&, A6&, A7&, A8&, A9&> a( a1_, a2_, a3_, a4_, a5_, a6_, a7_, a8_, a9_ );
|
||||
return b.eval( a );
|
||||
}
|
||||
};
|
||||
|
||||
template<class R, class F, class L> class bind_t
|
||||
@@ -903,221 +1319,109 @@ public:
|
||||
|
||||
template<class A1> result_type operator()( A1 && a1 )
|
||||
{
|
||||
list1< typename list_add_cref<A1>::type > a( a1 );
|
||||
rrlist1< A1 > a( a1 );
|
||||
return l_( type<result_type>(), f_, a, 0 );
|
||||
}
|
||||
|
||||
template<class A1> result_type operator()( A1 && a1 ) const
|
||||
{
|
||||
list1< typename list_add_cref<A1>::type > a( a1 );
|
||||
rrlist1< A1 > a( a1 );
|
||||
return l_(type<result_type>(), f_, a, 0);
|
||||
}
|
||||
|
||||
template<class A1, class A2> result_type operator()( A1 && a1, A2 && a2 )
|
||||
{
|
||||
list2< typename list_add_cref<A1>::type, typename list_add_cref<A2>::type > a( a1, a2 );
|
||||
rrlist2< A1, A2 > a( a1, a2 );
|
||||
return l_( type<result_type>(), f_, a, 0 );
|
||||
}
|
||||
|
||||
template<class A1, class A2> result_type operator()( A1 && a1, A2 && a2 ) const
|
||||
{
|
||||
list2< typename list_add_cref<A1>::type, typename list_add_cref<A2>::type > a( a1, a2 );
|
||||
rrlist2< A1, A2 > a( a1, a2 );
|
||||
return l_( type<result_type>(), f_, a, 0 );
|
||||
}
|
||||
|
||||
template<class A1, class A2, class A3> result_type operator()( A1 && a1, A2 && a2, A3 && a3 )
|
||||
{
|
||||
list3<
|
||||
typename list_add_cref<A1>::type,
|
||||
typename list_add_cref<A2>::type,
|
||||
typename list_add_cref<A3>::type
|
||||
> a( a1, a2, a3 );
|
||||
|
||||
rrlist3< A1, A2, A3 > a( a1, a2, a3 );
|
||||
return l_( type<result_type>(), f_, a, 0 );
|
||||
}
|
||||
|
||||
template<class A1, class A2, class A3> result_type operator()( A1 && a1, A2 && a2, A3 && a3 ) const
|
||||
{
|
||||
list3<
|
||||
typename list_add_cref<A1>::type,
|
||||
typename list_add_cref<A2>::type,
|
||||
typename list_add_cref<A3>::type
|
||||
> a( a1, a2, a3 );
|
||||
|
||||
rrlist3< A1, A2, A3 > a( a1, a2, a3 );
|
||||
return l_( type<result_type>(), f_, a, 0 );
|
||||
}
|
||||
|
||||
template<class A1, class A2, class A3, class A4> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4 )
|
||||
{
|
||||
list4<
|
||||
typename list_add_cref<A1>::type,
|
||||
typename list_add_cref<A2>::type,
|
||||
typename list_add_cref<A3>::type,
|
||||
typename list_add_cref<A4>::type
|
||||
> a( a1, a2, a3, a4 );
|
||||
|
||||
rrlist4< A1, A2, A3, A4 > a( a1, a2, a3, a4 );
|
||||
return l_( type<result_type>(), f_, a, 0 );
|
||||
}
|
||||
|
||||
template<class A1, class A2, class A3, class A4> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4 ) const
|
||||
{
|
||||
list4<
|
||||
typename list_add_cref<A1>::type,
|
||||
typename list_add_cref<A2>::type,
|
||||
typename list_add_cref<A3>::type,
|
||||
typename list_add_cref<A4>::type
|
||||
> a( a1, a2, a3, a4 );
|
||||
|
||||
rrlist4< A1, A2, A3, A4 > a( a1, a2, a3, a4 );
|
||||
return l_( type<result_type>(), f_, a, 0 );
|
||||
}
|
||||
|
||||
template<class A1, class A2, class A3, class A4, class A5> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5 )
|
||||
{
|
||||
list5<
|
||||
typename list_add_cref<A1>::type,
|
||||
typename list_add_cref<A2>::type,
|
||||
typename list_add_cref<A3>::type,
|
||||
typename list_add_cref<A4>::type,
|
||||
typename list_add_cref<A5>::type
|
||||
> a( a1, a2, a3, a4, a5 );
|
||||
|
||||
rrlist5< A1, A2, A3, A4, A5 > a( a1, a2, a3, a4, a5 );
|
||||
return l_( type<result_type>(), f_, a, 0 );
|
||||
}
|
||||
|
||||
template<class A1, class A2, class A3, class A4, class A5> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5 ) const
|
||||
{
|
||||
list5<
|
||||
typename list_add_cref<A1>::type,
|
||||
typename list_add_cref<A2>::type,
|
||||
typename list_add_cref<A3>::type,
|
||||
typename list_add_cref<A4>::type,
|
||||
typename list_add_cref<A5>::type
|
||||
> a( a1, a2, a3, a4, a5 );
|
||||
|
||||
rrlist5< A1, A2, A3, A4, A5 > a( a1, a2, a3, a4, a5 );
|
||||
return l_( type<result_type>(), f_, a, 0 );
|
||||
}
|
||||
|
||||
template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6 )
|
||||
{
|
||||
list6<
|
||||
typename list_add_cref<A1>::type,
|
||||
typename list_add_cref<A2>::type,
|
||||
typename list_add_cref<A3>::type,
|
||||
typename list_add_cref<A4>::type,
|
||||
typename list_add_cref<A5>::type,
|
||||
typename list_add_cref<A6>::type
|
||||
> a( a1, a2, a3, a4, a5, a6 );
|
||||
|
||||
rrlist6< A1, A2, A3, A4, A5, A6 > a( a1, a2, a3, a4, a5, a6 );
|
||||
return l_( type<result_type>(), f_, a, 0 );
|
||||
}
|
||||
|
||||
template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6 ) const
|
||||
{
|
||||
list6<
|
||||
typename list_add_cref<A1>::type,
|
||||
typename list_add_cref<A2>::type,
|
||||
typename list_add_cref<A3>::type,
|
||||
typename list_add_cref<A4>::type,
|
||||
typename list_add_cref<A5>::type,
|
||||
typename list_add_cref<A6>::type
|
||||
> a( a1, a2, a3, a4, a5, a6 );
|
||||
|
||||
rrlist6< A1, A2, A3, A4, A5, A6 > a( a1, a2, a3, a4, a5, a6 );
|
||||
return l_( type<result_type>(), f_, a, 0 );
|
||||
}
|
||||
|
||||
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7 )
|
||||
{
|
||||
list7<
|
||||
typename list_add_cref<A1>::type,
|
||||
typename list_add_cref<A2>::type,
|
||||
typename list_add_cref<A3>::type,
|
||||
typename list_add_cref<A4>::type,
|
||||
typename list_add_cref<A5>::type,
|
||||
typename list_add_cref<A6>::type,
|
||||
typename list_add_cref<A7>::type
|
||||
> a( a1, a2, a3, a4, a5, a6, a7 );
|
||||
|
||||
rrlist7< A1, A2, A3, A4, A5, A6, A7 > a( a1, a2, a3, a4, a5, a6, a7 );
|
||||
return l_( type<result_type>(), f_, a, 0 );
|
||||
}
|
||||
|
||||
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7 ) const
|
||||
{
|
||||
list7<
|
||||
typename list_add_cref<A1>::type,
|
||||
typename list_add_cref<A2>::type,
|
||||
typename list_add_cref<A3>::type,
|
||||
typename list_add_cref<A4>::type,
|
||||
typename list_add_cref<A5>::type,
|
||||
typename list_add_cref<A6>::type,
|
||||
typename list_add_cref<A7>::type
|
||||
> a( a1, a2, a3, a4, a5, a6, a7 );
|
||||
|
||||
rrlist7< A1, A2, A3, A4, A5, A6, A7 > a( a1, a2, a3, a4, a5, a6, a7 );
|
||||
return l_( type<result_type>(), f_, a, 0 );
|
||||
}
|
||||
|
||||
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8 )
|
||||
{
|
||||
list8<
|
||||
typename list_add_cref<A1>::type,
|
||||
typename list_add_cref<A2>::type,
|
||||
typename list_add_cref<A3>::type,
|
||||
typename list_add_cref<A4>::type,
|
||||
typename list_add_cref<A5>::type,
|
||||
typename list_add_cref<A6>::type,
|
||||
typename list_add_cref<A7>::type,
|
||||
typename list_add_cref<A8>::type
|
||||
> a( a1, a2, a3, a4, a5, a6, a7, a8 );
|
||||
|
||||
rrlist8< A1, A2, A3, A4, A5, A6, A7, A8 > a( a1, a2, a3, a4, a5, a6, a7, a8 );
|
||||
return l_( type<result_type>(), f_, a, 0 );
|
||||
}
|
||||
|
||||
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8 ) const
|
||||
{
|
||||
list8<
|
||||
typename list_add_cref<A1>::type,
|
||||
typename list_add_cref<A2>::type,
|
||||
typename list_add_cref<A3>::type,
|
||||
typename list_add_cref<A4>::type,
|
||||
typename list_add_cref<A5>::type,
|
||||
typename list_add_cref<A6>::type,
|
||||
typename list_add_cref<A7>::type,
|
||||
typename list_add_cref<A8>::type
|
||||
> a( a1, a2, a3, a4, a5, a6, a7, a8 );
|
||||
|
||||
rrlist8< A1, A2, A3, A4, A5, A6, A7, A8 > a( a1, a2, a3, a4, a5, a6, a7, a8 );
|
||||
return l_( type<result_type>(), f_, a, 0 );
|
||||
}
|
||||
|
||||
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8, A9 && a9 )
|
||||
{
|
||||
list9<
|
||||
typename list_add_cref<A1>::type,
|
||||
typename list_add_cref<A2>::type,
|
||||
typename list_add_cref<A3>::type,
|
||||
typename list_add_cref<A4>::type,
|
||||
typename list_add_cref<A5>::type,
|
||||
typename list_add_cref<A6>::type,
|
||||
typename list_add_cref<A7>::type,
|
||||
typename list_add_cref<A8>::type,
|
||||
typename list_add_cref<A9>::type
|
||||
> a( a1, a2, a3, a4, a5, a6, a7, a8, a9 );
|
||||
|
||||
rrlist9< A1, A2, A3, A4, A5, A6, A7, A8, A9 > a( a1, a2, a3, a4, a5, a6, a7, a8, a9 );
|
||||
return l_( type<result_type>(), f_, a, 0 );
|
||||
}
|
||||
|
||||
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8, A9 && a9 ) const
|
||||
{
|
||||
list9<
|
||||
typename list_add_cref<A1>::type,
|
||||
typename list_add_cref<A2>::type,
|
||||
typename list_add_cref<A3>::type,
|
||||
typename list_add_cref<A4>::type,
|
||||
typename list_add_cref<A5>::type,
|
||||
typename list_add_cref<A6>::type,
|
||||
typename list_add_cref<A7>::type,
|
||||
typename list_add_cref<A8>::type,
|
||||
typename list_add_cref<A9>::type
|
||||
> a( a1, a2, a3, a4, a5, a6, a7, a8, a9 );
|
||||
|
||||
rrlist9< A1, A2, A3, A4, A5, A6, A7, A8, A9 > a( a1, a2, a3, a4, a5, a6, a7, a8, a9 );
|
||||
return l_( type<result_type>(), f_, a, 0 );
|
||||
}
|
||||
|
||||
@@ -1835,33 +2139,45 @@ template<class F, class A1, class A2, class A3, class A4, class A5, class A6, cl
|
||||
|
||||
#define BOOST_BIND_CC
|
||||
#define BOOST_BIND_ST
|
||||
#define BOOST_BIND_NOEXCEPT
|
||||
|
||||
#include <boost/bind/bind_cc.hpp>
|
||||
|
||||
# if defined( __cpp_noexcept_function_type ) || defined( _NOEXCEPT_TYPES_SUPPORTED )
|
||||
# undef BOOST_BIND_NOEXCEPT
|
||||
# define BOOST_BIND_NOEXCEPT noexcept
|
||||
# include <boost/bind/bind_cc.hpp>
|
||||
# endif
|
||||
|
||||
#undef BOOST_BIND_CC
|
||||
#undef BOOST_BIND_ST
|
||||
#undef BOOST_BIND_NOEXCEPT
|
||||
|
||||
#ifdef BOOST_BIND_ENABLE_STDCALL
|
||||
#if defined(BOOST_BIND_ENABLE_STDCALL) && !defined(_M_X64)
|
||||
|
||||
#define BOOST_BIND_CC __stdcall
|
||||
#define BOOST_BIND_ST
|
||||
#define BOOST_BIND_NOEXCEPT
|
||||
|
||||
#include <boost/bind/bind_cc.hpp>
|
||||
|
||||
#undef BOOST_BIND_CC
|
||||
#undef BOOST_BIND_ST
|
||||
#undef BOOST_BIND_NOEXCEPT
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_BIND_ENABLE_FASTCALL
|
||||
#if defined(BOOST_BIND_ENABLE_FASTCALL) && !defined(_M_X64)
|
||||
|
||||
#define BOOST_BIND_CC __fastcall
|
||||
#define BOOST_BIND_ST
|
||||
#define BOOST_BIND_NOEXCEPT
|
||||
|
||||
#include <boost/bind/bind_cc.hpp>
|
||||
|
||||
#undef BOOST_BIND_CC
|
||||
#undef BOOST_BIND_ST
|
||||
#undef BOOST_BIND_NOEXCEPT
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1869,11 +2185,13 @@ template<class F, class A1, class A2, class A3, class A4, class A5, class A6, cl
|
||||
|
||||
#define BOOST_BIND_ST pascal
|
||||
#define BOOST_BIND_CC
|
||||
#define BOOST_BIND_NOEXCEPT
|
||||
|
||||
#include <boost/bind/bind_cc.hpp>
|
||||
|
||||
#undef BOOST_BIND_ST
|
||||
#undef BOOST_BIND_CC
|
||||
#undef BOOST_BIND_NOEXCEPT
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1881,49 +2199,63 @@ template<class F, class A1, class A2, class A3, class A4, class A5, class A6, cl
|
||||
|
||||
#define BOOST_BIND_MF_NAME(X) X
|
||||
#define BOOST_BIND_MF_CC
|
||||
#define BOOST_BIND_MF_NOEXCEPT
|
||||
|
||||
#include <boost/bind/bind_mf_cc.hpp>
|
||||
#include <boost/bind/bind_mf2_cc.hpp>
|
||||
|
||||
# if defined( __cpp_noexcept_function_type ) || defined( _NOEXCEPT_TYPES_SUPPORTED )
|
||||
# undef BOOST_BIND_MF_NOEXCEPT
|
||||
# define BOOST_BIND_MF_NOEXCEPT noexcept
|
||||
# include <boost/bind/bind_mf_cc.hpp>
|
||||
# endif
|
||||
|
||||
#undef BOOST_BIND_MF_NAME
|
||||
#undef BOOST_BIND_MF_CC
|
||||
#undef BOOST_BIND_MF_NOEXCEPT
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_CDECL
|
||||
#if defined(BOOST_MEM_FN_ENABLE_CDECL) && !defined(_M_X64)
|
||||
|
||||
#define BOOST_BIND_MF_NAME(X) X##_cdecl
|
||||
#define BOOST_BIND_MF_CC __cdecl
|
||||
#define BOOST_BIND_MF_NOEXCEPT
|
||||
|
||||
#include <boost/bind/bind_mf_cc.hpp>
|
||||
#include <boost/bind/bind_mf2_cc.hpp>
|
||||
|
||||
#undef BOOST_BIND_MF_NAME
|
||||
#undef BOOST_BIND_MF_CC
|
||||
#undef BOOST_BIND_MF_NOEXCEPT
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_STDCALL
|
||||
#if defined(BOOST_MEM_FN_ENABLE_STDCALL) && !defined(_M_X64)
|
||||
|
||||
#define BOOST_BIND_MF_NAME(X) X##_stdcall
|
||||
#define BOOST_BIND_MF_CC __stdcall
|
||||
#define BOOST_BIND_MF_NOEXCEPT
|
||||
|
||||
#include <boost/bind/bind_mf_cc.hpp>
|
||||
#include <boost/bind/bind_mf2_cc.hpp>
|
||||
|
||||
#undef BOOST_BIND_MF_NAME
|
||||
#undef BOOST_BIND_MF_CC
|
||||
#undef BOOST_BIND_MF_NOEXCEPT
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_FASTCALL
|
||||
#if defined(BOOST_MEM_FN_ENABLE_FASTCALL) && !defined(_M_X64)
|
||||
|
||||
#define BOOST_BIND_MF_NAME(X) X##_fastcall
|
||||
#define BOOST_BIND_MF_CC __fastcall
|
||||
#define BOOST_BIND_MF_NOEXCEPT
|
||||
|
||||
#include <boost/bind/bind_mf_cc.hpp>
|
||||
#include <boost/bind/bind_mf2_cc.hpp>
|
||||
|
||||
#undef BOOST_BIND_MF_NAME
|
||||
#undef BOOST_BIND_MF_CC
|
||||
#undef BOOST_BIND_MF_NOEXCEPT
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1977,6 +2309,15 @@ template< class R, class T > struct add_cref< R (T::*) () const, 1 >
|
||||
typedef void type;
|
||||
};
|
||||
|
||||
#if defined( __cpp_noexcept_function_type ) || defined( _NOEXCEPT_TYPES_SUPPORTED )
|
||||
|
||||
template< class R, class T > struct add_cref< R (T::*) () const noexcept, 1 >
|
||||
{
|
||||
typedef void type;
|
||||
};
|
||||
|
||||
#endif // __cpp_noexcept_function_type
|
||||
|
||||
#endif // __IBMCPP__
|
||||
|
||||
template<class R> struct isref
|
||||
@@ -2038,4 +2379,6 @@ BOOST_BIND( M T::*f, A1 a1 )
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif // #ifndef BOOST_BIND_BIND_HPP_INCLUDED
|
||||
|
||||
@@ -13,28 +13,28 @@
|
||||
//
|
||||
|
||||
template<class R>
|
||||
_bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (), _bi::list0>
|
||||
BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) ())
|
||||
_bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) () BOOST_BIND_NOEXCEPT, _bi::list0>
|
||||
BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) () BOOST_BIND_NOEXCEPT)
|
||||
{
|
||||
typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) ();
|
||||
typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) () BOOST_BIND_NOEXCEPT;
|
||||
typedef _bi::list0 list_type;
|
||||
return _bi::bind_t<R, F, list_type> (f, list_type());
|
||||
}
|
||||
|
||||
template<class R, class B1, class A1>
|
||||
_bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1), typename _bi::list_av_1<A1>::type>
|
||||
BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1), A1 a1)
|
||||
_bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1) BOOST_BIND_NOEXCEPT, typename _bi::list_av_1<A1>::type>
|
||||
BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1) BOOST_BIND_NOEXCEPT, A1 a1)
|
||||
{
|
||||
typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1);
|
||||
typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1) BOOST_BIND_NOEXCEPT;
|
||||
typedef typename _bi::list_av_1<A1>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type> (f, list_type(a1));
|
||||
}
|
||||
|
||||
template<class R, class B1, class B2, class A1, class A2>
|
||||
_bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2), typename _bi::list_av_2<A1, A2>::type>
|
||||
BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2), A1 a1, A2 a2)
|
||||
_bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2) BOOST_BIND_NOEXCEPT, typename _bi::list_av_2<A1, A2>::type>
|
||||
BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2)
|
||||
{
|
||||
typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2);
|
||||
typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2) BOOST_BIND_NOEXCEPT;
|
||||
typedef typename _bi::list_av_2<A1, A2>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
|
||||
}
|
||||
@@ -42,10 +42,10 @@ template<class R, class B1, class B2, class A1, class A2>
|
||||
template<class R,
|
||||
class B1, class B2, class B3,
|
||||
class A1, class A2, class A3>
|
||||
_bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3), typename _bi::list_av_3<A1, A2, A3>::type>
|
||||
BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3), A1 a1, A2 a2, A3 a3)
|
||||
_bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3) BOOST_BIND_NOEXCEPT, typename _bi::list_av_3<A1, A2, A3>::type>
|
||||
BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2, A3 a3)
|
||||
{
|
||||
typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3);
|
||||
typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3) BOOST_BIND_NOEXCEPT;
|
||||
typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
|
||||
}
|
||||
@@ -53,10 +53,10 @@ template<class R,
|
||||
template<class R,
|
||||
class B1, class B2, class B3, class B4,
|
||||
class A1, class A2, class A3, class A4>
|
||||
_bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4), typename _bi::list_av_4<A1, A2, A3, A4>::type>
|
||||
BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4), A1 a1, A2 a2, A3 a3, A4 a4)
|
||||
_bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4) BOOST_BIND_NOEXCEPT, typename _bi::list_av_4<A1, A2, A3, A4>::type>
|
||||
BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4)
|
||||
{
|
||||
typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4);
|
||||
typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4) BOOST_BIND_NOEXCEPT;
|
||||
typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
|
||||
}
|
||||
@@ -64,10 +64,10 @@ template<class R,
|
||||
template<class R,
|
||||
class B1, class B2, class B3, class B4, class B5,
|
||||
class A1, class A2, class A3, class A4, class A5>
|
||||
_bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4, B5), typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
|
||||
BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
|
||||
_bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4, B5) BOOST_BIND_NOEXCEPT, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
|
||||
BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
|
||||
{
|
||||
typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5);
|
||||
typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5) BOOST_BIND_NOEXCEPT;
|
||||
typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
|
||||
}
|
||||
@@ -75,10 +75,10 @@ template<class R,
|
||||
template<class R,
|
||||
class B1, class B2, class B3, class B4, class B5, class B6,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6>
|
||||
_bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4, B5, B6), typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
|
||||
BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
|
||||
_bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4, B5, B6) BOOST_BIND_NOEXCEPT, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
|
||||
BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
|
||||
{
|
||||
typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5, B6);
|
||||
typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5, B6) BOOST_BIND_NOEXCEPT;
|
||||
typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
|
||||
}
|
||||
@@ -86,10 +86,10 @@ template<class R,
|
||||
template<class R,
|
||||
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>
|
||||
_bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4, B5, B6, B7), typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
|
||||
BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6, B7), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
|
||||
_bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4, B5, B6, B7) BOOST_BIND_NOEXCEPT, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
|
||||
BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6, B7) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
|
||||
{
|
||||
typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5, B6, B7);
|
||||
typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5, B6, B7) BOOST_BIND_NOEXCEPT;
|
||||
typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
|
||||
}
|
||||
@@ -97,10 +97,10 @@ template<class R,
|
||||
template<class R,
|
||||
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>
|
||||
_bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4, B5, B6, B7, B8), typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
|
||||
BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *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)
|
||||
_bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4, B5, B6, B7, B8) BOOST_BIND_NOEXCEPT, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
|
||||
BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6, B7, B8) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
|
||||
{
|
||||
typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5, B6, B7, B8);
|
||||
typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5, B6, B7, B8) BOOST_BIND_NOEXCEPT;
|
||||
typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
|
||||
}
|
||||
@@ -108,10 +108,10 @@ template<class R,
|
||||
template<class R,
|
||||
class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8, class B9,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
|
||||
_bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4, B5, B6, B7, B8, B9), typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
|
||||
BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6, B7, B8, B9), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
|
||||
_bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4, B5, B6, B7, B8, B9) BOOST_BIND_NOEXCEPT, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
|
||||
BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6, B7, B8, B9) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
|
||||
{
|
||||
typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5, B6, B7, B8, B9);
|
||||
typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5, B6, B7, B8, B9) BOOST_BIND_NOEXCEPT;
|
||||
typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
|
||||
return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
template<class R, class T,
|
||||
class A1>
|
||||
_bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf0)<R, T>, typename _bi::list_av_1<A1>::type>
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (), A1 a1)
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) () BOOST_BIND_MF_NOEXCEPT, A1 a1)
|
||||
{
|
||||
typedef _mfi::BOOST_BIND_MF_NAME(mf0)<R, T> F;
|
||||
typedef typename _bi::list_av_1<A1>::type list_type;
|
||||
@@ -27,7 +27,7 @@ template<class R, class T,
|
||||
template<class R, class T,
|
||||
class A1>
|
||||
_bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf0)<R, T>, typename _bi::list_av_1<A1>::type>
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) () const, A1 a1)
|
||||
BOOST_BIND(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 typename _bi::list_av_1<A1>::type list_type;
|
||||
@@ -38,7 +38,7 @@ template<class Rt2, class R, class T,
|
||||
class A1>
|
||||
typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
|
||||
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf0)<R, T>, typename _bi::list_av_1<A1>::type>
|
||||
>::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (), A1 a1)
|
||||
>::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) () BOOST_BIND_MF_NOEXCEPT, A1 a1)
|
||||
{
|
||||
typedef _mfi::BOOST_BIND_MF_NAME(mf0)<R, T> F;
|
||||
typedef typename _bi::list_av_1<A1>::type list_type;
|
||||
@@ -49,7 +49,7 @@ template<class Rt2, class R, class T,
|
||||
class A1>
|
||||
typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
|
||||
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf0)<R, T>, typename _bi::list_av_1<A1>::type>
|
||||
>::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) () const, A1 a1)
|
||||
>::type BOOST_BIND(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 typename _bi::list_av_1<A1>::type list_type;
|
||||
@@ -62,7 +62,7 @@ template<class R, class T,
|
||||
class B1,
|
||||
class A1, class A2>
|
||||
_bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf1)<R, T, B1>, typename _bi::list_av_2<A1, A2>::type>
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1), A1 a1, A2 a2)
|
||||
BOOST_BIND(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 typename _bi::list_av_2<A1, A2>::type list_type;
|
||||
@@ -73,7 +73,7 @@ template<class R, class T,
|
||||
class B1,
|
||||
class A1, class A2>
|
||||
_bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf1)<R, T, B1>, typename _bi::list_av_2<A1, A2>::type>
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1) const, A1 a1, A2 a2)
|
||||
BOOST_BIND(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 typename _bi::list_av_2<A1, A2>::type list_type;
|
||||
@@ -85,7 +85,7 @@ template<class Rt2, class R, class T,
|
||||
class A1, class A2>
|
||||
typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
|
||||
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf1)<R, T, B1>, typename _bi::list_av_2<A1, A2>::type>
|
||||
>::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1), A1 a1, A2 a2)
|
||||
>::type BOOST_BIND(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 typename _bi::list_av_2<A1, A2>::type list_type;
|
||||
@@ -97,7 +97,7 @@ template<class Rt2, class R, class T,
|
||||
class A1, class A2>
|
||||
typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
|
||||
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf1)<R, T, B1>, typename _bi::list_av_2<A1, A2>::type>
|
||||
>::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1) const, A1 a1, A2 a2)
|
||||
>::type BOOST_BIND(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 typename _bi::list_av_2<A1, A2>::type list_type;
|
||||
@@ -110,7 +110,7 @@ template<class R, class T,
|
||||
class B1, class B2,
|
||||
class A1, class A2, class A3>
|
||||
_bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf2)<R, T, B1, B2>, typename _bi::list_av_3<A1, A2, A3>::type>
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2), A1 a1, A2 a2, A3 a3)
|
||||
BOOST_BIND(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 typename _bi::list_av_3<A1, A2, A3>::type list_type;
|
||||
@@ -121,7 +121,7 @@ template<class R, class T,
|
||||
class B1, class B2,
|
||||
class A1, class A2, class A3>
|
||||
_bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf2)<R, T, B1, B2>, typename _bi::list_av_3<A1, A2, A3>::type>
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2) const, A1 a1, A2 a2, A3 a3)
|
||||
BOOST_BIND(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 typename _bi::list_av_3<A1, A2, A3>::type list_type;
|
||||
@@ -133,7 +133,7 @@ template<class Rt2, class R, class T,
|
||||
class A1, class A2, class A3>
|
||||
typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
|
||||
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf2)<R, T, B1, B2>, typename _bi::list_av_3<A1, A2, A3>::type>
|
||||
>::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2), A1 a1, A2 a2, A3 a3)
|
||||
>::type BOOST_BIND(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 typename _bi::list_av_3<A1, A2, A3>::type list_type;
|
||||
@@ -145,7 +145,7 @@ template<class Rt2, class R, class T,
|
||||
class A1, class A2, class A3>
|
||||
typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
|
||||
_bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf2)<R, T, B1, B2>, typename _bi::list_av_3<A1, A2, A3>::type>
|
||||
>::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2) const, A1 a1, A2 a2, A3 a3)
|
||||
>::type BOOST_BIND(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 typename _bi::list_av_3<A1, A2, A3>::type list_type;
|
||||
@@ -158,7 +158,7 @@ template<class R, class T,
|
||||
class B1, class B2, class B3,
|
||||
class A1, class A2, class A3, class A4>
|
||||
_bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf3)<R, T, B1, B2, B3>, typename _bi::list_av_4<A1, A2, A3, A4>::type>
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3), A1 a1, A2 a2, A3 a3, A4 a4)
|
||||
BOOST_BIND(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 typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
|
||||
@@ -169,7 +169,7 @@ template<class R, class T,
|
||||
class B1, class B2, class B3,
|
||||
class A1, class A2, class A3, class A4>
|
||||
_bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf3)<R, T, B1, B2, B3>, typename _bi::list_av_4<A1, A2, A3, A4>::type>
|
||||
BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) const, A1 a1, A2 a2, A3 a3, A4 a4)
|
||||
BOOST_BIND(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 typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
|
||||
@@ -181,7 +181,7 @@ template<class Rt2, class R, class T,
|
||||
class A1, class A2, class A3, class A4>
|
||||
typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
|
||||
_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>
|
||||
>::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3), A1 a1, A2 a2, A3 a3, A4 a4)
|
||||
>::type BOOST_BIND(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 typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
|
||||
@@ -193,7 +193,7 @@ template<class Rt2, class R, class T,
|
||||
class A1, class A2, class A3, class A4>
|
||||
typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
|
||||
_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>
|
||||
>::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) const, A1 a1, A2 a2, A3 a3, A4 a4)
|
||||
>::type BOOST_BIND(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 typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
|
||||
@@ -206,7 +206,7 @@ template<class R, class T,
|
||||
class B1, class B2, class B3, class B4,
|
||||
class A1, class A2, class A3, class A4, class A5>
|
||||
_bi::bind_t<R, _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(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
|
||||
BOOST_BIND(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 typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
|
||||
@@ -217,7 +217,7 @@ template<class R, class T,
|
||||
class B1, class B2, class B3, class B4,
|
||||
class A1, class A2, class A3, class A4, class A5>
|
||||
_bi::bind_t<R, _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(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
|
||||
BOOST_BIND(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 typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
|
||||
@@ -229,7 +229,7 @@ template<class Rt2, class R, class T,
|
||||
class A1, class A2, class A3, class A4, class A5>
|
||||
typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
|
||||
_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>
|
||||
>::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
|
||||
>::type BOOST_BIND(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 typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
|
||||
@@ -241,7 +241,7 @@ template<class Rt2, class R, class T,
|
||||
class A1, class A2, class A3, class A4, class A5>
|
||||
typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
|
||||
_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>
|
||||
>::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
|
||||
>::type BOOST_BIND(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 typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
|
||||
@@ -254,7 +254,7 @@ template<class R, class T,
|
||||
class B1, class B2, class B3, class B4, class B5,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6>
|
||||
_bi::bind_t<R, _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(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(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 typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
|
||||
@@ -265,7 +265,7 @@ template<class R, class T,
|
||||
class B1, class B2, class B3, class B4, class B5,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6>
|
||||
_bi::bind_t<R, _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(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(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 typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
|
||||
@@ -277,7 +277,7 @@ template<class Rt2, class R, class T,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6>
|
||||
typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
|
||||
_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>
|
||||
>::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
|
||||
>::type BOOST_BIND(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 typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
|
||||
@@ -289,7 +289,7 @@ template<class Rt2, class R, class T,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6>
|
||||
typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
|
||||
_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>
|
||||
>::type BOOST_BIND(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)
|
||||
>::type BOOST_BIND(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 typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
|
||||
@@ -302,7 +302,7 @@ template<class R, class T,
|
||||
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>
|
||||
_bi::bind_t<R, _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(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(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 typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
|
||||
@@ -313,7 +313,7 @@ template<class R, class T,
|
||||
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>
|
||||
_bi::bind_t<R, _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(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(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 typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
|
||||
@@ -325,7 +325,7 @@ template<class Rt2, class R, class T,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7>
|
||||
typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
|
||||
_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>
|
||||
>::type BOOST_BIND(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)
|
||||
>::type BOOST_BIND(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 typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
|
||||
@@ -337,7 +337,7 @@ template<class Rt2, class R, class T,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7>
|
||||
typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
|
||||
_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>
|
||||
>::type BOOST_BIND(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)
|
||||
>::type BOOST_BIND(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 typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
|
||||
@@ -350,7 +350,7 @@ template<class R, class T,
|
||||
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>
|
||||
_bi::bind_t<R, _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(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(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 typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
|
||||
@@ -361,7 +361,7 @@ template<class R, class T,
|
||||
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>
|
||||
_bi::bind_t<R, _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(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(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 typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
|
||||
@@ -373,7 +373,7 @@ template<class Rt2, class R, class T,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
|
||||
typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
|
||||
_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>
|
||||
>::type BOOST_BIND(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)
|
||||
>::type BOOST_BIND(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 typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
|
||||
@@ -385,7 +385,7 @@ template<class Rt2, class R, class T,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
|
||||
typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
|
||||
_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>
|
||||
>::type BOOST_BIND(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)
|
||||
>::type BOOST_BIND(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 typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
|
||||
@@ -398,7 +398,7 @@ template<class R, class T,
|
||||
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>
|
||||
_bi::bind_t<R, _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(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(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 typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
|
||||
@@ -409,7 +409,7 @@ template<class R, class T,
|
||||
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>
|
||||
_bi::bind_t<R, _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(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(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 typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
|
||||
@@ -421,7 +421,7 @@ template<class Rt2, class R, class T,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
|
||||
typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
|
||||
_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>
|
||||
>::type BOOST_BIND(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)
|
||||
>::type BOOST_BIND(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 typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
|
||||
@@ -433,7 +433,7 @@ template<class Rt2, class R, class T,
|
||||
class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
|
||||
typename boost::enable_if_c<!boost::core::is_same<Rt2, R>::value,
|
||||
_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>
|
||||
>::type BOOST_BIND(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)
|
||||
>::type BOOST_BIND(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 typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
|
||||
|
||||
@@ -21,6 +21,19 @@
|
||||
// See http://www.boost.org/libs/bind/mem_fn.html for documentation.
|
||||
//
|
||||
|
||||
#if 1
|
||||
|
||||
#include <functional>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
using std::mem_fn;
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#else
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/get_pointer.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
@@ -49,7 +62,7 @@ template<class V> struct mf
|
||||
#undef BOOST_MEM_FN_CC
|
||||
#undef BOOST_MEM_FN_NAME
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_CDECL
|
||||
#if defined(BOOST_MEM_FN_ENABLE_CDECL) && !defined(_M_X64)
|
||||
|
||||
#define BOOST_MEM_FN_NAME(X) inner_##X##_cdecl
|
||||
#define BOOST_MEM_FN_CC __cdecl
|
||||
@@ -61,7 +74,7 @@ template<class V> struct mf
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_STDCALL
|
||||
#if defined(BOOST_MEM_FN_ENABLE_STDCALL) && !defined(_M_X64)
|
||||
|
||||
#define BOOST_MEM_FN_NAME(X) inner_##X##_stdcall
|
||||
#define BOOST_MEM_FN_CC __stdcall
|
||||
@@ -73,7 +86,7 @@ template<class V> struct mf
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_FASTCALL
|
||||
#if defined(BOOST_MEM_FN_ENABLE_FASTCALL) && !defined(_M_X64)
|
||||
|
||||
#define BOOST_MEM_FN_NAME(X) inner_##X##_fastcall
|
||||
#define BOOST_MEM_FN_CC __fastcall
|
||||
@@ -102,7 +115,7 @@ template<> struct mf<void>
|
||||
#undef BOOST_MEM_FN_CC
|
||||
#undef BOOST_MEM_FN_NAME
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_CDECL
|
||||
#if defined(BOOST_MEM_FN_ENABLE_CDECL) && !defined(_M_X64)
|
||||
|
||||
#define BOOST_MEM_FN_NAME(X) inner_##X##_cdecl
|
||||
#define BOOST_MEM_FN_CC __cdecl
|
||||
@@ -155,7 +168,7 @@ template<> struct mf<void>
|
||||
#undef BOOST_MEM_FN_NAME2
|
||||
#undef BOOST_MEM_FN_CC
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_CDECL
|
||||
#if defined(BOOST_MEM_FN_ENABLE_CDECL) && !defined(_M_X64)
|
||||
|
||||
#define BOOST_MEM_FN_NAME(X) X##_cdecl
|
||||
#define BOOST_MEM_FN_NAME2(X) inner_##X##_cdecl
|
||||
@@ -217,7 +230,7 @@ namespace _mfi
|
||||
#undef BOOST_MEM_FN_CC
|
||||
#undef BOOST_MEM_FN_NAME
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_CDECL
|
||||
#if defined(BOOST_MEM_FN_ENABLE_CDECL) && !defined(_M_X64)
|
||||
|
||||
#define BOOST_MEM_FN_NAME(X) X##_cdecl
|
||||
#define BOOST_MEM_FN_CC __cdecl
|
||||
@@ -229,7 +242,7 @@ namespace _mfi
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_STDCALL
|
||||
#if defined(BOOST_MEM_FN_ENABLE_STDCALL) && !defined(_M_X64)
|
||||
|
||||
#define BOOST_MEM_FN_NAME(X) X##_stdcall
|
||||
#define BOOST_MEM_FN_CC __stdcall
|
||||
@@ -241,7 +254,7 @@ namespace _mfi
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_FASTCALL
|
||||
#if defined(BOOST_MEM_FN_ENABLE_FASTCALL) && !defined(_M_X64)
|
||||
|
||||
#define BOOST_MEM_FN_NAME(X) X##_fastcall
|
||||
#define BOOST_MEM_FN_CC __fastcall
|
||||
@@ -270,7 +283,7 @@ namespace _mfi
|
||||
#undef BOOST_MEM_FN_NAME
|
||||
#undef BOOST_MEM_FN_CC
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_CDECL
|
||||
#if defined(BOOST_MEM_FN_ENABLE_CDECL) && !defined(_M_X64)
|
||||
|
||||
#define BOOST_MEM_FN_NAME(X) X##_cdecl
|
||||
#define BOOST_MEM_FN_CC __cdecl
|
||||
@@ -282,7 +295,7 @@ namespace _mfi
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_STDCALL
|
||||
#if defined(BOOST_MEM_FN_ENABLE_STDCALL) && !defined(_M_X64)
|
||||
|
||||
#define BOOST_MEM_FN_NAME(X) X##_stdcall
|
||||
#define BOOST_MEM_FN_CC __stdcall
|
||||
@@ -294,7 +307,7 @@ namespace _mfi
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MEM_FN_ENABLE_FASTCALL
|
||||
#if defined(BOOST_MEM_FN_ENABLE_FASTCALL) && !defined(_M_X64)
|
||||
|
||||
#define BOOST_MEM_FN_NAME(X) X##_fastcall
|
||||
#define BOOST_MEM_FN_CC __fastcall
|
||||
@@ -386,4 +399,6 @@ template<class R, class T> _mfi::dm<R, T> mem_fn(R T::*f)
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
|
||||
#endif // #ifndef BOOST_BIND_MEM_FN_HPP_INCLUDED
|
||||
|
||||
@@ -11,10 +11,11 @@
|
||||
// bind/placeholders.hpp - _N definitions
|
||||
//
|
||||
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
|
||||
// Copyright 2015 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)
|
||||
// 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.
|
||||
//
|
||||
@@ -22,48 +23,40 @@
|
||||
#include <boost/bind/arg.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
namespace
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace placeholders
|
||||
{
|
||||
|
||||
#if defined(__BORLANDC__) || defined(__GNUC__) && (__GNUC__ < 4)
|
||||
|
||||
static inline boost::arg<1> _1() { return boost::arg<1>(); }
|
||||
static inline boost::arg<2> _2() { return boost::arg<2>(); }
|
||||
static inline boost::arg<3> _3() { return boost::arg<3>(); }
|
||||
static inline boost::arg<4> _4() { return boost::arg<4>(); }
|
||||
static inline boost::arg<5> _5() { return boost::arg<5>(); }
|
||||
static inline boost::arg<6> _6() { return boost::arg<6>(); }
|
||||
static inline boost::arg<7> _7() { return boost::arg<7>(); }
|
||||
static inline boost::arg<8> _8() { return boost::arg<8>(); }
|
||||
static inline boost::arg<9> _9() { return boost::arg<9>(); }
|
||||
|
||||
#elif defined(BOOST_MSVC) || (defined(__DECCXX_VER) && __DECCXX_VER <= 60590031) || defined(__MWERKS__) || \
|
||||
defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ < 2)
|
||||
|
||||
static boost::arg<1> _1;
|
||||
static boost::arg<2> _2;
|
||||
static boost::arg<3> _3;
|
||||
static boost::arg<4> _4;
|
||||
static boost::arg<5> _5;
|
||||
static boost::arg<6> _6;
|
||||
static boost::arg<7> _7;
|
||||
static boost::arg<8> _8;
|
||||
static boost::arg<9> _9;
|
||||
inline boost::arg<1> _1() { return boost::arg<1>(); }
|
||||
inline boost::arg<2> _2() { return boost::arg<2>(); }
|
||||
inline boost::arg<3> _3() { return boost::arg<3>(); }
|
||||
inline boost::arg<4> _4() { return boost::arg<4>(); }
|
||||
inline boost::arg<5> _5() { return boost::arg<5>(); }
|
||||
inline boost::arg<6> _6() { return boost::arg<6>(); }
|
||||
inline boost::arg<7> _7() { return boost::arg<7>(); }
|
||||
inline boost::arg<8> _8() { return boost::arg<8>(); }
|
||||
inline boost::arg<9> _9() { return boost::arg<9>(); }
|
||||
|
||||
#else
|
||||
|
||||
boost::arg<1> _1;
|
||||
boost::arg<2> _2;
|
||||
boost::arg<3> _3;
|
||||
boost::arg<4> _4;
|
||||
boost::arg<5> _5;
|
||||
boost::arg<6> _6;
|
||||
boost::arg<7> _7;
|
||||
boost::arg<8> _8;
|
||||
boost::arg<9> _9;
|
||||
BOOST_STATIC_CONSTEXPR boost::arg<1> _1;
|
||||
BOOST_STATIC_CONSTEXPR boost::arg<2> _2;
|
||||
BOOST_STATIC_CONSTEXPR boost::arg<3> _3;
|
||||
BOOST_STATIC_CONSTEXPR boost::arg<4> _4;
|
||||
BOOST_STATIC_CONSTEXPR boost::arg<5> _5;
|
||||
BOOST_STATIC_CONSTEXPR boost::arg<6> _6;
|
||||
BOOST_STATIC_CONSTEXPR boost::arg<7> _7;
|
||||
BOOST_STATIC_CONSTEXPR boost::arg<8> _8;
|
||||
BOOST_STATIC_CONSTEXPR boost::arg<9> _9;
|
||||
|
||||
#endif
|
||||
|
||||
} // unnamed namespace
|
||||
} // namespace placeholders
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED
|
||||
|
||||
107
test/Jamfile.v2
107
test/Jamfile.v2
@@ -1,6 +1,6 @@
|
||||
# Boost.Bind Library test Jamfile
|
||||
#
|
||||
# Copyright (c) 2003-2006 Peter Dimov
|
||||
# Copyright (c) 2003-2006, 2017 Peter Dimov
|
||||
#
|
||||
# Distributed under the Boost Software License, Version 1.0. (See
|
||||
# accompanying file LICENSE_1_0.txt or copy at
|
||||
@@ -9,45 +9,66 @@
|
||||
# bring in rules for testing
|
||||
import testing ;
|
||||
|
||||
test-suite "bind"
|
||||
: [ run bind_test.cpp ]
|
||||
[ run bind_dm_test.cpp ]
|
||||
[ run bind_eq_test.cpp ]
|
||||
[ run bind_const_test.cpp ]
|
||||
[ run bind_cv_test.cpp ]
|
||||
[ run bind_stateful_test.cpp ]
|
||||
[ run bind_dm2_test.cpp ]
|
||||
[ run bind_not_test.cpp ]
|
||||
[ run bind_rel_test.cpp ]
|
||||
[ run bind_function_test.cpp ]
|
||||
[ run bind_lookup_problem_test.cpp ]
|
||||
[ run bind_rv_sp_test.cpp ]
|
||||
[ compile bind_unary_addr.cpp ]
|
||||
[ run bind_dm3_test.cpp ]
|
||||
[ run bind_visit_test.cpp ]
|
||||
[ run bind_placeholder_test.cpp ]
|
||||
[ run bind_rvalue_test.cpp ]
|
||||
[ run bind_and_or_test.cpp ]
|
||||
[ run bind_void_test.cpp ]
|
||||
[ run bind_void_dm_test.cpp ]
|
||||
[ run bind_void_mf_test.cpp ]
|
||||
[ run mem_fn_test.cpp ]
|
||||
[ run mem_fn_void_test.cpp ]
|
||||
[ run mem_fn_derived_test.cpp ]
|
||||
[ run mem_fn_eq_test.cpp ]
|
||||
[ run mem_fn_dm_test.cpp ]
|
||||
[ run mem_fn_rv_test.cpp ]
|
||||
[ run ref_fn_test.cpp ]
|
||||
[ run bind_fnobj2_test.cpp ]
|
||||
[ run bind_fn2_test.cpp ]
|
||||
[ run bind_mf2_test.cpp ]
|
||||
[ run bind_eq2_test.cpp ]
|
||||
[ run mem_fn_ref_test.cpp ]
|
||||
[ run bind_ref_test.cpp ]
|
||||
[ run bind_eq3_test.cpp ]
|
||||
[ run protect_test.cpp ]
|
||||
[ run mem_fn_unary_addr_test.cpp ]
|
||||
[ run bind_function2_test.cpp ]
|
||||
[ run bind_fwd_test.cpp ]
|
||||
[ run bind_fwd2_test.cpp ]
|
||||
;
|
||||
# quick test (for CI)
|
||||
run quick.cpp ;
|
||||
|
||||
# full test suite
|
||||
run bind_test.cpp ;
|
||||
run bind_dm_test.cpp ;
|
||||
run bind_eq_test.cpp ;
|
||||
run bind_const_test.cpp ;
|
||||
run bind_cv_test.cpp ;
|
||||
run bind_stateful_test.cpp ;
|
||||
run bind_dm2_test.cpp ;
|
||||
run bind_not_test.cpp ;
|
||||
run bind_rel_test.cpp ;
|
||||
run bind_function_test.cpp ;
|
||||
run bind_lookup_problem_test.cpp ;
|
||||
run bind_rv_sp_test.cpp ;
|
||||
compile bind_unary_addr.cpp ;
|
||||
run bind_dm3_test.cpp ;
|
||||
run bind_visit_test.cpp ;
|
||||
run bind_placeholder_test.cpp ;
|
||||
run bind_rvalue_test.cpp ;
|
||||
run bind_and_or_test.cpp ;
|
||||
run bind_void_test.cpp ;
|
||||
run bind_void_dm_test.cpp ;
|
||||
run bind_void_mf_test.cpp ;
|
||||
run mem_fn_test.cpp ;
|
||||
run mem_fn_void_test.cpp ;
|
||||
run mem_fn_derived_test.cpp ;
|
||||
run mem_fn_eq_test.cpp ;
|
||||
run mem_fn_dm_test.cpp ;
|
||||
run mem_fn_rv_test.cpp ;
|
||||
run ref_fn_test.cpp ;
|
||||
run bind_fnobj2_test.cpp ;
|
||||
run bind_fn2_test.cpp ;
|
||||
run bind_mf2_test.cpp ;
|
||||
run bind_eq2_test.cpp ;
|
||||
run mem_fn_ref_test.cpp ;
|
||||
run bind_ref_test.cpp ;
|
||||
run bind_eq3_test.cpp ;
|
||||
run protect_test.cpp ;
|
||||
run mem_fn_unary_addr_test.cpp ;
|
||||
run bind_function2_test.cpp ;
|
||||
run bind_fwd_test.cpp ;
|
||||
run bind_fwd2_test.cpp ;
|
||||
run bind_no_placeholders_test.cpp ;
|
||||
run placeholder_const_ref_test.cpp ;
|
||||
run bind_function_ap_test.cpp ;
|
||||
run bind_type_test.cpp ;
|
||||
run bind_unique_ptr_test.cpp ;
|
||||
run bind_nested_rv_test.cpp ;
|
||||
compile arg_copy_test.cpp ;
|
||||
compile-fail arg_copy_fail.cpp ;
|
||||
run placeholder_std_bind_test.cpp ;
|
||||
run bind_fastcall_test.cpp ;
|
||||
run bind_stdcall_test.cpp ;
|
||||
run bind_cdecl_mf_test.cpp ;
|
||||
run bind_fastcall_mf_test.cpp ;
|
||||
run bind_stdcall_mf_test.cpp ;
|
||||
run mem_fn_cdecl_test.cpp ;
|
||||
run mem_fn_fastcall_test.cpp ;
|
||||
run mem_fn_stdcall_test.cpp ;
|
||||
run bind_noexcept_test.cpp ;
|
||||
run bind_noexcept_mf_test.cpp ;
|
||||
|
||||
19
test/arg_copy_fail.cpp
Normal file
19
test/arg_copy_fail.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// arg_copy_fail.cpp - arg<1> to arg<2>
|
||||
//
|
||||
// Copyright 2016 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/arg.hpp>
|
||||
|
||||
//
|
||||
|
||||
int main()
|
||||
{
|
||||
boost::arg<1> a1(( boost::arg<2>() ));
|
||||
(void)a1;
|
||||
}
|
||||
34
test/arg_copy_test.cpp
Normal file
34
test/arg_copy_test.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// arg_copy_test.cpp - copying a custom placeholder _1 to arg<1>
|
||||
//
|
||||
// Copyright 2016 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/is_placeholder.hpp>
|
||||
#include <boost/bind/arg.hpp>
|
||||
|
||||
//
|
||||
|
||||
template<int I> struct ph
|
||||
{
|
||||
};
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
template<int I> struct is_placeholder< ::ph<I> >
|
||||
{
|
||||
enum _vt { value = I };
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
int main()
|
||||
{
|
||||
boost::arg<1> a1 = ph<1>();
|
||||
(void)a1;
|
||||
}
|
||||
@@ -1,5 +1,13 @@
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#ifndef BOOST_MSVC
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma warning(disable: 4786) // identifier truncated in debug info
|
||||
#pragma warning(disable: 4710) // function not inlined
|
||||
@@ -162,3 +170,5 @@ int main()
|
||||
member_function_test();
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#ifndef BOOST_MSVC
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma warning(disable: 4786) // identifier truncated in debug info
|
||||
#pragma warning(disable: 4710) // function not inlined
|
||||
@@ -162,3 +170,5 @@ int main()
|
||||
member_function_test();
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#ifndef BOOST_MSVC
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma warning(disable: 4786) // identifier truncated in debug info
|
||||
#pragma warning(disable: 4710) // function not inlined
|
||||
@@ -108,3 +116,5 @@ int main()
|
||||
function_test();
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
234
test/bind_function_ap_test.cpp
Normal file
234
test/bind_function_ap_test.cpp
Normal file
@@ -0,0 +1,234 @@
|
||||
#include <boost/config.hpp>
|
||||
|
||||
//
|
||||
// bind_function_ap_test.cpp - regression test
|
||||
//
|
||||
// Copyright (c) 2015 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
|
||||
//
|
||||
|
||||
#if defined( BOOST_NO_AUTO_PTR )
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#if defined( __GNUC__ ) && ( __GNUC__ * 100 + __GNUC_MINOR__ >= 406 )
|
||||
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined( __clang__ ) && defined( __has_warning )
|
||||
# if __has_warning( "-Wdeprecated-declarations" )
|
||||
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/function.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <memory>
|
||||
|
||||
//
|
||||
|
||||
void fv1( std::auto_ptr<int> p1 )
|
||||
{
|
||||
BOOST_TEST( *p1 == 1 );
|
||||
}
|
||||
|
||||
void fv2( std::auto_ptr<int> p1, std::auto_ptr<int> p2 )
|
||||
{
|
||||
BOOST_TEST( *p1 == 1 );
|
||||
BOOST_TEST( *p2 == 2 );
|
||||
}
|
||||
|
||||
void fv3( std::auto_ptr<int> p1, std::auto_ptr<int> p2, std::auto_ptr<int> p3 )
|
||||
{
|
||||
BOOST_TEST( *p1 == 1 );
|
||||
BOOST_TEST( *p2 == 2 );
|
||||
BOOST_TEST( *p3 == 3 );
|
||||
}
|
||||
|
||||
void fv4( std::auto_ptr<int> p1, std::auto_ptr<int> p2, std::auto_ptr<int> p3, std::auto_ptr<int> p4 )
|
||||
{
|
||||
BOOST_TEST( *p1 == 1 );
|
||||
BOOST_TEST( *p2 == 2 );
|
||||
BOOST_TEST( *p3 == 3 );
|
||||
BOOST_TEST( *p4 == 4 );
|
||||
}
|
||||
|
||||
void fv5( std::auto_ptr<int> p1, std::auto_ptr<int> p2, std::auto_ptr<int> p3, std::auto_ptr<int> p4, std::auto_ptr<int> p5 )
|
||||
{
|
||||
BOOST_TEST( *p1 == 1 );
|
||||
BOOST_TEST( *p2 == 2 );
|
||||
BOOST_TEST( *p3 == 3 );
|
||||
BOOST_TEST( *p4 == 4 );
|
||||
BOOST_TEST( *p5 == 5 );
|
||||
}
|
||||
|
||||
void fv6( std::auto_ptr<int> p1, std::auto_ptr<int> p2, std::auto_ptr<int> p3, std::auto_ptr<int> p4, std::auto_ptr<int> p5, std::auto_ptr<int> p6 )
|
||||
{
|
||||
BOOST_TEST( *p1 == 1 );
|
||||
BOOST_TEST( *p2 == 2 );
|
||||
BOOST_TEST( *p3 == 3 );
|
||||
BOOST_TEST( *p4 == 4 );
|
||||
BOOST_TEST( *p5 == 5 );
|
||||
BOOST_TEST( *p6 == 6 );
|
||||
}
|
||||
|
||||
void fv7( std::auto_ptr<int> p1, std::auto_ptr<int> p2, std::auto_ptr<int> p3, std::auto_ptr<int> p4, std::auto_ptr<int> p5, std::auto_ptr<int> p6, std::auto_ptr<int> p7 )
|
||||
{
|
||||
BOOST_TEST( *p1 == 1 );
|
||||
BOOST_TEST( *p2 == 2 );
|
||||
BOOST_TEST( *p3 == 3 );
|
||||
BOOST_TEST( *p4 == 4 );
|
||||
BOOST_TEST( *p5 == 5 );
|
||||
BOOST_TEST( *p6 == 6 );
|
||||
BOOST_TEST( *p7 == 7 );
|
||||
}
|
||||
|
||||
void fv8( std::auto_ptr<int> p1, std::auto_ptr<int> p2, std::auto_ptr<int> p3, std::auto_ptr<int> p4, std::auto_ptr<int> p5, std::auto_ptr<int> p6, std::auto_ptr<int> p7, std::auto_ptr<int> p8 )
|
||||
{
|
||||
BOOST_TEST( *p1 == 1 );
|
||||
BOOST_TEST( *p2 == 2 );
|
||||
BOOST_TEST( *p3 == 3 );
|
||||
BOOST_TEST( *p4 == 4 );
|
||||
BOOST_TEST( *p5 == 5 );
|
||||
BOOST_TEST( *p6 == 6 );
|
||||
BOOST_TEST( *p7 == 7 );
|
||||
BOOST_TEST( *p8 == 8 );
|
||||
}
|
||||
|
||||
void fv9( std::auto_ptr<int> p1, std::auto_ptr<int> p2, std::auto_ptr<int> p3, std::auto_ptr<int> p4, std::auto_ptr<int> p5, std::auto_ptr<int> p6, std::auto_ptr<int> p7, std::auto_ptr<int> p8, std::auto_ptr<int> p9 )
|
||||
{
|
||||
BOOST_TEST( *p1 == 1 );
|
||||
BOOST_TEST( *p2 == 2 );
|
||||
BOOST_TEST( *p3 == 3 );
|
||||
BOOST_TEST( *p4 == 4 );
|
||||
BOOST_TEST( *p5 == 5 );
|
||||
BOOST_TEST( *p6 == 6 );
|
||||
BOOST_TEST( *p7 == 7 );
|
||||
BOOST_TEST( *p8 == 8 );
|
||||
BOOST_TEST( *p9 == 9 );
|
||||
}
|
||||
|
||||
void test()
|
||||
{
|
||||
{
|
||||
boost::function<void(std::auto_ptr<int>)> fw1 = boost::bind( fv1, _1 );
|
||||
|
||||
std::auto_ptr<int> p1( new int(1) );
|
||||
|
||||
fw1( p1 );
|
||||
}
|
||||
|
||||
{
|
||||
boost::function<void(std::auto_ptr<int>, std::auto_ptr<int>)> fw2 = boost::bind( fv2, _1, _2 );
|
||||
|
||||
std::auto_ptr<int> p1( new int(1) );
|
||||
std::auto_ptr<int> p2( new int(2) );
|
||||
|
||||
fw2( p1, p2 );
|
||||
}
|
||||
|
||||
{
|
||||
boost::function<void(std::auto_ptr<int>, std::auto_ptr<int>, std::auto_ptr<int>)> fw3 = boost::bind( fv3, _1, _2, _3 );
|
||||
|
||||
std::auto_ptr<int> p1( new int(1) );
|
||||
std::auto_ptr<int> p2( new int(2) );
|
||||
std::auto_ptr<int> p3( new int(3) );
|
||||
|
||||
fw3( p1, p2, p3 );
|
||||
}
|
||||
|
||||
{
|
||||
boost::function<void(std::auto_ptr<int>, std::auto_ptr<int>, std::auto_ptr<int>, std::auto_ptr<int>)> fw4 = boost::bind( fv4, _1, _2, _3, _4 );
|
||||
|
||||
std::auto_ptr<int> p1( new int(1) );
|
||||
std::auto_ptr<int> p2( new int(2) );
|
||||
std::auto_ptr<int> p3( new int(3) );
|
||||
std::auto_ptr<int> p4( new int(4) );
|
||||
|
||||
fw4( p1, p2, p3, p4 );
|
||||
}
|
||||
|
||||
{
|
||||
boost::function<void(std::auto_ptr<int>, std::auto_ptr<int>, std::auto_ptr<int>, std::auto_ptr<int>, std::auto_ptr<int>)> fw5 = boost::bind( fv5, _1, _2, _3, _4, _5 );
|
||||
|
||||
std::auto_ptr<int> p1( new int(1) );
|
||||
std::auto_ptr<int> p2( new int(2) );
|
||||
std::auto_ptr<int> p3( new int(3) );
|
||||
std::auto_ptr<int> p4( new int(4) );
|
||||
std::auto_ptr<int> p5( new int(5) );
|
||||
|
||||
fw5( p1, p2, p3, p4, p5 );
|
||||
}
|
||||
|
||||
{
|
||||
boost::function<void(std::auto_ptr<int>, std::auto_ptr<int>, std::auto_ptr<int>, std::auto_ptr<int>, std::auto_ptr<int>, std::auto_ptr<int>)> fw6 = boost::bind( fv6, _1, _2, _3, _4, _5, _6 );
|
||||
|
||||
std::auto_ptr<int> p1( new int(1) );
|
||||
std::auto_ptr<int> p2( new int(2) );
|
||||
std::auto_ptr<int> p3( new int(3) );
|
||||
std::auto_ptr<int> p4( new int(4) );
|
||||
std::auto_ptr<int> p5( new int(5) );
|
||||
std::auto_ptr<int> p6( new int(6) );
|
||||
|
||||
fw6( p1, p2, p3, p4, p5, p6 );
|
||||
}
|
||||
|
||||
{
|
||||
boost::function<void(std::auto_ptr<int>, std::auto_ptr<int>, std::auto_ptr<int>, std::auto_ptr<int>, std::auto_ptr<int>, std::auto_ptr<int>, std::auto_ptr<int>)> fw7 = boost::bind( fv7, _1, _2, _3, _4, _5, _6, _7 );
|
||||
|
||||
std::auto_ptr<int> p1( new int(1) );
|
||||
std::auto_ptr<int> p2( new int(2) );
|
||||
std::auto_ptr<int> p3( new int(3) );
|
||||
std::auto_ptr<int> p4( new int(4) );
|
||||
std::auto_ptr<int> p5( new int(5) );
|
||||
std::auto_ptr<int> p6( new int(6) );
|
||||
std::auto_ptr<int> p7( new int(7) );
|
||||
|
||||
fw7( p1, p2, p3, p4, p5, p6, p7 );
|
||||
}
|
||||
|
||||
{
|
||||
boost::function<void(std::auto_ptr<int>, std::auto_ptr<int>, std::auto_ptr<int>, std::auto_ptr<int>, std::auto_ptr<int>, std::auto_ptr<int>, std::auto_ptr<int>, std::auto_ptr<int>)> fw8 = boost::bind( fv8, _1, _2, _3, _4, _5, _6, _7, _8 );
|
||||
|
||||
std::auto_ptr<int> p1( new int(1) );
|
||||
std::auto_ptr<int> p2( new int(2) );
|
||||
std::auto_ptr<int> p3( new int(3) );
|
||||
std::auto_ptr<int> p4( new int(4) );
|
||||
std::auto_ptr<int> p5( new int(5) );
|
||||
std::auto_ptr<int> p6( new int(6) );
|
||||
std::auto_ptr<int> p7( new int(7) );
|
||||
std::auto_ptr<int> p8( new int(8) );
|
||||
|
||||
fw8( p1, p2, p3, p4, p5, p6, p7, p8 );
|
||||
}
|
||||
|
||||
{
|
||||
boost::function<void(std::auto_ptr<int>, std::auto_ptr<int>, std::auto_ptr<int>, std::auto_ptr<int>, std::auto_ptr<int>, std::auto_ptr<int>, std::auto_ptr<int>, std::auto_ptr<int>, std::auto_ptr<int>)> fw9 = boost::bind( fv9, _1, _2, _3, _4, _5, _6, _7, _8, _9 );
|
||||
|
||||
std::auto_ptr<int> p1( new int(1) );
|
||||
std::auto_ptr<int> p2( new int(2) );
|
||||
std::auto_ptr<int> p3( new int(3) );
|
||||
std::auto_ptr<int> p4( new int(4) );
|
||||
std::auto_ptr<int> p5( new int(5) );
|
||||
std::auto_ptr<int> p6( new int(6) );
|
||||
std::auto_ptr<int> p7( new int(7) );
|
||||
std::auto_ptr<int> p8( new int(8) );
|
||||
std::auto_ptr<int> p9( new int(9) );
|
||||
|
||||
fw9( p1, p2, p3, p4, p5, p6, p7, p8, p9 );
|
||||
}
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test();
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif // #if defined( BOOST_NO_AUTO_PTR )
|
||||
177
test/bind_nested_rv_test.cpp
Normal file
177
test/bind_nested_rv_test.cpp
Normal file
@@ -0,0 +1,177 @@
|
||||
#include <boost/config.hpp>
|
||||
|
||||
//
|
||||
// bind_nested_rv_test.cpp
|
||||
//
|
||||
// Copyright (c) 2016 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.hpp>
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <boost/function.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
//
|
||||
|
||||
bool f1( boost::shared_ptr<int> p1 )
|
||||
{
|
||||
BOOST_TEST( p1 != 0 && *p1 == 1 );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f2( boost::shared_ptr<int> p1, boost::shared_ptr<int> p2 )
|
||||
{
|
||||
BOOST_TEST( p1 != 0 && *p1 == 1 );
|
||||
BOOST_TEST( p2 != 0 && *p2 == 2 );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f3( boost::shared_ptr<int> p1, boost::shared_ptr<int> p2, boost::shared_ptr<int> p3 )
|
||||
{
|
||||
BOOST_TEST( p1 != 0 && *p1 == 1 );
|
||||
BOOST_TEST( p2 != 0 && *p2 == 2 );
|
||||
BOOST_TEST( p3 != 0 && *p3 == 3 );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f4( boost::shared_ptr<int> p1, boost::shared_ptr<int> p2, boost::shared_ptr<int> p3, boost::shared_ptr<int> p4 )
|
||||
{
|
||||
BOOST_TEST( p1 != 0 && *p1 == 1 );
|
||||
BOOST_TEST( p2 != 0 && *p2 == 2 );
|
||||
BOOST_TEST( p3 != 0 && *p3 == 3 );
|
||||
BOOST_TEST( p4 != 0 && *p4 == 4 );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f5( boost::shared_ptr<int> p1, boost::shared_ptr<int> p2, boost::shared_ptr<int> p3, boost::shared_ptr<int> p4, boost::shared_ptr<int> p5 )
|
||||
{
|
||||
BOOST_TEST( p1 != 0 && *p1 == 1 );
|
||||
BOOST_TEST( p2 != 0 && *p2 == 2 );
|
||||
BOOST_TEST( p3 != 0 && *p3 == 3 );
|
||||
BOOST_TEST( p4 != 0 && *p4 == 4 );
|
||||
BOOST_TEST( p5 != 0 && *p5 == 5 );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f6( boost::shared_ptr<int> p1, boost::shared_ptr<int> p2, boost::shared_ptr<int> p3, boost::shared_ptr<int> p4, boost::shared_ptr<int> p5, boost::shared_ptr<int> p6 )
|
||||
{
|
||||
BOOST_TEST( p1 != 0 && *p1 == 1 );
|
||||
BOOST_TEST( p2 != 0 && *p2 == 2 );
|
||||
BOOST_TEST( p3 != 0 && *p3 == 3 );
|
||||
BOOST_TEST( p4 != 0 && *p4 == 4 );
|
||||
BOOST_TEST( p5 != 0 && *p5 == 5 );
|
||||
BOOST_TEST( p6 != 0 && *p6 == 6 );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f7( boost::shared_ptr<int> p1, boost::shared_ptr<int> p2, boost::shared_ptr<int> p3, boost::shared_ptr<int> p4, boost::shared_ptr<int> p5, boost::shared_ptr<int> p6, boost::shared_ptr<int> p7 )
|
||||
{
|
||||
BOOST_TEST( p1 != 0 && *p1 == 1 );
|
||||
BOOST_TEST( p2 != 0 && *p2 == 2 );
|
||||
BOOST_TEST( p3 != 0 && *p3 == 3 );
|
||||
BOOST_TEST( p4 != 0 && *p4 == 4 );
|
||||
BOOST_TEST( p5 != 0 && *p5 == 5 );
|
||||
BOOST_TEST( p6 != 0 && *p6 == 6 );
|
||||
BOOST_TEST( p7 != 0 && *p7 == 7 );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f8( boost::shared_ptr<int> p1, boost::shared_ptr<int> p2, boost::shared_ptr<int> p3, boost::shared_ptr<int> p4, boost::shared_ptr<int> p5, boost::shared_ptr<int> p6, boost::shared_ptr<int> p7, boost::shared_ptr<int> p8 )
|
||||
{
|
||||
BOOST_TEST( p1 != 0 && *p1 == 1 );
|
||||
BOOST_TEST( p2 != 0 && *p2 == 2 );
|
||||
BOOST_TEST( p3 != 0 && *p3 == 3 );
|
||||
BOOST_TEST( p4 != 0 && *p4 == 4 );
|
||||
BOOST_TEST( p5 != 0 && *p5 == 5 );
|
||||
BOOST_TEST( p6 != 0 && *p6 == 6 );
|
||||
BOOST_TEST( p7 != 0 && *p7 == 7 );
|
||||
BOOST_TEST( p8 != 0 && *p8 == 8 );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f9( boost::shared_ptr<int> p1, boost::shared_ptr<int> p2, boost::shared_ptr<int> p3, boost::shared_ptr<int> p4, boost::shared_ptr<int> p5, boost::shared_ptr<int> p6, boost::shared_ptr<int> p7, boost::shared_ptr<int> p8, boost::shared_ptr<int> p9 )
|
||||
{
|
||||
BOOST_TEST( p1 != 0 && *p1 == 1 );
|
||||
BOOST_TEST( p2 != 0 && *p2 == 2 );
|
||||
BOOST_TEST( p3 != 0 && *p3 == 3 );
|
||||
BOOST_TEST( p4 != 0 && *p4 == 4 );
|
||||
BOOST_TEST( p5 != 0 && *p5 == 5 );
|
||||
BOOST_TEST( p6 != 0 && *p6 == 6 );
|
||||
BOOST_TEST( p7 != 0 && *p7 == 7 );
|
||||
BOOST_TEST( p8 != 0 && *p8 == 8 );
|
||||
BOOST_TEST( p9 != 0 && *p9 == 9 );
|
||||
return true;
|
||||
}
|
||||
|
||||
void test()
|
||||
{
|
||||
{
|
||||
boost::function<bool(boost::shared_ptr<int>)> f( f1 );
|
||||
|
||||
( boost::bind( f, _1 ) && boost::bind( f1, _1 ) )( boost::make_shared<int>( 1 ) );
|
||||
}
|
||||
|
||||
{
|
||||
boost::function<bool(boost::shared_ptr<int>, boost::shared_ptr<int>)> f( f2 );
|
||||
|
||||
( boost::bind( f, _1, _2 ) && boost::bind( f2, _1, _2 ) )( boost::make_shared<int>( 1 ), boost::make_shared<int>( 2 ) );
|
||||
}
|
||||
|
||||
{
|
||||
boost::function<bool(boost::shared_ptr<int>, boost::shared_ptr<int>, boost::shared_ptr<int>)> f( f3 );
|
||||
|
||||
( boost::bind( f, _1, _2, _3 ) && boost::bind( f3, _1, _2, _3 ) )( boost::make_shared<int>( 1 ), boost::make_shared<int>( 2 ), boost::make_shared<int>( 3 ) );
|
||||
}
|
||||
|
||||
{
|
||||
boost::function<bool(boost::shared_ptr<int>, boost::shared_ptr<int>, boost::shared_ptr<int>)> f( f3 );
|
||||
|
||||
( boost::bind( f, _1, _2, _3 ) && boost::bind( f3, _1, _2, _3 ) )( boost::make_shared<int>( 1 ), boost::make_shared<int>( 2 ), boost::make_shared<int>( 3 ) );
|
||||
}
|
||||
|
||||
{
|
||||
boost::function<bool(boost::shared_ptr<int>, boost::shared_ptr<int>, boost::shared_ptr<int>, boost::shared_ptr<int>)> f( f4 );
|
||||
|
||||
( boost::bind( f, _1, _2, _3, _4 ) && boost::bind( f4, _1, _2, _3, _4 ) )( boost::make_shared<int>( 1 ), boost::make_shared<int>( 2 ), boost::make_shared<int>( 3 ), boost::make_shared<int>( 4 ) );
|
||||
}
|
||||
|
||||
{
|
||||
boost::function<bool(boost::shared_ptr<int>, boost::shared_ptr<int>, boost::shared_ptr<int>, boost::shared_ptr<int>, boost::shared_ptr<int>)> f( f5 );
|
||||
|
||||
( boost::bind( f, _1, _2, _3, _4, _5 ) && boost::bind( f5, _1, _2, _3, _4, _5 ) )( boost::make_shared<int>( 1 ), boost::make_shared<int>( 2 ), boost::make_shared<int>( 3 ), boost::make_shared<int>( 4 ), boost::make_shared<int>( 5 ) );
|
||||
}
|
||||
|
||||
{
|
||||
boost::function<bool(boost::shared_ptr<int>, boost::shared_ptr<int>, boost::shared_ptr<int>, boost::shared_ptr<int>, boost::shared_ptr<int>, boost::shared_ptr<int>)> f( f6 );
|
||||
|
||||
( boost::bind( f, _1, _2, _3, _4, _5, _6 ) && boost::bind( f6, _1, _2, _3, _4, _5, _6 ) )( boost::make_shared<int>( 1 ), boost::make_shared<int>( 2 ), boost::make_shared<int>( 3 ), boost::make_shared<int>( 4 ), boost::make_shared<int>( 5 ), boost::make_shared<int>( 6 ) );
|
||||
}
|
||||
|
||||
{
|
||||
boost::function<bool(boost::shared_ptr<int>, boost::shared_ptr<int>, boost::shared_ptr<int>, boost::shared_ptr<int>, boost::shared_ptr<int>, boost::shared_ptr<int>, boost::shared_ptr<int>)> f( f7 );
|
||||
|
||||
( boost::bind( f, _1, _2, _3, _4, _5, _6, _7 ) && boost::bind( f7, _1, _2, _3, _4, _5, _6, _7 ) )( boost::make_shared<int>( 1 ), boost::make_shared<int>( 2 ), boost::make_shared<int>( 3 ), boost::make_shared<int>( 4 ), boost::make_shared<int>( 5 ), boost::make_shared<int>( 6 ), boost::make_shared<int>( 7 ) );
|
||||
}
|
||||
|
||||
{
|
||||
boost::function<bool(boost::shared_ptr<int>, boost::shared_ptr<int>, boost::shared_ptr<int>, boost::shared_ptr<int>, boost::shared_ptr<int>, boost::shared_ptr<int>, boost::shared_ptr<int>, boost::shared_ptr<int>)> f( f8 );
|
||||
|
||||
( boost::bind( f, _1, _2, _3, _4, _5, _6, _7, _8 ) && boost::bind( f8, _1, _2, _3, _4, _5, _6, _7, _8 ) )( boost::make_shared<int>( 1 ), boost::make_shared<int>( 2 ), boost::make_shared<int>( 3 ), boost::make_shared<int>( 4 ), boost::make_shared<int>( 5 ), boost::make_shared<int>( 6 ), boost::make_shared<int>( 7 ), boost::make_shared<int>( 8 ) );
|
||||
}
|
||||
|
||||
{
|
||||
boost::function<bool(boost::shared_ptr<int>, boost::shared_ptr<int>, boost::shared_ptr<int>, boost::shared_ptr<int>, boost::shared_ptr<int>, boost::shared_ptr<int>, boost::shared_ptr<int>, boost::shared_ptr<int>, boost::shared_ptr<int>)> f( f9 );
|
||||
|
||||
( boost::bind( f, _1, _2, _3, _4, _5, _6, _7, _8, _9 ) && boost::bind( f9, _1, _2, _3, _4, _5, _6, _7, _8, _9 ) )( boost::make_shared<int>( 1 ), boost::make_shared<int>( 2 ), boost::make_shared<int>( 3 ), boost::make_shared<int>( 4 ), boost::make_shared<int>( 5 ), boost::make_shared<int>( 6 ), boost::make_shared<int>( 7 ), boost::make_shared<int>( 8 ), boost::make_shared<int>( 9 ) );
|
||||
}
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test();
|
||||
return boost::report_errors();
|
||||
}
|
||||
99
test/bind_no_placeholders_test.cpp
Normal file
99
test/bind_no_placeholders_test.cpp
Normal file
@@ -0,0 +1,99 @@
|
||||
//
|
||||
// bind_no_placeholders_test.cpp - test for BOOST_BIND_NO_PLACEHOLDERS
|
||||
//
|
||||
// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
|
||||
// Copyright (c) 2001 David Abrahams
|
||||
// Copyright (c) 2015 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
|
||||
//
|
||||
|
||||
#define BOOST_BIND_NO_PLACEHOLDERS
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
//
|
||||
|
||||
long f_0()
|
||||
{
|
||||
return 17041L;
|
||||
}
|
||||
|
||||
long f_1(long a)
|
||||
{
|
||||
return a;
|
||||
}
|
||||
|
||||
long f_2(long a, long b)
|
||||
{
|
||||
return a + 10 * b;
|
||||
}
|
||||
|
||||
long f_3(long a, long b, long c)
|
||||
{
|
||||
return a + 10 * b + 100 * c;
|
||||
}
|
||||
|
||||
long f_4(long a, long b, long c, long d)
|
||||
{
|
||||
return a + 10 * b + 100 * c + 1000 * d;
|
||||
}
|
||||
|
||||
long f_5(long a, long b, long c, long d, long e)
|
||||
{
|
||||
return a + 10 * b + 100 * c + 1000 * d + 10000 * e;
|
||||
}
|
||||
|
||||
long f_6(long a, long b, long c, long d, long e, long f)
|
||||
{
|
||||
return a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f;
|
||||
}
|
||||
|
||||
long f_7(long a, long b, long c, long d, long e, long f, long g)
|
||||
{
|
||||
return a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g;
|
||||
}
|
||||
|
||||
long f_8(long a, long b, long c, long d, long e, long f, long g, long h)
|
||||
{
|
||||
return a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g + 10000000 * h;
|
||||
}
|
||||
|
||||
long f_9(long a, long b, long c, long d, long e, long f, long g, long h, long i)
|
||||
{
|
||||
return a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g + 10000000 * h + 100000000 * i;
|
||||
}
|
||||
|
||||
void function_test()
|
||||
{
|
||||
using namespace boost;
|
||||
|
||||
arg<1> _1;
|
||||
arg<2> _2;
|
||||
arg<3> _3;
|
||||
arg<4> _4;
|
||||
arg<5> _5;
|
||||
arg<6> _6;
|
||||
arg<7> _7;
|
||||
arg<8> _8;
|
||||
arg<9> _9;
|
||||
|
||||
BOOST_TEST( bind(f_0)() == 17041L );
|
||||
BOOST_TEST( bind(f_1, _1)(1) == 1L );
|
||||
BOOST_TEST( bind(f_2, _1, _2)(1, 2) == 21L );
|
||||
BOOST_TEST( bind(f_3, _1, _2, _3)(1, 2, 3) == 321L );
|
||||
BOOST_TEST( bind(f_4, _1, _2, _3, _4)(1, 2, 3, 4) == 4321L );
|
||||
BOOST_TEST( bind(f_5, _1, _2, _3, _4, _5)(1, 2, 3, 4, 5) == 54321L );
|
||||
BOOST_TEST( bind(f_6, _1, _2, _3, _4, _5, _6)(1, 2, 3, 4, 5, 6) == 654321L );
|
||||
BOOST_TEST( bind(f_7, _1, _2, _3, _4, _5, _6, _7)(1, 2, 3, 4, 5, 6, 7) == 7654321L );
|
||||
BOOST_TEST( bind(f_8, _1, _2, _3, _4, _5, _6, _7, _8)(1, 2, 3, 4, 5, 6, 7, 8) == 87654321L );
|
||||
BOOST_TEST( bind(f_9, _1, _2, _3, _4, _5, _6, _7, _8, _9)(1, 2, 3, 4, 5, 6, 7, 8, 9) == 987654321L );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
function_test();
|
||||
return boost::report_errors();
|
||||
}
|
||||
154
test/bind_noexcept_mf_test.cpp
Normal file
154
test/bind_noexcept_mf_test.cpp
Normal file
@@ -0,0 +1,154 @@
|
||||
//
|
||||
// bind_noexcept_mf_test.cpp
|
||||
//
|
||||
// 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.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(&X::f0, &x)();
|
||||
boost::bind(&X::f0, boost::ref(x))();
|
||||
|
||||
boost::bind(&X::g0, &x)();
|
||||
boost::bind(&X::g0, x)();
|
||||
boost::bind(&X::g0, boost::ref(x))();
|
||||
|
||||
// 1
|
||||
|
||||
boost::bind(&X::f1, &x, 1)();
|
||||
boost::bind(&X::f1, boost::ref(x), 1)();
|
||||
|
||||
boost::bind(&X::g1, &x, 1)();
|
||||
boost::bind(&X::g1, x, 1)();
|
||||
boost::bind(&X::g1, boost::ref(x), 1)();
|
||||
|
||||
// 2
|
||||
|
||||
boost::bind(&X::f2, &x, 1, 2)();
|
||||
boost::bind(&X::f2, boost::ref(x), 1, 2)();
|
||||
|
||||
boost::bind(&X::g2, &x, 1, 2)();
|
||||
boost::bind(&X::g2, x, 1, 2)();
|
||||
boost::bind(&X::g2, boost::ref(x), 1, 2)();
|
||||
|
||||
// 3
|
||||
|
||||
boost::bind(&X::f3, &x, 1, 2, 3)();
|
||||
boost::bind(&X::f3, boost::ref(x), 1, 2, 3)();
|
||||
|
||||
boost::bind(&X::g3, &x, 1, 2, 3)();
|
||||
boost::bind(&X::g3, x, 1, 2, 3)();
|
||||
boost::bind(&X::g3, boost::ref(x), 1, 2, 3)();
|
||||
|
||||
// 4
|
||||
|
||||
boost::bind(&X::f4, &x, 1, 2, 3, 4)();
|
||||
boost::bind(&X::f4, boost::ref(x), 1, 2, 3, 4)();
|
||||
|
||||
boost::bind(&X::g4, &x, 1, 2, 3, 4)();
|
||||
boost::bind(&X::g4, x, 1, 2, 3, 4)();
|
||||
boost::bind(&X::g4, boost::ref(x), 1, 2, 3, 4)();
|
||||
|
||||
// 5
|
||||
|
||||
boost::bind(&X::f5, &x, 1, 2, 3, 4, 5)();
|
||||
boost::bind(&X::f5, boost::ref(x), 1, 2, 3, 4, 5)();
|
||||
|
||||
boost::bind(&X::g5, &x, 1, 2, 3, 4, 5)();
|
||||
boost::bind(&X::g5, x, 1, 2, 3, 4, 5)();
|
||||
boost::bind(&X::g5, boost::ref(x), 1, 2, 3, 4, 5)();
|
||||
|
||||
// 6
|
||||
|
||||
boost::bind(&X::f6, &x, 1, 2, 3, 4, 5, 6)();
|
||||
boost::bind(&X::f6, boost::ref(x), 1, 2, 3, 4, 5, 6)();
|
||||
|
||||
boost::bind(&X::g6, &x, 1, 2, 3, 4, 5, 6)();
|
||||
boost::bind(&X::g6, x, 1, 2, 3, 4, 5, 6)();
|
||||
boost::bind(&X::g6, boost::ref(x), 1, 2, 3, 4, 5, 6)();
|
||||
|
||||
// 7
|
||||
|
||||
boost::bind(&X::f7, &x, 1, 2, 3, 4, 5, 6, 7)();
|
||||
boost::bind(&X::f7, boost::ref(x), 1, 2, 3, 4, 5, 6, 7)();
|
||||
|
||||
boost::bind(&X::g7, &x, 1, 2, 3, 4, 5, 6, 7)();
|
||||
boost::bind(&X::g7, x, 1, 2, 3, 4, 5, 6, 7)();
|
||||
boost::bind(&X::g7, boost::ref(x), 1, 2, 3, 4, 5, 6, 7)();
|
||||
|
||||
// 8
|
||||
|
||||
boost::bind(&X::f8, &x, 1, 2, 3, 4, 5, 6, 7, 8)();
|
||||
boost::bind(&X::f8, boost::ref(x), 1, 2, 3, 4, 5, 6, 7, 8)();
|
||||
|
||||
boost::bind(&X::g8, &x, 1, 2, 3, 4, 5, 6, 7, 8)();
|
||||
boost::bind(&X::g8, x, 1, 2, 3, 4, 5, 6, 7, 8)();
|
||||
boost::bind(&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
|
||||
97
test/bind_noexcept_test.cpp
Normal file
97
test/bind_noexcept_test.cpp
Normal file
@@ -0,0 +1,97 @@
|
||||
//
|
||||
// bind_noexcept_test.cpp
|
||||
//
|
||||
// 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.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if defined(BOOST_NO_CXX11_NOEXCEPT)
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
//
|
||||
|
||||
long f_0() noexcept
|
||||
{
|
||||
return 17041L;
|
||||
}
|
||||
|
||||
long f_1(long a) noexcept
|
||||
{
|
||||
return a;
|
||||
}
|
||||
|
||||
long f_2(long a, long b) noexcept
|
||||
{
|
||||
return a + 10 * b;
|
||||
}
|
||||
|
||||
long f_3(long a, long b, long c) noexcept
|
||||
{
|
||||
return a + 10 * b + 100 * c;
|
||||
}
|
||||
|
||||
long f_4(long a, long b, long c, long d) noexcept
|
||||
{
|
||||
return a + 10 * b + 100 * c + 1000 * d;
|
||||
}
|
||||
|
||||
long f_5(long a, long b, long c, long d, long e) noexcept
|
||||
{
|
||||
return a + 10 * b + 100 * c + 1000 * d + 10000 * e;
|
||||
}
|
||||
|
||||
long f_6(long a, long b, long c, long d, long e, long f) noexcept
|
||||
{
|
||||
return a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f;
|
||||
}
|
||||
|
||||
long f_7(long a, long b, long c, long d, long e, long f, long g) noexcept
|
||||
{
|
||||
return a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g;
|
||||
}
|
||||
|
||||
long f_8(long a, long b, long c, long d, long e, long f, long g, long h) noexcept
|
||||
{
|
||||
return a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g + 10000000 * h;
|
||||
}
|
||||
|
||||
long f_9(long a, long b, long c, long d, long e, long f, long g, long h, long i) noexcept
|
||||
{
|
||||
return a + 10 * b + 100 * c + 1000 * d + 10000 * e + 100000 * f + 1000000 * g + 10000000 * h + 100000000 * i;
|
||||
}
|
||||
|
||||
void function_test()
|
||||
{
|
||||
int const i = 1;
|
||||
|
||||
BOOST_TEST( boost::bind(f_0)(i) == 17041L );
|
||||
BOOST_TEST( boost::bind(f_1, _1)(i) == 1L );
|
||||
BOOST_TEST( boost::bind(f_2, _1, 2)(i) == 21L );
|
||||
BOOST_TEST( boost::bind(f_3, _1, 2, 3)(i) == 321L );
|
||||
BOOST_TEST( boost::bind(f_4, _1, 2, 3, 4)(i) == 4321L );
|
||||
BOOST_TEST( boost::bind(f_5, _1, 2, 3, 4, 5)(i) == 54321L );
|
||||
BOOST_TEST( boost::bind(f_6, _1, 2, 3, 4, 5, 6)(i) == 654321L );
|
||||
BOOST_TEST( boost::bind(f_7, _1, 2, 3, 4, 5, 6, 7)(i) == 7654321L );
|
||||
BOOST_TEST( boost::bind(f_8, _1, 2, 3, 4, 5, 6, 7, 8)(i) == 87654321L );
|
||||
BOOST_TEST( boost::bind(f_9, _1, 2, 3, 4, 5, 6, 7, 8, 9)(i) == 987654321L );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
function_test();
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,13 @@
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#ifndef BOOST_MSVC
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma warning(disable: 4786) // identifier truncated in debug info
|
||||
#pragma warning(disable: 4710) // function not inlined
|
||||
@@ -162,3 +170,5 @@ int main()
|
||||
member_function_test();
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#ifndef BOOST_MSVC
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma warning(disable: 4786) // identifier truncated in debug info
|
||||
#pragma warning(disable: 4710) // function not inlined
|
||||
@@ -108,3 +118,5 @@ int main()
|
||||
function_test();
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
75
test/bind_type_test.cpp
Normal file
75
test/bind_type_test.cpp
Normal file
@@ -0,0 +1,75 @@
|
||||
#include <boost/config.hpp>
|
||||
|
||||
//
|
||||
// bind_type_test.cpp
|
||||
//
|
||||
// Copyright (c) 2015 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.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
//
|
||||
|
||||
template<int I> struct X
|
||||
{
|
||||
};
|
||||
|
||||
void fv1( X<1> )
|
||||
{
|
||||
}
|
||||
|
||||
void fv2( X<1>, X<2> )
|
||||
{
|
||||
}
|
||||
|
||||
void fv3( X<1>, X<2>, X<3> )
|
||||
{
|
||||
}
|
||||
|
||||
void fv4( X<1>, X<2>, X<3>, X<4> )
|
||||
{
|
||||
}
|
||||
|
||||
void fv5( X<1>, X<2>, X<3>, X<4>, X<5> )
|
||||
{
|
||||
}
|
||||
|
||||
void fv6( X<1>, X<2>, X<3>, X<4>, X<5>, X<6> )
|
||||
{
|
||||
}
|
||||
|
||||
void fv7( X<1>, X<2>, X<3>, X<4>, X<5>, X<6>, X<7> )
|
||||
{
|
||||
}
|
||||
|
||||
void fv8( X<1>, X<2>, X<3>, X<4>, X<5>, X<6>, X<7>, X<8> )
|
||||
{
|
||||
}
|
||||
|
||||
void fv9( X<1>, X<2>, X<3>, X<4>, X<5>, X<6>, X<7>, X<8>, X<9> )
|
||||
{
|
||||
}
|
||||
|
||||
void test()
|
||||
{
|
||||
boost::bind( fv1, _1 )( X<1>() );
|
||||
boost::bind( fv2, _1, _2 )( X<1>(), X<2>() );
|
||||
boost::bind( fv3, _1, _2, _3 )( X<1>(), X<2>(), X<3>() );
|
||||
boost::bind( fv4, _1, _2, _3, _4 )( X<1>(), X<2>(), X<3>(), X<4>() );
|
||||
boost::bind( fv5, _1, _2, _3, _4, _5 )( X<1>(), X<2>(), X<3>(), X<4>(), X<5>() );
|
||||
boost::bind( fv6, _1, _2, _3, _4, _5, _6 )( X<1>(), X<2>(), X<3>(), X<4>(), X<5>(), X<6>() );
|
||||
boost::bind( fv7, _1, _2, _3, _4, _5, _6, _7 )( X<1>(), X<2>(), X<3>(), X<4>(), X<5>(), X<6>(), X<7>() );
|
||||
boost::bind( fv8, _1, _2, _3, _4, _5, _6, _7, _8 )( X<1>(), X<2>(), X<3>(), X<4>(), X<5>(), X<6>(), X<7>(), X<8>() );
|
||||
boost::bind( fv9, _1, _2, _3, _4, _5, _6, _7, _8, _9 )( X<1>(), X<2>(), X<3>(), X<4>(), X<5>(), X<6>(), X<7>(), X<8>(), X<9>() );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test();
|
||||
return boost::report_errors();
|
||||
}
|
||||
207
test/bind_unique_ptr_test.cpp
Normal file
207
test/bind_unique_ptr_test.cpp
Normal file
@@ -0,0 +1,207 @@
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) || defined( BOOST_NO_CXX11_SMART_PTR )
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
//
|
||||
// bind_unique_ptr_test.cpp
|
||||
//
|
||||
// Copyright (c) 2015 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.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <memory>
|
||||
|
||||
//
|
||||
|
||||
void fv1( std::unique_ptr<int> p1 )
|
||||
{
|
||||
BOOST_TEST( *p1 == 1 );
|
||||
}
|
||||
|
||||
void fv2( std::unique_ptr<int> p1, std::unique_ptr<int> p2 )
|
||||
{
|
||||
BOOST_TEST( *p1 == 1 );
|
||||
BOOST_TEST( *p2 == 2 );
|
||||
}
|
||||
|
||||
void fv3( std::unique_ptr<int> p1, std::unique_ptr<int> p2, std::unique_ptr<int> p3 )
|
||||
{
|
||||
BOOST_TEST( *p1 == 1 );
|
||||
BOOST_TEST( *p2 == 2 );
|
||||
BOOST_TEST( *p3 == 3 );
|
||||
}
|
||||
|
||||
void fv4( std::unique_ptr<int> p1, std::unique_ptr<int> p2, std::unique_ptr<int> p3, std::unique_ptr<int> p4 )
|
||||
{
|
||||
BOOST_TEST( *p1 == 1 );
|
||||
BOOST_TEST( *p2 == 2 );
|
||||
BOOST_TEST( *p3 == 3 );
|
||||
BOOST_TEST( *p4 == 4 );
|
||||
}
|
||||
|
||||
void fv5( std::unique_ptr<int> p1, std::unique_ptr<int> p2, std::unique_ptr<int> p3, std::unique_ptr<int> p4, std::unique_ptr<int> p5 )
|
||||
{
|
||||
BOOST_TEST( *p1 == 1 );
|
||||
BOOST_TEST( *p2 == 2 );
|
||||
BOOST_TEST( *p3 == 3 );
|
||||
BOOST_TEST( *p4 == 4 );
|
||||
BOOST_TEST( *p5 == 5 );
|
||||
}
|
||||
|
||||
void fv6( std::unique_ptr<int> p1, std::unique_ptr<int> p2, std::unique_ptr<int> p3, std::unique_ptr<int> p4, std::unique_ptr<int> p5, std::unique_ptr<int> p6 )
|
||||
{
|
||||
BOOST_TEST( *p1 == 1 );
|
||||
BOOST_TEST( *p2 == 2 );
|
||||
BOOST_TEST( *p3 == 3 );
|
||||
BOOST_TEST( *p4 == 4 );
|
||||
BOOST_TEST( *p5 == 5 );
|
||||
BOOST_TEST( *p6 == 6 );
|
||||
}
|
||||
|
||||
void fv7( std::unique_ptr<int> p1, std::unique_ptr<int> p2, std::unique_ptr<int> p3, std::unique_ptr<int> p4, std::unique_ptr<int> p5, std::unique_ptr<int> p6, std::unique_ptr<int> p7 )
|
||||
{
|
||||
BOOST_TEST( *p1 == 1 );
|
||||
BOOST_TEST( *p2 == 2 );
|
||||
BOOST_TEST( *p3 == 3 );
|
||||
BOOST_TEST( *p4 == 4 );
|
||||
BOOST_TEST( *p5 == 5 );
|
||||
BOOST_TEST( *p6 == 6 );
|
||||
BOOST_TEST( *p7 == 7 );
|
||||
}
|
||||
|
||||
void fv8( std::unique_ptr<int> p1, std::unique_ptr<int> p2, std::unique_ptr<int> p3, std::unique_ptr<int> p4, std::unique_ptr<int> p5, std::unique_ptr<int> p6, std::unique_ptr<int> p7, std::unique_ptr<int> p8 )
|
||||
{
|
||||
BOOST_TEST( *p1 == 1 );
|
||||
BOOST_TEST( *p2 == 2 );
|
||||
BOOST_TEST( *p3 == 3 );
|
||||
BOOST_TEST( *p4 == 4 );
|
||||
BOOST_TEST( *p5 == 5 );
|
||||
BOOST_TEST( *p6 == 6 );
|
||||
BOOST_TEST( *p7 == 7 );
|
||||
BOOST_TEST( *p8 == 8 );
|
||||
}
|
||||
|
||||
void fv9( std::unique_ptr<int> p1, std::unique_ptr<int> p2, std::unique_ptr<int> p3, std::unique_ptr<int> p4, std::unique_ptr<int> p5, std::unique_ptr<int> p6, std::unique_ptr<int> p7, std::unique_ptr<int> p8, std::unique_ptr<int> p9 )
|
||||
{
|
||||
BOOST_TEST( *p1 == 1 );
|
||||
BOOST_TEST( *p2 == 2 );
|
||||
BOOST_TEST( *p3 == 3 );
|
||||
BOOST_TEST( *p4 == 4 );
|
||||
BOOST_TEST( *p5 == 5 );
|
||||
BOOST_TEST( *p6 == 6 );
|
||||
BOOST_TEST( *p7 == 7 );
|
||||
BOOST_TEST( *p8 == 8 );
|
||||
BOOST_TEST( *p9 == 9 );
|
||||
}
|
||||
|
||||
void test()
|
||||
{
|
||||
{
|
||||
std::unique_ptr<int> p1( new int(1) );
|
||||
|
||||
boost::bind( fv1, _1 )( std::move( p1 ) );
|
||||
}
|
||||
|
||||
{
|
||||
std::unique_ptr<int> p1( new int(1) );
|
||||
std::unique_ptr<int> p2( new int(2) );
|
||||
|
||||
boost::bind( fv2, _1, _2 )( std::move( p1 ), std::move( p2 ) );
|
||||
}
|
||||
|
||||
{
|
||||
std::unique_ptr<int> p1( new int(1) );
|
||||
std::unique_ptr<int> p2( new int(2) );
|
||||
std::unique_ptr<int> p3( new int(3) );
|
||||
|
||||
boost::bind( fv3, _1, _2, _3 )( std::move( p1 ), std::move( p2 ), std::move( p3 ) );
|
||||
}
|
||||
|
||||
{
|
||||
std::unique_ptr<int> p1( new int(1) );
|
||||
std::unique_ptr<int> p2( new int(2) );
|
||||
std::unique_ptr<int> p3( new int(3) );
|
||||
std::unique_ptr<int> p4( new int(4) );
|
||||
|
||||
boost::bind( fv4, _1, _2, _3, _4 )( std::move( p1 ), std::move( p2 ), std::move( p3 ), std::move( p4 ) );
|
||||
}
|
||||
|
||||
{
|
||||
std::unique_ptr<int> p1( new int(1) );
|
||||
std::unique_ptr<int> p2( new int(2) );
|
||||
std::unique_ptr<int> p3( new int(3) );
|
||||
std::unique_ptr<int> p4( new int(4) );
|
||||
std::unique_ptr<int> p5( new int(5) );
|
||||
|
||||
boost::bind( fv5, _1, _2, _3, _4, _5 )( std::move( p1 ), std::move( p2 ), std::move( p3 ), std::move( p4 ), std::move( p5 ) );
|
||||
}
|
||||
|
||||
{
|
||||
std::unique_ptr<int> p1( new int(1) );
|
||||
std::unique_ptr<int> p2( new int(2) );
|
||||
std::unique_ptr<int> p3( new int(3) );
|
||||
std::unique_ptr<int> p4( new int(4) );
|
||||
std::unique_ptr<int> p5( new int(5) );
|
||||
std::unique_ptr<int> p6( new int(6) );
|
||||
|
||||
boost::bind( fv6, _1, _2, _3, _4, _5, _6 )( std::move( p1 ), std::move( p2 ), std::move( p3 ), std::move( p4 ), std::move( p5 ), std::move( p6 ) );
|
||||
}
|
||||
|
||||
{
|
||||
std::unique_ptr<int> p1( new int(1) );
|
||||
std::unique_ptr<int> p2( new int(2) );
|
||||
std::unique_ptr<int> p3( new int(3) );
|
||||
std::unique_ptr<int> p4( new int(4) );
|
||||
std::unique_ptr<int> p5( new int(5) );
|
||||
std::unique_ptr<int> p6( new int(6) );
|
||||
std::unique_ptr<int> p7( new int(7) );
|
||||
|
||||
boost::bind( fv7, _1, _2, _3, _4, _5, _6, _7 )( std::move( p1 ), std::move( p2 ), std::move( p3 ), std::move( p4 ), std::move( p5 ), std::move( p6 ), std::move( p7 ) );
|
||||
}
|
||||
|
||||
{
|
||||
std::unique_ptr<int> p1( new int(1) );
|
||||
std::unique_ptr<int> p2( new int(2) );
|
||||
std::unique_ptr<int> p3( new int(3) );
|
||||
std::unique_ptr<int> p4( new int(4) );
|
||||
std::unique_ptr<int> p5( new int(5) );
|
||||
std::unique_ptr<int> p6( new int(6) );
|
||||
std::unique_ptr<int> p7( new int(7) );
|
||||
std::unique_ptr<int> p8( new int(8) );
|
||||
|
||||
boost::bind( fv8, _1, _2, _3, _4, _5, _6, _7, _8 )( std::move( p1 ), std::move( p2 ), std::move( p3 ), std::move( p4 ), std::move( p5 ), std::move( p6 ), std::move( p7 ), std::move( p8 ) );
|
||||
}
|
||||
|
||||
{
|
||||
std::unique_ptr<int> p1( new int(1) );
|
||||
std::unique_ptr<int> p2( new int(2) );
|
||||
std::unique_ptr<int> p3( new int(3) );
|
||||
std::unique_ptr<int> p4( new int(4) );
|
||||
std::unique_ptr<int> p5( new int(5) );
|
||||
std::unique_ptr<int> p6( new int(6) );
|
||||
std::unique_ptr<int> p7( new int(7) );
|
||||
std::unique_ptr<int> p8( new int(8) );
|
||||
std::unique_ptr<int> p9( new int(9) );
|
||||
|
||||
boost::bind( fv9, _1, _2, _3, _4, _5, _6, _7, _8, _9 )( std::move( p1 ), std::move( p2 ), std::move( p3 ), std::move( p4 ), std::move( p5 ), std::move( p6 ), std::move( p7 ), std::move( p8 ), std::move( p9 ) );
|
||||
}
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test();
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif // #if defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) || defined( BOOST_NO_CXX11_SMART_PTR )
|
||||
20
test/cmake_subdir_test/CMakeLists.txt
Normal file
20
test/cmake_subdir_test/CMakeLists.txt
Normal file
@@ -0,0 +1,20 @@
|
||||
# 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)
|
||||
|
||||
project(cmake_subdir_test LANGUAGES CXX)
|
||||
|
||||
add_subdirectory(../.. boostorg/bind)
|
||||
add_subdirectory(../../../assert boostorg/assert)
|
||||
add_subdirectory(../../../config boostorg/config)
|
||||
add_subdirectory(../../../core boostorg/core)
|
||||
|
||||
add_executable(quick ../quick.cpp)
|
||||
target_link_libraries(quick Boost::bind Boost::core)
|
||||
|
||||
enable_testing()
|
||||
add_test(quick quick)
|
||||
|
||||
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
|
||||
@@ -1,5 +1,13 @@
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#ifndef BOOST_MSVC
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma warning(disable: 4786) // identifier truncated in debug info
|
||||
#pragma warning(disable: 4710) // function not inlined
|
||||
@@ -184,3 +192,5 @@ int main()
|
||||
|
||||
return detect_errors(x.hash == 17610 && sp->hash == 2155);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#ifndef BOOST_MSVC
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma warning(disable: 4786) // identifier truncated in debug info
|
||||
#pragma warning(disable: 4710) // function not inlined
|
||||
@@ -184,3 +192,5 @@ int main()
|
||||
|
||||
return detect_errors(x.hash == 17610 && sp->hash == 2155);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#ifndef BOOST_MSVC
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma warning(disable: 4786) // identifier truncated in debug info
|
||||
#pragma warning(disable: 4710) // function not inlined
|
||||
@@ -184,3 +192,5 @@ int main()
|
||||
|
||||
return detect_errors(x.hash == 17610 && sp->hash == 2155);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
37
test/placeholder_const_ref_test.cpp
Normal file
37
test/placeholder_const_ref_test.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// placeholder_const_ref_test.cpp - forming a const& to _1
|
||||
//
|
||||
// Copyright 2015 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/placeholders.hpp>
|
||||
#include <boost/is_placeholder.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
//
|
||||
|
||||
template<class T> void test( T const &, int i )
|
||||
{
|
||||
BOOST_TEST_EQ( boost::is_placeholder<T>::value, i );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace boost::placeholders;
|
||||
|
||||
test( _1, 1 );
|
||||
test( _2, 2 );
|
||||
test( _3, 3 );
|
||||
test( _4, 4 );
|
||||
test( _5, 5 );
|
||||
test( _6, 6 );
|
||||
test( _7, 7 );
|
||||
test( _8, 8 );
|
||||
test( _9, 9 );
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
46
test/placeholder_std_bind_test.cpp
Normal file
46
test/placeholder_std_bind_test.cpp
Normal file
@@ -0,0 +1,46 @@
|
||||
//
|
||||
// placeholder_std_bind_test.cpp - std::bind with Boost's _1
|
||||
//
|
||||
// Copyright 2016 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/config.hpp>
|
||||
|
||||
#if defined( BOOST_NO_CXX11_HDR_FUNCTIONAL )
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <functional>
|
||||
|
||||
namespace std
|
||||
{
|
||||
|
||||
template<int N> struct is_placeholder< boost::arg<N> >: public integral_constant<int, N> {};
|
||||
|
||||
} // namespace std
|
||||
|
||||
int foo( int i )
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
BOOST_TEST_EQ( std::bind( foo, _1 )( 1 ), 1 );
|
||||
BOOST_TEST_EQ( std::bind( foo, _2 )( 1, 2 ), 2 );
|
||||
BOOST_TEST_EQ( std::bind( foo, _3 )( 1, 2, 3 ), 3 );
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -8,7 +8,7 @@
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/bind/protect.hpp>
|
||||
#include <boost/bind/bind.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
|
||||
27
test/quick.cpp
Normal file
27
test/quick.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// quick.cpp - a quick test for boost/bind.hpp
|
||||
//
|
||||
// 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.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
int f( int a, int b, int c )
|
||||
{
|
||||
return a + 10 * b + 100 * c;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
int const i = 1;
|
||||
|
||||
BOOST_TEST_EQ( boost::bind( f, _1, 2, 3 )( i ), 321 );
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
Reference in New Issue
Block a user