Compare commits

...

504 Commits

Author SHA1 Message Date
Andrey Semashev
27d0bfaf8c Merge branch 'develop' 2021-03-17 17:35:27 +03:00
Andrey Semashev
e38b1160ae Disabled python tests on Cygwin and Cygwin64 on AppVeyor CI.
Python headers are not installed in Cygwin and Cygwin64, so the compiler
picks up Win32 headers in C:\Python27\Include and fails.
2021-03-17 12:12:39 +03:00
Andrey Semashev
6f4cdc939d Fixed Boost.Bind deprecated warnings in tests. 2021-03-17 11:55:40 +03:00
Andrey Semashev
63104db02c Added a missing include in test. 2021-03-17 11:55:40 +03:00
Andrey Semashev
8f1405b880 Converted clang APT references to source lines for Tranis CI.
APT references are not consistently defined for all clang versions
on all Ubuntu instances, so just always use explicit APT source lines.
2021-03-17 11:55:40 +03:00
Andrey Semashev
c397e90107 Fixed a typo in AppVeyor CI config. 2021-03-17 02:58:33 +03:00
Andrey Semashev
b3ed2d1bcf CI updates: new compilers, git checkout and job running optimizations. 2021-03-17 02:51:46 +03:00
Andrey Semashev
3eada7d595 Added README.md. 2021-03-17 01:53:38 +03:00
Andrey Semashev
9f0b903f88 Corrected typos and added a reference to PR for MSVC 2015 workaround. 2021-03-14 14:10:23 +03:00
Andrey Semashev
187377089a Merge pull request #109 from OBorce/fix-msvc2015-default_r_
Fix default_r_ move constructor on MSVC 2015
2021-03-14 14:06:02 +03:00
Boris Oncev
983bf6bebc Fix default_r_ move constructor on MSVC 2015
MSVC 2015 misscompiles moves for classes containing RValue refs
using the default generated move constructor when moving into a
function.

Example of reproduction:

struct RValueHolder {
  std::string&& str;
};

bool buggy_move(RValueHolder dead) {
  // here str is not referencing the string any more
  return dead.str == "p";
}

TEST(Bug, TmpBug) {
  std::string p = "p";
  auto t = RValueHolder{ std::move(p) };
  auto res = buggy_move(std::move(t));
  EXPECT_TRUE(res);
}

Fixes boostorg/log#132
2021-03-14 09:20:36 +00:00
Edward Diener
e16f1025d7 Merge pull request #107 from eldiener/develop
[skip ci] Add "cxxstd" json field
2021-01-21 02:01:06 -05:00
Edward Diener
7d168437b7 [skip ci] Add "cxxstd" json field. The "cxxstd" json field is being added to each Boost library's meta json information for libraries in order to specify the minumum C++ standard compilation level. The value of this field matches one of the values for 'cxxstd' in Boost.Build. The purpose of doing this is to provide information for the Boost website documentation for each library which will specify the minimum C++ standard compilation that an end-user must employ in order to use the particular library. This will aid end-users who want to know if they can successfully use a Boost library based on their C++ compiler's compilation level, without having to search the library's documentation to find this out. 2021-01-20 23:57:10 -05:00
Glen Fernandes
d59eb4aadd Merge branch 'develop' 2020-09-05 13:51:56 -04:00
Edward Diener
9fc61ba8ff Merge pull request #103 from eldiener/develop
Changes for Embarcadero C++ clang-based compilers, targeting Boost 1.74. Change __BORLANDC__ to BOOST_BORLANDC, which is defined in Boost conf…
2020-08-14 23:49:25 -04:00
Edward Diener
fb1a25471c Change __BORLANDC__ to BOOST_BORLANDC, which is defined in Boost config for the Embarcadero non-clang-based compilers. 2020-03-31 14:17:56 -04:00
Glen Fernandes
59306fe2ed Merge pull request #99 from Lastique/fix_arg_with_default_rvalue
Fix argument value selection with an rvalue default
2020-03-23 11:07:24 -04:00
Andrey Semashev
201a7e20d0 Fix argument value selection with an rvalue default.
In C++11 mode, when named parameter pack was a single tagged argument,
parameter value was not extracted when an rvalue default value was
provided by the user (instead, the default value was returned). This
commit adds a missing overload for default_r_, which returns the parameter
value.

Fixes https://github.com/boostorg/parameter/issues/97.
2020-03-15 18:20:34 +03:00
Glen Fernandes
c31433af1f Merge branch 'develop' 2019-12-21 15:09:35 -05:00
Glen Fernandes
0f548424a5 BOOST_PARAMETER_ prefix include guard macros 2019-12-18 08:45:43 -05:00
Cromwell D. Enage
ba78e65f93 Merge 'develop' to 'master' 2019-10-09 05:45:12 -04:00
Cromwell D. Enage
5a2328751a Reinstate documentation with corrections 2019-10-09 05:41:21 -04:00
CromwellEnage
e80fba3fd9 Reinstate documentation with corrections 2019-10-09 05:39:39 -04:00
Cromwell D. Enage
0d482ed0cf Merge with boostorg/parameter 2019-09-02 17:21:15 -04:00
Cromwell D. Enage
1baff677d5 Temporarily remove broken documentation source files.
Temporarily disable document autogeneration.
2019-08-08 22:00:01 -04:00
CromwellEnage
a028278ec5 Temporarily disable document autogeneration 2019-08-08 19:19:42 -04:00
CromwellEnage
3d430b22be Temporarily remove broken documentation source files. 2019-08-07 23:18:32 -04:00
Cromwell D. Enage
c2f24094f1 Merge 'develop' to 'master' 2019-06-28 20:32:25 -04:00
Cromwell D. Enage
a6024c0ec7 Merge with boostorg/parameter 2019-06-28 17:35:49 -04:00
Cromwell D. Enage
6037aee098 Merge pull request #87 from CromwellEnage/fix_issues
Remove unnecessary BOOST_CONSTEXPR occurrences
2019-06-28 17:25:42 -04:00
CromwellEnage
2d7414f095 Remove unnecessary BOOST_CONSTEXPR occurrences
Fix Issue #86.
2019-06-28 05:55:16 -04:00
Cromwell D. Enage
a0ed362e76 Merge 'develop' to 'master' 2019-06-20 23:03:43 -04:00
Cromwell D. Enage
015aff617b Merge with boostorg/parameter 2019-06-20 17:45:26 -04:00
Cromwell D. Enage
e2d589dec7 Upgrade .travis.yml
* Add clang++-6.0 with cxxstd=2a for linux, clang++-7 for linux, and clang++-8 for linux to test matrix.
* Change sources to adapt to change in Travis Cl test environment from "trusty" to "xenial".
2019-06-20 16:23:46 -04:00
CromwellEnage
f933d797fe Upgrade .travis.yml
* Add clang++-6.0 with cxxstd=2a for linux, clang++-7 for linux, and clang++-8 for linux to test matrix.
* Change sources to adapt to change in Travis Cl test environment from "trusty" to "xenial".
2019-06-19 20:54:20 -04:00
Cromwell D. Enage
979d8091ad Merge with boostorg/parameter 2019-04-30 08:56:27 -04:00
Cromwell D. Enage
75e9295748 Merge pull request #76 from Mike-Devel/min_cmake
Add minimal cmake support
2019-04-30 08:54:02 -04:00
Cromwell D. Enage
dc6cb9a2fd Merge pull request #82 from boostorg/develop
Merge 'develop' to 'master'
2019-04-30 08:34:43 -04:00
Cromwell D. Enage
c28195f464 Merge with boostorg/parameter 2019-04-29 23:54:59 -04:00
Cromwell D. Enage
3876bdf4b2 Merge pull request #81 from CromwellEnage/fix_regressions
Fix compiler errors for MSVC-14.2
2019-04-29 23:51:13 -04:00
CromwellEnage
0bb3ba54da Fix compiler errors for MSVC-14.2 2019-04-29 18:07:43 -04:00
Cromwell D. Enage
8f2cd502bf Merge pull request #77 from boostorg/develop
Merge 'develop' changes
2019-04-28 00:16:18 -04:00
Cromwell D. Enage
914b0a32c8 Merge with boostorg/parameter 2019-04-27 17:50:04 -04:00
Cromwell D. Enage
0ba17c2e2a Merge pull request #79 from CromwellEnage/doc_reference
Add missing reference documentation for lazy_value_type
2019-04-27 17:46:44 -04:00
CromwellEnage
e3849687e4 Add missing reference documentation for lazy_value_type 2019-04-27 16:24:26 -04:00
Cromwell D. Enage
e24f86a7fa Merge with boostorg/parameter 2019-04-27 16:23:15 -04:00
Cromwell D. Enage
384cd299ec Merge pull request #78 from CromwellEnage/update_scripts
Update appveyor.yml to handle changes in Boost.Build
2019-04-27 16:21:57 -04:00
CromwellEnage
241be29095 Update appveyor.yml to handle changes in Boost.Build 2019-04-27 14:45:20 -04:00
Cromwell D. Enage
309dd7e1c1 Merge with boostorg/parameter 2019-04-27 14:44:00 -04:00
Cromwell D. Enage
dbf4dd24f5 Merge pull request #75 from CromwellEnage/feature_compose
Add metafunction result_of::compose
2019-04-27 07:57:48 -04:00
Cromwell D. Enage
6509aa3bad Merge pull request #74 from CromwellEnage/update_config
Set BOOST_PARAMETER_COMPOSE_MAX_ARITY to 20 for GCC 5-
2019-04-27 07:57:11 -04:00
Mike Dev
3ced1d1ac8 [CMake] Remove unnecessary dependency for test 2019-04-15 17:12:12 +02:00
Mike Dev
5e80ac9882 [CMake] Fix whitespace 2019-04-15 12:36:31 +02:00
Mike Dev
7812625cdd [CMake] Allow running of (some) unit tests from cmake 2019-04-15 11:51:06 +02:00
Mike Dev
fd2ecd6924 [CMake] Add minimal cmake support for add_subdirectory 2019-04-15 11:50:24 +02:00
CromwellEnage
7d1cee2cb7 Add metafunction result_of::compose
Some Boost.Graph algorithms return one of their optional named function parameters.  If the user doesn't specify the parameter, then the default return type must necessarily be different.  This metafunction is needed to help facilitate computation of such a return type without resorting to decltype(), which not all compilers support.
2019-02-19 10:55:25 -05:00
CromwellEnage
352f6fb4a8 Set BOOST_PARAMETER_COMPOSE_MAX_ARITY to 20 for GCC 5-
The Boost regression test matrix shows failures with GCC 5 due to running out of heap space. The goal of this commit is to eliminate these failures.
2019-02-15 16:51:06 -05:00
CromwellEnage
2482e7db56 Set BOOST_PARAMETER_COMPOSE_MAX_ARITY to 20 for MinGW
In my GitHub fork of Boost.Graph, I've been upgrading some algorithms to use BOOST_PARAMETER_FUNCTION, but MinGW with GCC 5.3.0 has been running out of heap space on some of the affected tests.  The goal of this commit is to eliminate these occurrences.
2019-02-14 08:36:29 -05:00
Cromwell D. Enage
52c440a5ae Merge with boostorg/parameter 2019-02-14 08:30:12 -05:00
Edward Diener
9f778f0d62 Merge pull request #73 from CromwellEnage/feature_parameter_dependent_return_types
Improve support for parameter-dependent return types of functions generated by preprocessor macros
2019-02-04 10:23:43 -05:00
CromwellEnage
af3411f506 Restrict #include statements to one line each 2019-02-03 23:27:46 -05:00
CromwellEnage
66a363b4c6 Remove extraneous whitespace 2019-02-02 19:53:08 -05:00
CromwellEnage
e0b16eb3e9 Improve support for parameter-dependent return types of functions generated by preprocessor macros
The code generation macros are supposed to support parameter-dependent return types, but it turns out that they currently don't really do that.  This commit fixes the issue.
2019-02-02 09:31:15 -05:00
Cromwell D. Enage
4170d35555 Merge with boostorg/parameter 2019-02-02 08:21:49 -05:00
Edward Diener
541e9ade24 Merge pull request #71 from CromwellEnage/internal_fixes
Eliminate warnings regarding undefined inline functions
2019-01-25 17:14:04 -05:00
CromwellEnage
3bf8242fe4 Eliminate warnings regarding undefined inline functions 2019-01-22 03:19:38 -05:00
Cromwell D. Enage
9bde4a2260 Merge with boostorg/parameter 2019-01-22 03:06:49 -05:00
Edward Diener
f453a586f3 Merge pull request #70 from CromwellEnage/feature_mp11
Reinstate MP11 support for ArgumentPacks
2019-01-21 16:43:09 -05:00
CromwellEnage
7b2d3f6e41 Reinstate MP11 support for ArgumentPacks
Argument packs qualify as Boost.MP11-style maps as well as MPL sequences.  These maps store the keyword tag types as their keys.
2019-01-21 01:14:59 -05:00
Cromwell D. Enage
2b796a8746 Merge with boostorg/parameter 2019-01-21 01:09:19 -05:00
Edward Diener
e7c2118e91 Merge pull request #69 from CromwellEnage/feature_mp11
Modify MP11 support
2019-01-20 07:36:29 -05:00
CromwellEnage
6bce8119bf Disable MP11 usage for affected tests 2019-01-19 17:42:41 -05:00
CromwellEnage
fe73177b6c Modify MP11 support
These are breaking changes to PR #66.

* Remove are_tagged_arguments_mp11 and is_argument_pack_mp11.  They were reviewed as redundant.
* Remove MP11 support for ArgumentPack models for now.  (This feature relied on templates that were not supposed to be specialized.)
2019-01-19 15:15:20 -05:00
Cromwell D. Enage
59616f3a0a Merge with boostorg/parameter 2019-01-19 13:20:19 -05:00
Edward Diener
54a3f15a57 Merge pull request #68 from CromwellEnage/doc_nullptr
Remove erroneous 'std::' prefix from nullptr in documentation
2019-01-19 11:23:48 -05:00
Edward Diener
9a84ed5cdb Merge pull request #67 from CromwellEnage/remove_dependency_on_tti
Remove dependency on Boost.TTI
2019-01-19 11:23:01 -05:00
CromwellEnage
8d1c3f57a1 Remove erroneous 'std::' prefix from nullptr in documentation 2019-01-17 15:23:06 -05:00
CromwellEnage
fb5683766b Remove dependency on Boost.TTI
Replace BOOST_TTI_DETAIL_NULLPTR with BOOST_PARAMETER_AUX_PP_NULLPTR.
2019-01-17 15:14:48 -05:00
Cromwell D. Enage
977ff25b1b Merge with boostorg/parameter 2019-01-17 15:00:27 -05:00
Edward Diener
4a5356b229 Merge pull request #66 from CromwellEnage/feature_mp11
Support Boost.MP11 when feasible
2019-01-16 18:44:14 -05:00
CromwellEnage
69db508992 Support Boost.MP11 when feasible
* Add are_tagged_arguments_mp11 and is_argument_pack_mp11 metafunctions when Boost.MP11 is usable.
* Predicate requirements can be encoded as Boost.MP11-style quoted metafunctions as well as by MPL binary metafunction classes.
* Argument packs qualify as Boost.MP11-style lists as well as MPL sequences.
* Internal components and test programs use Boost.MP11 and C++11 type traits vice MPL and Boost.TypeTraits when Boost.MP11 is usable.
2019-01-16 12:03:44 -05:00
Cromwell D. Enage
689a9525d4 Merge with boostorg/parameter 2019-01-16 09:57:59 -05:00
Edward Diener
e2896116be Merge pull request #64 from CromwellEnage/feature_constexpr
Qualify applicable constructors & functions with BOOST_CONSTEXPR
2019-01-16 09:09:22 -05:00
Edward Diener
313cde1d99 Merge pull request #63 from CromwellEnage/test_suite
Update test suite
2019-01-16 09:08:43 -05:00
CromwellEnage
ead2cb4519 Qualify applicable constructors & functions with BOOST_CONSTEXPR
The reference documentation specifies this for some of the constructors and functions.
2019-01-16 03:43:48 -05:00
CromwellEnage
a2f68bea6c Update test suite
* Add "test/literate/parameter-enabled-function-call-operators0.cpp" to test suite under alias 'parameter_literate_tests'.
* Add compose() test routine to "test/compose.cpp"
* Replace LIBS_PARAMETER_TEST_COMPILE_FAILURE_MSVC with LIBS_PARAMETER_TEST_COMPILE_FAILURE_VENDOR_SPECIFIC in case compilers other than MSVC start exhibiting errant behavior.
* Adjust for the fact that BOOST_PARAMETER_MAX_ARITY is defined regardless of whether or not BOOST_PARAMETER_HAS_PERFECT_FORWARDING is defined.
* Use minimal file headers to #include vice <boost/parameter.hpp>.
2019-01-16 03:21:13 -05:00
Cromwell D. Enage
b5f02c0aaa Merge with boostorg/parameter 2019-01-16 00:52:05 -05:00
Edward Diener
515c80fad5 Merge pull request #62 from CromwellEnage/test_deduced_unmatched_arg
Update deduced_unmatched_arg.cpp
2019-01-15 23:09:51 -05:00
Edward Diener
b531b64f7b Merge pull request #61 from CromwellEnage/feature_compose_max_arity
Add configuration macro BOOST_PARAMETER_COMPOSE_MAX_ARITY
2019-01-15 23:08:22 -05:00
Edward Diener
1fde7ae869 Merge pull request #60 from CromwellEnage/test_fix
Fix typos
2019-01-15 23:07:46 -05:00
Edward Diener
cb267e5125 Merge pull request #58 from CromwellEnage/test_preprocessor_guards
Update BOOST_PARAMETER_*_ARITY preprocessor guard statements
2019-01-15 23:07:17 -05:00
Edward Diener
387449a12c Merge pull request #57 from CromwellEnage/test_evaluate_category_16
Update evaluate_category_16.cpp
2019-01-15 23:06:55 -05:00
CromwellEnage
c465139bc2 Update deduced_unmatched_arg.cpp
* Normalize license wording.
* Add statements to #include header files that directly define components used in this test.
* Qualify by namespace vice using declarations.
2019-01-14 22:51:12 -05:00
CromwellEnage
e5337e2503 Add configuration macro BOOST_PARAMETER_COMPOSE_MAX_ARITY
Decouple the compose() function and the BOOST_PARAMETER_NO_SPEC_* code generation macros from BOOST_PARAMETER_MAX_ARITY for older compilers so their generated functions can take in more arguments.
2019-01-14 17:05:14 -05:00
CromwellEnage
f2083c84ec Fix typos 2019-01-14 16:55:16 -05:00
CromwellEnage
261819d9bb Update evaluate_category_16.cpp
* Update BOOST_PARAMETER_*_ARITY preprocessor guard statements.
* Use minimal header files to #include.
* Use namespace qualification
2019-01-14 14:46:20 -05:00
CromwellEnage
6451c94720 Update BOOST_PARAMETER_*_ARITY preprocessor guard statements 2019-01-14 14:43:08 -05:00
Cromwell D. Enage
b208f3a837 Merge with boostorg/parameter 2019-01-14 13:10:17 -05:00
Edward Diener
cadc4ecbff Merge pull request #55 from CromwellEnage/test_efficiency
Use minimal header file to #include
2019-01-14 12:53:36 -05:00
Edward Diener
7c9e79aa6e Merge pull request #54 from CromwellEnage/test_singular
Move #include statement to correct place
2019-01-14 12:50:53 -05:00
Edward Diener
b20458faa0 Merge pull request #53 from CromwellEnage/test_max_arity_preproc_guards
Update BOOST_PARAMETER_*_ARITY preprocessor guard statements
2019-01-14 12:49:33 -05:00
Edward Diener
f28b14e686 Merge pull request #52 from CromwellEnage/feature_compose_and_macros
Add are_tagged_arguments<>, compose(), and code generation macros
2019-01-14 12:47:54 -05:00
Edward Diener
5c3dc99d82 Merge pull request #50 from CromwellEnage/workaround_gcc3_or_less
Add workarounds for GCC 3.x or earlier
2019-01-14 12:46:44 -05:00
Edward Diener
55e977964a Merge pull request #49 from CromwellEnage/doc_reference_upgrade
Upgrade reference documentation
2019-01-14 12:43:54 -05:00
Edward Diener
7a430fdfd0 Merge pull request #47 from CromwellEnage/feature_mp11
Introduce support for Boost.MP11
2019-01-14 12:43:30 -05:00
Edward Diener
dab935934e Merge pull request #45 from CromwellEnage/preprocessor_generated_overloads
Upgrade code generation macros
2019-01-14 12:35:37 -05:00
Edward Diener
5d3964f4b6 Merge pull request #44 from CromwellEnage/literate_update
Update literate tests and tutorial documentation
2019-01-14 12:33:26 -05:00
Edward Diener
26cf7a7003 Merge pull request #42 from CromwellEnage/travis_upgrade
Upgrade .travis.yml
2019-01-14 12:32:32 -05:00
CromwellEnage
0a1cd586c0 Change access scope of implementation typedefs from public to private; change spelling 2019-01-14 00:23:59 -05:00
CromwellEnage
d5165a3388 Move #include statement to correct place 2019-01-13 22:58:46 -05:00
CromwellEnage
81406effc8 Upgrade reference documentation
* Add example to compose() function documentation.
* Add cross-referencing hyperlinks & hyperlinks to C++ standard documentation.
2019-01-13 22:53:31 -05:00
CromwellEnage
cada51d711 Fix numbering & const font 2019-01-13 22:35:33 -05:00
CromwellEnage
a9ee94a21b Use minimal header file to #include 2019-01-04 11:43:48 -05:00
CromwellEnage
af65130fa1 Update BOOST_PARAMETER_*_ARITY preprocessor guard statements
Adjust for the fact that BOOST_PARAMETER_MAX_ARITY is defined regardless of whether or not BOOST_PARAMETER_HAS_PERFECT_FORWARDING is defined.
2019-01-04 11:40:07 -05:00
CromwellEnage
a876a4b400 Move #include statement to correct place 2019-01-04 11:32:46 -05:00
CromwellEnage
016f949eba Add are_tagged_arguments<>, compose(), and code generation macros
* Add variadic metafunction boost::parameter::are_tagged_arguments to help improve overload resolution capabilities.  Used by compose() and the new BOOST_PARAMETER_NO_SPEC_* code generation macros.
* Add variadic function template compose() which takes in named arguments and returns them in an argument pack.
* Add code generation macros BOOST_PARAMETER_BASIC_FUNCTION_CALL_OPERATOR, BOOST_PARAMETER_BASIC_CONST_FUNCTION_CALL_OPERATOR, BOOST_PARAMETER_NO_SPEC_FUNCTION, BOOST_PARAMETER_NO_SPEC_MEMBER_FUNCTION, BOOST_PARAMETER_NO_SPEC_CONST_MEMBER_FUNCTION, BOOST_PARAMETER_NO_SPEC_FUNCTION_CALL_OPERATOR, BOOST_PARAMETER_NO_SPEC_CONST_FUNCTION_CALL_OPERATOR, BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR, and BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR.
2019-01-04 08:39:53 -05:00
CromwellEnage
fe34412116 Add workarounds for GCC 3.x or earlier
* Fix compiler error: base `boost::reference_wrapper<int>' with only non-default constructor in class without a constructor.
* Ignore normalized_argument_types test failures.
2019-01-04 03:57:15 -05:00
CromwellEnage
dcef517081 Upgrade reference documentation
Add usage examples to & remove unnecessary implementation details from reference documentation.
2019-01-04 03:45:54 -05:00
CromwellEnage
c228d46eaf Introduce support for Boost.MP11
<boost/parameter/config.hpp>
* Introduce configuration macros BOOST_PARAMETER_CAN_USE_MP11 and BOOST_PARAMETER_DISABLE_MP11 usage.
* Update perfect forwarding support requirements to fix regressions on test matrix.

<boost/parameter/parameters.hpp>
* Allow mp11::mp_list to be default parameter_spec type if available.
2019-01-04 02:33:50 -05:00
CromwellEnage
250de8367d Upgrade code generation macros
Enable preprocessor-generated function call operator overloads & overloads of the same name to coexist even with deduced arguments.  SFINAE required.
2019-01-01 20:12:13 -05:00
CromwellEnage
01be812580 Update literate tests and tutorial documentation
* Fix compiler failures showing up on regression test matrix due to void return type.
* Fix gcc-3.4 failures showing up regression test matrix due to binding string literals to non-const references to char const*.
* Update tutorial documentation to match literate tests.
2019-01-01 05:27:18 -05:00
CromwellEnage
cbc2663a6c Upgrade .travis.yml
Add clang++-6.0 for linux to test matrix.
2018-12-22 04:58:29 -05:00
Cromwell D. Enage
dd89b991cf Merge with boostorg/parameter 2018-12-22 03:09:43 -05:00
Edward Diener
ee106a3aa1 Updated for b2 cmake support. 2018-12-19 22:32:58 -05:00
Cromwell D. Enage
a5d0ec380f Merge with boostorg/parameter 2018-12-02 06:19:23 -05:00
Edward Diener
28efddc033 Merge pull request #38 from CromwellEnage/doc_index
Fix argument composition tutorial documentation
2018-12-02 01:38:32 -05:00
Edward Diener
756b98bf32 Merge pull request #37 from CromwellEnage/mpl_has_key
Fix mpl::has_key_impl<parameter::aux::arg_list_tag> specialization
2018-12-02 01:37:03 -05:00
CromwellEnage
1626f23369 Fix argument composition tutorial documentation
The compose.cpp test program does not use LIBS_PARAMETER_TEST_COMPILE_FAILURE_2 or LIBS_PARAMETER_TEST_COMPILE_FAILURE_3.
2018-11-29 14:30:27 -05:00
CromwellEnage
655fb40414 Fix mpl::has_key_impl<parameter::aux::arg_list_tag> specialization
<boost/parameter/aux_/arg_list.hpp>
* Use parameter::value_type vice mpl::find.

"test/compose.cpp"
* Test that mpl::has_key evaluates to mpl::false_ for keyword tags that are not in parameter::aux::arg_list.

"test/singular.cpp"
* Test that mpl::has_key evaluates to mpl::false_ for keyword tags that are not in parameter::aux::tagged_argument or parameter::aux::tagged_argument_rref.
2018-11-29 14:20:36 -05:00
Cromwell D. Enage
a083d58c31 Merge with boostorg/parameter 2018-11-28 23:10:47 -05:00
Edward Diener
6a749bcfb1 Change to distinguish parameter_python_test further between 32 and 64 bit Windows builds. 2018-11-23 00:00:07 -05:00
Cromwell D. Enage
35cf0d50cd Merge with boostorg/parameter 2018-11-21 23:31:24 -05:00
Edward Diener
a65875a7c9 Merge pull request #36 from CromwellEnage/template_keyword_and_docs
Upgrade boost::parameter::template_keyword and move to public interface; improve documentation
2018-11-21 22:31:39 -05:00
CromwellEnage
4f776ec9cb Move boost::parameter::template_keyword to public interface
Also move BOOST_PARAMETER_TEMPLATE_KEYWORD macro definition to <boost/parameter/template_keyword.hpp>, but #include this new header file in <boost/parameter/name.hpp> for backward compatibility.
2018-11-21 11:51:12 -05:00
CromwellEnage
c65bbf50a3 Upgrade BOOST_PARAMETER_TEMPLATE_KEYWORD; improve documentation
<boost/parameter/aux_/template_keyword.hpp>
* Apply a modified version of David Abrahams' patch from <https://svn.boost.org/trac10/ticket/2793> which eliminates the need to wrap function types in boost::function or std::function instantiations.

"test/function_type_tpl_param.cpp"
* Demonstrate that keyword types generated by BOOST_PARAMETER_TEMPLATE_KEYWORD now store function types as-is without wrapping them in boost::function or std::function instantiations.

"doc/reference.rst"
"doc/html/reference.html"
* Add BOOST_PARAMETER_DISABLE_PERFECT_FORWARDING as a configuration macro.
* Mention by what libraries other macros which are not a part of Parameter itself are defined.
* Mention which non-Boost.Parameter macros can be altered to affect the Boost.Parameter configuration.
2018-11-21 05:48:14 -05:00
Cromwell D. Enage
c3c6cf76ca Merge with boostorg/parameter 2018-11-21 01:53:14 -05:00
Edward Diener
b565d53bf8 Do not run python test for clang-linux under Windows. 2018-11-20 20:46:13 -05:00
Edward Diener
f41a26af82 Merge pull request #35 from CromwellEnage/stop_the_ice_ing
Define BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY as 0 by default
2018-11-20 13:07:45 -05:00
CromwellEnage
53fa67da1c Define BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY as 0 by default
User library tests have been reporting numerous failures due to internal compiler errors that occur when perfect forwarding is unsupported.  Setting BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY to zero eliminates these failures.  By doing this in Boost.Parameter, we relieve user code of the burden of doing this in their end.  The trade-off is that our own tests need to define BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY explicitly in order to take advantage of the benefits of not having to wrap boost::ref() or std::ref() around non-const lvalues.  As this was always a C++03 workaround, the change should be worth the trade-off.

On an unrelated note, Travis Cl just deprecated "sudo: false".  See <https://blog.travis-ci.com/2018-10-04-combining-linux-infrastructures>.
2018-11-20 08:51:32 -05:00
Cromwell D. Enage
1b2840bfdb Merge with boostorg/parameter 2018-11-20 08:26:02 -05:00
Edward Diener
9179318680 Merge pull request #34 from CromwellEnage/fix_issues
Fix Issue #31, Issue #32, Issue #33
2018-11-20 08:15:17 -05:00
CromwellEnage
7f046f4782 Fix test/Jamfile.v2
s/<version>/<toolset-gcc:version>
2018-11-20 01:50:06 -05:00
CromwellEnage
aab40aafd0 Fix test/Jamfile.v2
Ensure unique test names across aliases.
2018-11-19 21:43:56 -05:00
CromwellEnage
9b8a995b56 Update test/Jamfile.v2
Mark python_test failures on mingw as expected.
2018-11-19 14:54:26 -05:00
CromwellEnage
0283ec60df Fix test suite
"test/Jamfile.v2"
* Rearrange aliases to enable turning off certain tests when they fail for specific compiler configurations
* Reinstate test-suite statement until an undeprecated version can be found.

".travis.yml"
"appveyor.yml"
* Remove specification of alias names
2018-11-19 08:44:56 -05:00
CromwellEnage
716ccb9d85 Rename aliases
Make clear that certain tests run only on certain compilers.
2018-11-17 13:04:24 -05:00
CromwellEnage
a93c420fc7 Fix Issue #31, Issue #32, Issue #33
* Change test/evaluate_category.cpp and test/preprocessor_eval_category.cpp so that the tests pass for msvc-8.0, msvc-9.0, msvc-10.0, and msvc-11.0.
* Change test/Jamfile.v2 so that the compose_fail test runs only for msvc-11.0.
* Ensure that file permissions for header and source files do not include execute.
2018-11-17 11:33:48 -05:00
Cromwell D. Enage
a4f295906f Merge with boostorg/parameter 2018-11-16 23:29:32 -05:00
Edward Diener
d5cd72d2fd Remove executable permissions. 2018-11-16 21:42:25 -05:00
Cromwell D. Enage
318a460d43 Merge with boostorg/parameter 2018-11-16 20:46:52 -05:00
Edward Diener
c8549fc46d Turn off python test for mingw(-64)/gcc 2018-11-16 14:32:16 -05:00
Cromwell D. Enage
302e80397a Merge with boostorg/parameter 2018-11-16 07:41:59 -05:00
Edward Diener
f831585e63 Updated for msvc and particular tests. 2018-11-16 07:19:21 -05:00
Edward Diener
a195406157 Merge pull request #30 from CromwellEnage/tagged_argument_rref
Add missing boost::parameter::aux::tagged_argument_rref::operator[] overloads
2018-11-16 05:10:01 -05:00
CromwellEnage
3c494b663f Add missing boost::parameter::aux::tagged_argument_rref::operator[] overloads
Ultimately needed by "libs/graph/test/isomorphism.hpp"
2018-11-16 02:58:27 -05:00
Edward Diener
3ecf27411b Fixed code when specifying as_lvalue. 2018-11-14 20:22:54 -05:00
Edward Diener
e51b85d85f Distinguish same named run time tests by target. 2018-11-14 12:48:09 -05:00
Cromwell D. Enage
b72c8748a2 Merge with boostorg/parameter 2018-11-12 08:08:49 -05:00
Edward Diener
3bd15375ec Merge pull request #29 from CromwellEnage/comment_fix
Fix multi-line comment
2018-11-12 07:46:24 -05:00
CromwellEnage
05e7eee563 Restrict comment to single line. 2018-11-11 21:51:29 -05:00
CromwellEnage
661e8a699e Fix multi-line comment 2018-11-11 09:27:44 -05:00
Cromwell D. Enage
e5f96c8766 Merge with boostorg/parameter 2018-11-10 15:23:37 -05:00
Edward Diener
22129376c1 Merge pull request #28 from CromwellEnage/nested_keyword
Add keyword generation macro BOOST_PARAMETER_NESTED_KEYWORD
2018-11-10 15:12:16 -05:00
CromwellEnage
7a5d5358b9 Update boost::parameter::aux::tagged_argument
Make inheritance public.
2018-11-10 07:34:20 -05:00
CromwellEnage
65af83cdbe Update compose.cpp
Add code to test BOOST_PARAMETER_NESTED_KEYWORD.
2018-11-10 07:23:29 -05:00
CromwellEnage
61d17aeb43 Add keyword generation macro BOOST_PARAMETER_NESTED_KEYWORD
Upon approval and merging of this commit, replace the definition of BOOST_PARAMETER_NESTED_KEYWORD in <boost/accumulators/accumulators_fwd.hpp> with #include <boost/parameter/nested_keyword.hpp>.
2018-11-09 17:26:37 -05:00
Cromwell D. Enage
87b73e0fc8 Merge with boostorg/parameter 2018-11-09 11:33:40 -05:00
Edward Diener
6d9d61dd3a Merge pull request #27 from CromwellEnage/arg_list_as_mpl_assoc_seq
Add metafunction boost::parameter::is_argument_pack
2018-11-09 10:09:57 -05:00
CromwellEnage
66b4af0125 Add metafunction boost::parameter::is_argument_pack
Also upgrade boost::parameter::aux::arg_list, boost::parameter::aux::tagged_argument, and boost::parameter::aux::tagged_argument_rref to model the MPL Associative Sequence concept.
2018-11-09 00:32:34 -05:00
Cromwell D. Enage
aaf76c5759 Merge with boostorg/parameter 2018-11-08 01:50:20 -05:00
Edward Diener
6a53e1ac6b Merge pull request #26 from CromwellEnage/perfect_forwarding_with_cxx03_support
Reinstate C++03 workarounds
2018-11-07 18:18:11 -05:00
CromwellEnage
8ad69bc3f3 Fix .travis.yml
Mark ICE failures as expected.
2018-11-07 12:08:22 -05:00
CromwellEnage
00ac706ad8 Reinstate C++03 workarounds
Resolve merge conflicts arising from merging PR#23 into boostorg:develop.
2018-11-07 10:30:26 -05:00
Cromwell D. Enage
899891d1a3 Merge with boostorg/parameter 2018-11-07 10:14:24 -05:00
Edward Diener
80e1289bf0 Merge pull request #23 from CromwellEnage/perfect_forwarding
Support perfect forwarding
2018-11-07 08:21:55 -05:00
CromwellEnage
9b7eef1fe3 Update boost/parameter/config.hpp
Remove dependency on Boost.Move macros.
2018-11-06 14:11:12 -05:00
CromwellEnage
dceef04330 Update boost/parameter/aux_/maybe.hpp
Remove unused #include statements.
2018-10-31 01:52:54 -04:00
CromwellEnage
5fb1ef2871 Fix boost/parameter/parameters.hpp
Change erroneous #include statement from <boost/fusion/container/vector/vector_fwd.hpp> to <boost/fusion/container/list/list_fwd.hpp>.
2018-10-31 00:41:49 -04:00
CromwellEnage
44b34e10f6 Remove c++03 support.
* Replace calls to boost::forward with calls to std::forward.

<boost/parameter/config.hpp>
* Relax perfect forwarding requirements so that msvc-12.0 passes muster.

<boost/parameter/parameters.hpp>
* Use boost::mpl::vector if neither boost::fusion::list nor boost::fusion::deque are true variadic MPL sequences.

.travis.yml
appveyor.yml
* Remove test configurations of compilers that fail perfect forwarding requirements.
* Consolidate for fewer jobs.
2018-10-30 08:42:18 -04:00
CromwellEnage
0112583599 Support perfect forwarding
1. The end of section 3.2.1 of the current home page tutorial notes "that because of the forwarding problem, parameter::parameters::operator() can't accept non-const rvalues."  Add code to eliminate this problem.  As a positive side effect, Boost.Parameter-enabled functions and constructors are no longer bound by BOOST_PARAMETER_MAX_ARITY on compilers that support perfect forwarding. User code can now check for this support by detecting the configuration macro BOOST_PARAMETER_HAS_PERFECT_FORWARDING, or manually turn off this support by defining the configuration macro BOOST_PARAMETER_DISABLE_PERFECT_FORWARDING.  See "test/evaluate_category.cpp" and "test/preprocessor_eval_category.cpp" for example usage.

2. Add parameter category qualifiers "consume" and "move_from"(current qualifiers are "in", "out", "in_out", and "forward") based on http://www.modernescpp.com/index.php/c-core-guidelines-how-to-pass-function-parameters.

3. Update documentation to reflect the above changes.
2018-10-29 10:10:01 -04:00
Cromwell D. Enage
77a9508a65 Merge with boostorg/parameter 2018-10-29 07:39:29 -04:00
Edward Diener
cace644c0e Merge pull request #22 from CromwellEnage/restructure_tests
Restructure tests
2018-10-29 05:02:57 -04:00
CromwellEnage
d526784e05 FIx misspelling. 2018-10-28 23:34:31 -04:00
CromwellEnage
5b554b5f44 Remove dependency on boost::container::string
Replace with std::string.
2018-10-28 22:49:55 -04:00
CromwellEnage
06a0cc79e5 Prettify code 2018-10-28 22:14:17 -04:00
CromwellEnage
278a728906 Restructure tests.
<boost/parameter/parameters.hpp>:
* Add preprocessor conditional statement to prevent generation of ill-formed function call operator overloads.

"test/maybe.cpp"
"test/singular.cpp"
"test/tutorial.cpp"
"test/sfinae.cpp"
"test/earwicker.cpp"
* Replace BOOST_PARAMETER_KEYWORD statements with BOOST_PARAMETER_NAME statements.

"test/optional_deduced_sfinae.cpp"
"test/normalized_argument_types.cpp"
"test/literate/*.cpp"
* Use Boost.Core.LightweightTest where int main() is available.
* Replace assert statements with BOOST_TEST_EQ statements.

"test/basics.hpp"
* Remove preprocessor statements regarding borland, gcc-2, and msvc workarounds.

"test/ntp.cpp"
"test/sfinae.cpp"
"test/earwicker.cpp"
"test/normalized_argument_types.cpp"
"test/basics.hpp"
* Add preprocessor conditional statement to #error out if BOOST_PARAMETER_MAX_ARITY is set to an insufficient value.

"test/basics.cpp"
"test/deduced.cpp"
"test/macros.cpp"
"test/preprocessor.cpp"
"test/preprocessor_deduced.cpp"
* Replace S and char const* expressions with boost::container::string expressions.
* Uncomment any code that fails to compile, but add preprocessor conditional statement so that test suites can incorporate compile-fail statements regarding the code in question.
* Ensure that int main() returns boost::process_errors().

"test/literate/deduced-template-parameters0.cpp":
"test/literate/exercising-the-code-so-far0.cpp":
* Enclose BOOST_MPL_ASSERT statements within MPL_TEST_CASE block.

"test/literate/defining-the-keywords1.cpp":
* Add graphs::tag::graph::qualifier type definition because perfect forwarding code will check for it.
* Replace deprecated keyword::get() invocation with keyword::instance invocation.

test/Jamfile.v2:
* Add modifier <define>BOOST_PARAMETER_MAX_ARITY=# to run, run-fail, compile, and compile-fail statements to conserve compiler memory usage on GitHub's side.
* Add modifier <preserve-target-tests>off to run and run-fail statements to conserve executable space on GitHub's side.
* Separate bpl-test statement into its own target, parameter_python_test, which fails on xcode8.3 as well as on mingw and msvc compilers with address-model=64.
* The next commit (which will implement perfect forwarding) will subsume test/literate/Jamfile.v2 into this file.  Strangely enough, attempting to do so now will result in compiler errors.

.travis.yml:
* Add g++-4.7, g++-4.8, g++-4.9, clang++-3.5, clang++-3.6, clang++-3.7, clang++-3.8, clang++-3.9, clang++-4.0, xcode7.3, and xcode8.3 compiler configurations.
* Split compiler configurations by available CXXSTD values.  (This will keep the job times within limits for the next commit.)
* Ensure that the xcode8.3 compiler configurations exclude parameter_python_test from the test suite.

appveyor.yml:
* Add compiler configurations that support address-model=64 to the test matrix.
* Ensure that the new configurations exclude parameter_python_test from the test suite.
2018-10-28 13:13:07 -04:00
Cromwell D. Enage
79e042b590 Merge with boostorg/parameter 2018-10-25 22:29:20 -04:00
Edward Diener
57e3674bdd Merge pull request #21 from CromwellEnage/qualified_name
Support additional parameter categories
2018-10-25 21:59:19 -04:00
CromwellEnage
7441b2e72b Support additional parameter categories
Add parameter category qualifier "forward" (current qualifiers are "in", "out", and "in_out") based on http://www.modernescpp.com/index.php/c-core-guidelines-how-to-pass-function-parameters.  Add new usage syntax BOOST_PARAMETER_NAME((object-name), namespace-name) qualifier(tag-name)) and BOOST_PARAMETER_NAME(qualifier(name)).  (Existing code that uses qualifiers directly and correctly with BOOST_PARAMETER_FUNCTION and other code generation macros should remain unaffected for now, so no breaking changes.)  The reason for the change in usage is to enable applying of parameter category constraints to Boost.Parameter-enabled functions and constructors invoked through argument composition.  (Otherwise, it is currently possible to use argument composition to bypass parameter category constraints applied in BOOST_PARAMETER_FUNCTION et. al.) See "test/compose.cpp" for example usage.
2018-10-25 19:17:41 -04:00
Cromwell D. Enage
105bde609d Merge with boostorg/parameter 2018-10-25 14:00:08 -04:00
Edward Diener
1f25e851bc Merge pull request #20 from CromwellEnage/function_call_operator
Support Boost.Parameter-enabled function call operators.
2018-10-25 10:47:02 -04:00
CromwellEnage
c54b59f8b7 Support Boost.Parameter-enabled function call operators.
* Add code generation macros BOOST_PARAMETER_FUNCTION_CALL_OPERATOR and BOOST_PARAMETER_CONST_FUNCTION_CALL_OPERATOR to <boost/parameter/preprocessor.hpp>.
* Also, add documentation for BOOST_PARAMETER_CONST_MEMBER_FUNCTION, BOOST_PARAMETER_BASIC_FUNCTION, BOOST_PARAMETER_BASIC_MEMBER_FUNCTION, and BOOST_PARAMETER_BASIC_CONST_MEMBER_FUNCTION.
2018-10-25 07:58:11 -04:00
Cromwell D. Enage
8dcdeb307c Merge with boostorg/parameter 2018-10-25 05:55:34 -04:00
Edward Diener
3eb4c31f6f Merge pull request #18 from CromwellEnage/more_modular
Restructure code
2018-10-24 21:53:21 -04:00
CromwellEnage
b0785c2931 Update documentation
Document that boost::parameter::required, boost::parameter::optional, and boost::parameter::deduced are defined in their own header files, which are in turn #included by <boost/parameter/parameters.hpp>.
2018-10-24 16:54:44 -04:00
CromwellEnage
0fdf92a4e3 Update keyword.hpp
Add #include statement for forward declaration.
2018-10-24 12:42:14 -04:00
CromwellEnage
5f5d777691 Restructure code
<boost/parameter/name.hpp>:
* Move support metafunction definitions and BOOST_PARAMETER_TAG_PLACEHOLDER_TYPE macro definition to <boost/parameter/aux_/name.hpp>.
* Move BOOST_PARAMETER_IS_BINARY macro definition to <boost/parameter/aux_/preprocessor/is_binary.hpp>.
* Use BOOST_PARAMETER_TAG_PLACEHOLDER_TYPE macro.
2018-10-24 12:32:27 -04:00
CromwellEnage
2169c5adb4 Restructure code
<boost/parameter/aux_/arg_list.hpp>:
Move forward declarations to their own header files.

<boost/parameter/aux_/tagged_argument.hpp>:
* Move boost::parameter::aux::tagged_argument_base, boost::parameter::aux::is_tagged_argument_aux, and boost::parameter::aux::is_tagged_argument to <boost/parameter/aux_/is_tagged_argument.hpp>
* Remove unnecessary forward declarations.

<boost/parameter/parameters.hpp>:
* Move support metafunction definitions to their own header files in directory boost/parameter/aux_/pack.
* Move support macro definitions to <boost/parameter/aux_/preprocessor/no_perfect_forwarding_begin.hpp> and their corresponding #undef statements to <boost/parameter/aux_/preprocessor/no_perfect_forwarding_end.hpp>.

<boost/parameter/aux_/overloads.hpp> works at the preprocessor level, so move to <boost/parameter/aux_/preprocessor/overloads.hpp>.

<boost/parameter/preprocessor.hpp>:
* Move voidstar type definition to <boost/parameter/aux_/void.hpp>.
* Move support metafunctions to their own header files in directory boost/parameter/aux_/pp_impl.
* Move support macros to header files in directory boost/parameter/aux_/preprocessor/impl.
2018-10-24 12:09:26 -04:00
Cromwell D. Enage
38ef081b68 Merge with boostorg/parameter 2018-10-23 15:21:48 -04:00
Edward Diener
3fdc70d227 Merge pull request #17 from CromwellEnage/compose_with_function_as_argument
Upgrade boost::parameter::aux::tagged_argument
2018-10-23 15:02:02 -04:00
CromwellEnage
8df8cb6417 Update test suite
test/compose.cpp:
Change workarounds from boost::function to std::function since msvc-11.0 reports having a C++11-compliant <functional> header.
Add LIBS_PARAMETER_TEST_RUN_FAILURE configuration macro to facilitate run-fail testing.

test/Jamfile.v2:
Replaced deprecated test-suite statement with alias statements.
Added run-fail test case under its own alias statement.

appveyor.yml:
Add mingw compiler configurations to the test matrix.
Update msvc-11.0 configuration to also execute the run-fail test.

travis.yml:
Ensure that only the standard tests are run, not the run-fail test.
2018-10-23 03:42:03 -04:00
Cromwell D. Enage
7b3f03cb67 Merge pull request #2 from boostorg/develop
Merge with boostorg/parameter
2018-10-19 13:26:03 -04:00
CromwellEnage
42c2996cda Revert "Move preprocessor conditional expressions from main() in test/compose.cpp to tagged_argument.hpp" 2018-10-19 13:05:55 -04:00
CromwellEnage
779fd40e4a Move preprocessor conditional expressions from main() in test/compose.cpp to tagged_argument.hpp
Test the behavior of MSVC-11.0.
2018-10-19 12:24:50 -04:00
CromwellEnage
03c1b24665 Update test/Jamfile.v2
Change compile statement to run statement for compose.cpp
2018-10-19 11:19:11 -04:00
Edward Diener
6fc8feb510 Merge pull request #16 from CromwellEnage/unwrap_cv_reference
Upgrade boost::parameter::aux::unwrap_cv_reference
2018-10-19 09:19:10 -04:00
CromwellEnage
deb0c3b8a3 Upgrade boost::parameter::aux::tagged_argument
Add support for passing functions as arguments to Boost.Parameter-enabled functions.
2018-10-19 02:17:42 -04:00
CromwellEnage
2364c383fa Upgrade boost::parameter::aux::unwrap_cv_reference
Add support for std::reference_wrapper<> and std::ref().
2018-10-19 01:32:57 -04:00
Cromwell D. Enage
ce8ce02ef8 Merge pull request #1 from boostorg/develop
Merge with boostorg/parameter
2018-10-18 01:24:45 -04:00
Edward Diener
ff835044e2 Merge pull request #15 from CromwellEnage/function_type_tpl_param
Upgrade BOOST_PARAMETER_TEMPLATE_KEYWORD
2018-10-17 18:44:32 -04:00
CromwellEnage
5e332ad592 Fix test/Jamfile.v2
Change run statement to compile statement.
2018-10-16 05:04:37 -04:00
CromwellEnage
fb88905a99 Upgrade BOOST_PARAMETER_TEMPLATE_KEYWORD
Keyword templates generated by BOOST_PARAMETER_TEMPLATE_KEYWORD can now accept function types.
2018-10-16 05:01:27 -04:00
Peter Dimov
5d3e39325e Fix link to Python bindings 2018-10-16 06:40:55 +03:00
Peter Dimov
058b1394f5 Use glob instead of path.glob, as it's relative to the Jamfile 2018-10-16 06:26:47 +03:00
Peter Dimov
de183a3b75 Update the parameter_python submodule, as we still keep the Python tests here 2018-10-15 00:29:51 +03:00
Peter Dimov
28a8f75d83 Remove parameter_python documentation 2018-10-15 00:27:41 +03:00
Peter Dimov
2e9b937082 Remove parameter_python headers 2018-10-15 00:26:55 +03:00
Peter Dimov
61d476d4b6 Add libstdc++-5-dev for clang, or <complex> doesn't compile in C++14 mode 2018-10-14 07:35:10 +03:00
Peter Dimov
02a59d2091 Add return boost::report_errors(); 2018-10-13 19:50:17 +03:00
Peter Dimov
007a24b76c Add more Travis configurations 2018-10-13 04:44:05 +03:00
eldiener
672ae1c0ce Removed --depth 1 2017-10-29 21:44:39 -04:00
Edward Diener
f7829bd91c Better appveyor file setup. 2017-10-09 12:08:35 -04:00
Edward Diener
3736a0581e Added Appveyor file and Travis CI file. 2017-10-09 08:20:05 -04:00
Edward Diener
6f747e9869 Removed git executable tag. 2017-09-14 07:57:05 -04:00
Edward Diener
b31fc2bb17 Removed executable under git 2017-09-14 06:43:45 -04:00
Edward Diener
247536c841 Merge remote-tracking branch 'remotes/origin/master' into develop 2017-04-24 12:35:13 -04:00
Edward Diener
fd4a18d490 Merge branch 'develop' 2017-01-04 11:24:52 -05:00
Edward Diener
a2da4c32f5 Merge pull request #9 from rick68/patch-1
improve aux::arg_list<>::operator[]()
2016-12-24 01:27:15 -05:00
Wei-Ming Yang
a3b5ce8a93 improve aux::arg_list<>::operator[]()
Add the assert to avoid ugly message when invoked `arg_list<>::operator[](lazy_default<>)` with `maybe<>`
2016-11-23 09:53:54 +08:00
Edward Diener
612563e0fe Include math.h first to avoid Python _hypot redefinition bug 2016-11-07 15:33:55 -05:00
Edward Diener
904e2f5020 Use unique_ptr instead of auto_ptr where appropriate 2016-11-07 15:32:11 -05:00
Rene Rivera
c303922fe9 Add, and update, documentation build targets. 2016-10-10 11:39:51 -05:00
Rene Rivera
9a8ad86fd7 Add, and update, documentation build targets. 2016-10-07 23:07:35 -05:00
Edward Diener
0461c0a070 Merge branch 'develop'
Conflicts:
	doc/html/index.html
	doc/html/python.html
	doc/html/reference.html
	doc/index.rst
2015-10-15 01:01:28 -04:00
Edward Diener
6ad2d6b207 Fixed ADL problem upon invocation 2015-07-19 13:03:39 -04:00
Sebastien Loriot
45eebd0b85 fix a unused variable warning 2015-07-19 10:09:24 -04:00
Stephen Kelly
d6132a7645 Remove remaining occurances of BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
These evaded scripting.

[SVN r86249]
2015-07-19 10:08:31 -04:00
Stephen Kelly
3462c3dc06 Simplify multi-component ifdefs containing BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
[SVN r86248]
2015-07-19 10:08:17 -04:00
Stephen Kelly
bc19656218 Parameter: Remove obsolete MSVC version checks.
[SVN r86119]
2015-07-19 10:07:55 -04:00
Stephen Kelly
09cc5cf219 Parameter: Remove obsolete GCC version checks.
[SVN r86067]
2015-07-19 10:07:24 -04:00
Vicente J. Botet Escriba
dd466e7d54 Parameter: fix minor warnings.
[SVN r83985]
2015-07-19 10:06:01 -04:00
Edward Diener
368205ab37 Merge pull request #8 from sloriot/patch-2
fix a unused variable warning
2015-07-16 07:40:24 -04:00
Sebastien Loriot
9821c1a5f9 fix a unused variable warning 2015-07-16 13:11:12 +02:00
Edward Diener
d3a422ba6e Merge pull request #6 from eldiener/develop
Remove unneeded and incorrect #line directives, which just confuse so…
2015-05-29 13:13:07 -04:00
Edward Diener
aaf00c5449 Remove unneeded and incorrect #line directives, which just confuse some compilers, most notably VC++ which fails some tests purely on its confusion. 2015-05-27 10:03:38 -04:00
Daniel James
a9a4287f4d Add metadata file. 2015-01-25 21:28:29 +02:00
Peter Dimov
e1f43668e7 Merge pull request #5 from danieljames/metadata
Create metadata file.
2015-01-25 20:32:38 +02:00
Daniel James
3b34198a6f Add metadata file. 2014-08-18 15:08:36 +01:00
Michel Morin
49ab4faa2b Merge r86524 (Correct broken links to C++ standard papers); fixes #9212
[SVN r86673]
2013-11-13 03:22:55 +00:00
Michel Morin
54854d4a3a Correct broken links to C++ standard papers. Refs #9212.
[SVN r86524]
2013-10-30 12:51:24 +00:00
Beman Dawes
45295c87bc Merge 86392 from trunk. The spirit change was not applied because the file is not present in branches/release.
[SVN r86489]
2013-10-27 21:10:04 +00:00
Beman Dawes
0dcd40da74 Add Boost.Build support for the Git modular layout, using links to to new header locations, thus preventing breakage to vast amounts of user code and build setups. Being added to SVN so that changes will automatically propagate to Git and modular Boost. Thanks to Steven Watanabe, Jürgen Hunold, Vladimir Prus, and Bjørn Roald for developing this patch. Steven in particular conceived the approach and did the initial implementation, which was further refined by the other contributors.
[SVN r86392]
2013-10-22 15:23:42 +00:00
Stephen Kelly
a510824ee4 Remove remaining occurances of BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
These evaded scripting.

[SVN r86249]
2013-10-11 23:22:36 +00:00
Stephen Kelly
7465ba08d3 Simplify multi-component ifdefs containing BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
[SVN r86248]
2013-10-11 23:20:59 +00:00
Stephen Kelly
8dca3b7307 Parameter: Remove obsolete MSVC version checks.
[SVN r86119]
2013-10-01 08:48:50 +00:00
Stephen Kelly
51a02e0822 Parameter: Remove obsolete GCC version checks.
[SVN r86067]
2013-09-30 15:58:35 +00:00
Vladimir Prus
a07961f561 Undo previous commit, it was meant for another branch
[SVN r85888]
2013-09-25 08:32:03 +00:00
Vladimir Prus
4e26b448e9 Initial modular patch, from Bjorn.
[SVN r85884]
2013-09-25 08:13:57 +00:00
Vicente J. Botet Escriba
b5e57e0024 Parameter: fix minor warnings.
[SVN r83985]
2013-04-20 14:12:43 +00:00
Lorenzo Caminiti
b74489d477 Merged Boost.Parameter fixes from trunk to support accessing named paramter types tag::x::_.
[SVN r78851]
2012-06-07 18:21:25 +00:00
Tim Blechmann
475001a591 parameter: merge fix from trunk (required for boost.heap)
[SVN r76090]
2011-12-21 11:20:00 +00:00
Tim Blechmann
f9e0d1c5c3 parameter: merge enable_if fix from trunk
[SVN r76069]
2011-12-19 18:00:17 +00:00
Tim Blechmann
23ed477c44 parameter: access enable_if via namespace boost
[SVN r75902]
2011-12-11 14:30:27 +00:00
Tim Blechmann
6427d82103 [parameter] increase BOOST_PARAMETER_MAX_ARITY to 8
applying patch from ticket #6177




[SVN r75811]
2011-12-05 09:55:21 +00:00
Daniel Wallin
436209fa82 Fix Boost.Parameter documentation bugs. Properly test type requirements example.
[SVN r75417]
2011-11-08 22:00:12 +00:00
Daniel Wallin
9d66bd7632 Allow placeholder expressions in the type requirements for BOOST_PARAMETER_FUNCTION et al:
(root_vertex
     , (vertex_descriptor<graphs::graph::_>)
     , *vertices(graph).first)


[SVN r75415]
2011-11-08 21:57:28 +00:00
Daniel James
0b0ce28a8a Parameter: Merge [62231] from release - missing includes.
[SVN r70523]
2011-03-24 21:12:54 +00:00
Marshall Clow
bdcbf442bf Merge fix to release branch, fixes #4983
[SVN r68366]
2011-01-22 15:42:09 +00:00
Marshall Clow
15d8701d77 Fix typo in parameter doc, refs #4983
[SVN r68291]
2011-01-19 15:32:54 +00:00
Andrey Semashev
c9cf0ab0f5 Merged changes from trunk.
[SVN r62272]
2010-05-27 17:58:58 +00:00
Andrey Semashev
ee32bc6f67 Fixed test compilation with C++0x aware compilers. The bind and ref calls should be explicitly qualified with the boost namespace.
[SVN r62241]
2010-05-26 16:30:14 +00:00
Douglas Gregor
20301b3da4 Add some missing includes for the parameter library
[SVN r62231]
2010-05-26 07:47:05 +00:00
Andrey Semashev
c2177b122c Decoupled arg_list and maybe. This removes a few dependencies on other headers and speeds up compilation.
[SVN r62202]
2010-05-25 15:53:47 +00:00
Andrey Semashev
59e172adb3 Added missing include.
[SVN r60776]
2010-03-22 20:18:30 +00:00
Troy D. Straszheim
359b3a5c3a Fix for #3490, parameter depends on python. Use toplevel
aligned_storage and copy in referent_storage metafunction 
from python's detail namespace.  Passes all tests on gcc 4.3.3.



[SVN r57057]
2009-10-22 03:55:24 +00:00
Troy D. Straszheim
522c1e33b0 rm cmake from trunk. I'm not entirely sure this is necessary to satisfy the inspect script, but I'm not taking any chances, and it is easy to put back
[SVN r56942]
2009-10-17 02:07:38 +00:00
Troy D. Straszheim
9f4334c1c1 rm cmake from the release branch before it goes out broken. Policy dictates that you never commit to release, you commit to trunk and merge to release.
[SVN r56941]
2009-10-17 01:10:45 +00:00
Daniel James
7ff5c4b996 Merge some missing link/libraries changes. Fixes #2279,#3454.
Merged revisions 52231,53476 via svnmerge from 
https://svn.boost.org/svn/boost/trunk

........
  r52231 | jewillco | 2009-04-07 17:46:32 +0100 (Tue, 07 Apr 2009) | 1 line
  
  Updating maintainer info for BGL, fixes #2279
........
  r53476 | jewillco | 2009-05-31 02:40:59 +0100 (Sun, 31 May 2009) | 1 line
  
  Fixed more links to property_map
........


[SVN r56226]
2009-09-15 21:16:58 +00:00
Troy D. Straszheim
298108e7ed Copyrights on CMakeLists.txt to keep them from clogging up the inspect
reports.  This is essentially the same commit as r55095 on the release
branch.



[SVN r55159]
2009-07-26 00:49:56 +00:00
Troy D. Straszheim
1b1499b94c Add basic copyright/license to keep cmake out of the inspection report
[SVN r55095]
2009-07-22 21:51:01 +00:00
Jeremiah Willcock
ae3bfbad46 Fixed more links to property_map
[SVN r53476]
2009-05-31 01:40:59 +00:00
Daniel Wallin
d8a61e4df7 Silence annoying GCC -Wshadow warnings.
Fixes #3034.


[SVN r53414]
2009-05-29 21:52:29 +00:00
Daniel Wallin
82b5cc0208 Silence "unused parameter" warning in BOOST_PARAMETER_FUNCTION().
Fixes #2808.


[SVN r53402]
2009-05-29 18:06:46 +00:00
Daniel Wallin
91623e6241 parameter-doc: Regenerated HTML from ReST source.
[SVN r50918]
2009-01-30 21:28:11 +00:00
Daniel Wallin
4af5c63d46 parameter-doc: Added missing default value on optional parameter
specification.


[SVN r50915]
2009-01-30 21:08:22 +00:00
David Deakins
1c2f56c672 Restored static-member-functions0 test
[SVN r50890]
2009-01-30 05:55:10 +00:00
Dave Abrahams
08b0a74035 Check in missing file (thanks for pointing that out, David Deakins!)
[SVN r50889]
2009-01-30 00:52:33 +00:00
David Deakins
4c8725641d Commented out missing test file
[SVN r50888]
2009-01-30 00:09:10 +00:00
Dave Abrahams
b91cd816c8 bug fix for value_type and numerous doc fixes, along with literate programming tests
[SVN r50863]
2009-01-28 23:33:37 +00:00
Troy D. Straszheim
3cf03f73ca merge of cmake build files from trunk per beman
[SVN r50756]
2009-01-24 18:57:20 +00:00
Michael A. Jackson
f9a2fba9ab Updating CMake files to latest trunk. Added dependency information for regression tests and a few new macros for internal use.
[SVN r49627]
2008-11-07 17:02:56 +00:00
Michael A. Jackson
55792af45f Continuing merge of CMake build system files into trunk with the encouragement of Doug Gregor
[SVN r49510]
2008-11-01 13:15:41 +00:00
Dave Abrahams
04cea6497d Merging all parameter changes from trunk. These all look like they
fix bugs, although the one that lets you use the argument pack to
compute a return type was never tested (still isn't).


[SVN r47446]
2008-07-15 16:02:00 +00:00
Dave Abrahams
e054a75533 Minor doc cleanups
[SVN r46954]
2008-07-01 15:59:23 +00:00
Daniel Wallin
834f245953 Fixed #1044. ArgumentPack is now available in the return type calculation
[SVN r45226]
2008-05-08 20:04:24 +00:00
Eric Niebler
ef9dfeb2d1 add missing #include
[SVN r44857]
2008-04-28 16:46:33 +00:00
Daniel James
e6eda9a776 Merged revisions 43206,43208-43213 via svnmerge from
https://svn.boost.org/svn/boost/trunk

........
  r43206 | danieljames | 2008-02-10 09:55:03 +0000 (Sun, 10 Feb 2008) | 1 line
  
  Fix some broken links.
........
  r43209 | danieljames | 2008-02-10 14:56:22 +0000 (Sun, 10 Feb 2008) | 1 line
  
  Link to people pages on the website, as they've been removed from the download.
........
  r43210 | danieljames | 2008-02-10 15:02:17 +0000 (Sun, 10 Feb 2008) | 1 line
  
  Point links to the pages that used to be in 'more' to the site.
........
  r43212 | danieljames | 2008-02-10 16:10:16 +0000 (Sun, 10 Feb 2008) | 1 line
  
  Fix links on the home page as well.
........
  r43213 | danieljames | 2008-02-10 16:21:22 +0000 (Sun, 10 Feb 2008) | 1 line
  
  Generated documentation which is no longer generated.
........


[SVN r43214]
2008-02-10 16:39:38 +00:00
Daniel James
98bcbbad78 Point links to the pages that used to be in 'more' to the site.
[SVN r43210]
2008-02-10 15:02:17 +00:00
Daniel Wallin
d9f0e42397 Applied part of patch from Jens Seidel in: http://svn.boost.org/trac/boost/ticket/1541.
Fixed missing includes.


[SVN r42415]
2008-01-02 17:20:44 +00:00
Markus Schöpflin
0a26a05500 Applied patch by Richard Webb from ticket #1541. This fixes the latest
parameter test failures.


[SVN r42413]
2008-01-02 11:41:33 +00:00
Beman Dawes
8a404e2d67 Full merge from trunk at revision 41356 of entire boost-root tree.
[SVN r41370]
2007-11-25 18:38:02 +00:00
Beman Dawes
31f9f620fe Full merge from trunk at revision 41356 of entire boost-root tree.
[SVN r41369]
2007-11-25 18:07:19 +00:00
Beman Dawes
2e725894c6 // Add or correct comment identifying Boost library this header is associated with.
[SVN r41173]
2007-11-17 20:13:16 +00:00
Nicola Musatti
a4b2742095 Updated to support C++Builder 2007 Update 3 (bcc32 5.9.2)
[SVN r39945]
2007-10-11 21:09:07 +00:00
Nicola Musatti
2af6d0439e Updated to support C++Builder 2007 Update 3 (bcc32 5.9.2)
[SVN r39944]
2007-10-11 21:07:17 +00:00
Beman Dawes
56ddeddfaf Starting point for releases
[SVN r39706]
2007-10-05 14:25:06 +00:00
Douglas Gregor
276d786ed9 We can no longer use is_base_and_derived with incomplete types, not that it worked well before
[SVN r39247]
2007-09-13 19:58:30 +00:00
Vladimir Prus
7689b5b9d0 Remove V1 Jamfiles
[SVN r38516]
2007-08-08 19:02:26 +00:00
nobody
fe43dad724 This commit was manufactured by cvs2svn to create tag
'Version_1_34_1'.

[SVN r38286]
2007-07-24 19:28:14 +00:00
Daniel Wallin
ce2d43c1b5 Merged HEAD to RC_1_34_0
[SVN r37582]
2007-05-03 14:39:42 +00:00
Daniel Wallin
a28883d9ad Fixed typo.
[SVN r37581]
2007-05-03 14:17:06 +00:00
Daniel Wallin
45bac7b579 Regenerated HTML.
[SVN r37580]
2007-05-03 14:12:57 +00:00
nobody
86d7201a99 This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r37579]
2007-05-03 14:11:06 +00:00
Daniel Wallin
e4e6ba52c4 Fixed vertical ellipsis rendering.
[SVN r37578]
2007-05-03 14:11:05 +00:00
Daniel Wallin
6bb4b0ef8b Added reference for more of the PP interface.
[SVN r37577]
2007-05-03 14:10:06 +00:00
Daniel Wallin
e0416b8343 Included "deduced" parameters in the reference.
[SVN r37576]
2007-05-03 11:55:18 +00:00
Daniel Wallin
f8a1b652bc Fixed examples and removed use of boost::lambda.
[SVN r37550]
2007-05-01 14:43:47 +00:00
Dave Abrahams
ccf40a29c1 Correct testing bugs:
either changing assert(...) or BOOST_ASSERT(...) to BOOST_TEST
    (in my code only)

    or adding "return boost::report_errors();" where it was clearly
    missing (and a pure bug, in anyone's code).

    or changing BOOST_TEST to BOOST_CHECK where the integer library
    was clearly using Boost.Test and not returning report_errors().


[SVN r37063]
2007-02-25 15:28:02 +00:00
Dave Abrahams
f7611b8a1f Correct testing bugs:
either changing assert(...) or BOOST_ASSERT(...) to BOOST_TEST
    (in my code only)

    or adding "return boost::report_errors();" where it was clearly
    missing (and a pure bug, in anyone's code).


[SVN r37057]
2007-02-24 22:40:59 +00:00
Dave Abrahams
28ed7b9704 fix table styles
[SVN r36573]
2007-01-03 17:12:34 +00:00
Dave Abrahams
493a8b28a5 replace "write something here"
[SVN r36569]
2007-01-03 16:45:10 +00:00
Dave Abrahams
6c3ee189d1 replace "write something here"
[SVN r36569]
2007-01-03 16:45:10 +00:00
Dave Abrahams
32ec272b6d Update with docutils patch for table styles
[SVN r36491]
2006-12-22 14:38:47 +00:00
Daniel Wallin
4c8c0cce93 Tried to address these comments by Dave:
The section on "special" keywords links to a part of the parameter lib
  tutorial that no longer exists. It also says "Therefore we need to tag the
  color keyword as a special keyword" but it never shows how to do such tagging!

  The whole thing about the forwarding function objects is unclear. You show
  one example, but you don't explain why it's needed and you don't explain the
  rules by which it was constructed, so it's not obvious how I would define my
  own.

Work in progress.


[SVN r36383]
2006-12-14 13:26:29 +00:00
Dave Abrahams
8fc7ba81cc Correct typo
[SVN r36006]
2006-11-11 22:25:16 +00:00
Rene Rivera
15048a1d82 Remove obsolete Boost.Build v1 files.
[SVN r35880]
2006-11-06 17:10:46 +00:00
Daniel Wallin
5b2b1a47f8 More work on tests.
[SVN r35563]
2006-10-11 22:39:42 +00:00
Daniel Wallin
f3764c539e Worked on tests.
[SVN r35540]
2006-10-10 22:57:46 +00:00
Daniel Wallin
3852ff760c merged HEAD to RC
[SVN r35452]
2006-10-02 23:37:18 +00:00
Daniel Wallin
b67fbdff8f Fixed some regressions and added expected failure markup.
[SVN r35451]
2006-10-02 23:35:39 +00:00
Daniel Wallin
916b4d2c2f merged HEAD to RC
[SVN r35405]
2006-09-29 00:31:28 +00:00
Daniel Wallin
0e263f5602 Fixed python test regression and PP test failure.
[SVN r35404]
2006-09-29 00:30:42 +00:00
Daniel Wallin
af9b04e7ad merged HEAD to RC
[SVN r35364]
2006-09-28 13:11:46 +00:00
Daniel Wallin
3c815b31fe Changed how normalized_argument_types works to better match user
expectation.


[SVN r35363]
2006-09-28 13:10:44 +00:00
Daniel Wallin
894dffe6ff merged HEAD to RC
[SVN r35360]
2006-09-28 10:22:54 +00:00
Daniel Wallin
dbbe37b8c1 Added namespace qualification to "index". Fixes ambiguity problems on
gcc.


[SVN r35359]
2006-09-28 10:22:12 +00:00
Daniel Wallin
ce712b8f30 Fixed typo.
[SVN r35358]
2006-09-28 10:17:40 +00:00
Daniel Wallin
c17ea8d26d merged HEAD to RC
[SVN r35357]
2006-09-27 20:59:14 +00:00
Daniel Wallin
913fa2eb44 Added test for lazy_defaults.
[SVN r35356]
2006-09-27 20:58:22 +00:00
Daniel Wallin
12c873d3e4 Made defaults always lazy in PP interface.
[SVN r35355]
2006-09-27 18:52:28 +00:00
Daniel Wallin
1844c27699 Merged HEAD to RC.
[SVN r35339]
2006-09-26 14:49:52 +00:00
Daniel Wallin
164c48c018 added expected failure markup
[SVN r35337]
2006-09-26 13:57:07 +00:00
Daniel Wallin
2ac8833532 Fixed regressions on borland.
[SVN r35334]
2006-09-26 09:51:38 +00:00
Markus Schöpflin
9694b76bf2 Merged python header inclusion fix from trunk.
[SVN r35320]
2006-09-25 10:49:42 +00:00
Markus Schöpflin
6556e278c6 Python header must be included first.
[SVN r35319]
2006-09-25 10:40:35 +00:00
Daniel Wallin
7c9ddf23e0 merged HEAD to RC
[SVN r35300]
2006-09-23 22:53:35 +00:00
Daniel Wallin
1a9e89cb8d Fixed typo
[SVN r35299]
2006-09-23 22:52:34 +00:00
Daniel Wallin
224d313a05 Merged HEAD to RC.
[SVN r35285]
2006-09-23 10:41:14 +00:00
Daniel Wallin
6d53a2b914 Fixed borland failures.
[SVN r35284]
2006-09-23 10:40:16 +00:00
Daniel Wallin
47c53efbaa merged HEAD to RC
[SVN r35260]
2006-09-21 17:33:28 +00:00
nobody
57ef2b6ee9 This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r35259]
2006-09-21 17:29:16 +00:00
Daniel Wallin
c7296b9a05 Added value_type metafunction and tag::x::_ convenience syntax.
[SVN r35258]
2006-09-21 17:29:15 +00:00
Dave Abrahams
6a5d61ce3c Fix inspection issues
[SVN r35239]
2006-09-21 02:40:19 +00:00
Dave Abrahams
297e85c0f1 fix license
[SVN r35232]
2006-09-20 17:34:41 +00:00
Dave Abrahams
e887f199e0 fix license
[SVN r35232]
2006-09-20 17:34:41 +00:00
Dave Abrahams
3a59d2cea3 merged from HEAD
[SVN r35231]
2006-09-20 17:30:10 +00:00
Dave Abrahams
e7bd42b07a Add missing license/copyright
[SVN r35230]
2006-09-20 17:28:37 +00:00
Daniel Wallin
58bb633dc0 Merged HEAD to RC.
[SVN r35228]
2006-09-20 15:05:46 +00:00
nobody
3397bafb4a This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r35227]
2006-09-20 15:03:36 +00:00
Daniel Wallin
b9248d774f Improved error diagnostics. Made depdendent predicates work on
most compilers. Made optional deduced parameters fail SFINAE
when an unmatched parameter is supplied.


[SVN r35226]
2006-09-20 15:03:35 +00:00
Daniel Wallin
cc256f0bb3 Merged HEAD to RC
[SVN r35215]
2006-09-19 18:23:18 +00:00
Daniel Wallin
763a09c5aa Removed old tests.
[SVN r35214]
2006-09-19 18:22:55 +00:00
Dave Abrahams
e3b060b3e5 merged from HEAD
[SVN r35207]
2006-09-19 15:34:02 +00:00
Dave Abrahams
07987bc97c SunPro workarounds (fixed)
[SVN r35206]
2006-09-19 15:33:48 +00:00
Dave Abrahams
b59c238a83 SunPro workarounds
[SVN r35205]
2006-09-19 15:31:32 +00:00
Daniel Wallin
0791667e33 Merged HEAD to RC
[SVN r35197]
2006-09-19 13:13:43 +00:00
Daniel Wallin
9dfa5a8d9e Fixed typo and added SFINAE test.
[SVN r35196]
2006-09-19 13:12:44 +00:00
Daniel Wallin
91ffd43483 Merged changes from HEAD to RC.
[SVN r35195]
2006-09-19 11:51:07 +00:00
Daniel Wallin
3d0bdf694c Don't emit errors when using SFINAE.
[SVN r35194]
2006-09-19 11:49:34 +00:00
nobody
fa751e022e This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r35193]
2006-09-19 11:47:55 +00:00
Daniel Wallin
b5c6e05ea0 Made arguments that isn't matched by any parameter-specs an error.
[SVN r35192]
2006-09-19 11:47:54 +00:00
Daniel Wallin
1f6c9a3034 Merged changes from HEAD to RC_1_34_0.
[SVN r35183]
2006-09-18 20:54:56 +00:00
Daniel Wallin
cc2a478afc Added missing include.
[SVN r35181]
2006-09-18 20:53:57 +00:00
nobody
6c209395aa This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r35179]
2006-09-18 20:47:47 +00:00
Daniel Wallin
1dab8a1008 Added missing file.
[SVN r35178]
2006-09-18 20:47:46 +00:00
Daniel Wallin
5231f04b27 Merged changes from head to RC_1_34_0.
[SVN r35177]
2006-09-18 20:42:44 +00:00
nobody
c7258e9c9e This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r35173]
2006-09-18 20:05:46 +00:00
Daniel Wallin
4facdaafc3 New tagging algo. Tests for deduced parameters and preprocessor interface
for deduced parameters.


[SVN r35172]
2006-09-18 20:05:45 +00:00
nobody
22a1f905e9 This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r35170]
2006-09-18 19:56:20 +00:00
Daniel Wallin
5190f65321 New algorithm for tagging arguments, and lots of changes to PP code.
[SVN r35168]
2006-09-18 19:55:09 +00:00
Dave Abrahams
0417a36693 merged from HEAD
[SVN r35163]
2006-09-18 18:11:49 +00:00
Dave Abrahams
d42b860b8d Sun workarounds
[SVN r35137]
2006-09-16 18:15:08 +00:00
Dave Abrahams
0335832574 Sun workarounds
[SVN r35136]
2006-09-16 18:04:50 +00:00
Dave Abrahams
c5168be5d7 Parameter library Workarounds for Borland and MSVC
Parameter library explicit markup for expected failures

value_init.hpp:
  Borland workarounds
  Use angle-includes consistently


[SVN r35085]
2006-09-13 03:15:16 +00:00
Dave Abrahams
b9f287ea52 Parameter library Workarounds for Borland and MSVC
Parameter library explicit markup for expected failures

value_init.hpp:
  Borland workarounds
  Use angle-includes consistently


[SVN r35084]
2006-09-13 03:00:18 +00:00
Dave Abrahams
c29a75c9df merged from trunk
[SVN r35083]
2006-09-13 00:40:00 +00:00
Dave Abrahams
28f98ecbf0 Use new working mpl::set functionality.
[SVN r35082]
2006-09-13 00:26:55 +00:00
Dave Abrahams
4e8c8ced0f Attempted SunPro workaround
[SVN r35081]
2006-09-13 00:17:50 +00:00
Dave Abrahams
e18d621508 Add missing license/copyright
[SVN r35070]
2006-09-11 22:27:29 +00:00
Dave Abrahams
5baef32925 add missing license/copyright info
[SVN r35068]
2006-09-11 22:08:18 +00:00
nobody
40399d3505 This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r35043]
2006-09-08 09:38:01 +00:00
Daniel Wallin
cc8ca29980 workarounds for vc6/vc7/borland
[SVN r35020]
2006-09-02 14:36:22 +00:00
Daniel Wallin
e2405e2d00 Added casting of arguments to BOOST_PARAMETER_FUNCTION().
[SVN r35019]
2006-09-02 13:37:23 +00:00
Daniel Wallin
1cba9bd634 updated docs
[SVN r35018]
2006-09-02 09:12:42 +00:00
Daniel Wallin
d6db8c6216 Merged name.hpp from HEAD.
[SVN r34945]
2006-08-24 21:13:51 +00:00
Daniel Wallin
e58e928af4 Added name.hpp.
[SVN r34944]
2006-08-24 21:12:51 +00:00
Daniel Wallin
38817a8bb5 fixed missing include
[SVN r34941]
2006-08-24 16:19:14 +00:00
Dave Abrahams
646c519dc0 merged from trunk
[SVN r34930]
2006-08-23 13:01:56 +00:00
Daniel Wallin
c3e842fc4c fixed first test
[SVN r34923]
2006-08-22 19:16:50 +00:00
Daniel Wallin
cb501f9f38 merged changes from HEAD
[SVN r34921]
2006-08-22 17:36:58 +00:00
Daniel Wallin
ab57984c04 Added missing include.
[SVN r34919]
2006-08-22 14:08:27 +00:00
Dave Abrahams
7eb7737095 merged from trunk
[SVN r34918]
2006-08-22 14:01:34 +00:00
Dave Abrahams
a8dc2bbd25 define some missing helpers for 1st example.
[SVN r34917]
2006-08-22 13:56:24 +00:00
Daniel Wallin
bb838edb2f Changes some things so that the documentation example works.
[SVN r34909]
2006-08-21 11:39:36 +00:00
Daniel Wallin
bfc5811fdc Merged HEAD to RC_1_34_0.
[SVN r34899]
2006-08-16 22:34:35 +00:00
Daniel Wallin
1f8f44b26c Merged changes from HEAD to RC_1_34_0.
[SVN r34898]
2006-08-16 22:30:07 +00:00
Dave Abrahams
74b777612e Should work with catch-all header.
[SVN r34892]
2006-08-15 20:40:50 +00:00
Dave Abrahams
ea4457878c cplusplus.py, tool.py: bring back litre_config.py file.
cplusplus.py: unicode unhandled example dump workaround
index.rst: first example checked in


[SVN r34891]
2006-08-15 20:37:51 +00:00
Dave Abrahams
1f3fb08086 most of structure complete
[SVN r34846]
2006-08-07 19:23:43 +00:00
Dave Abrahams
702ca6af6e member functions and ctors
[SVN r34839]
2006-08-07 14:13:07 +00:00
Dave Abrahams
225a38b68a clean up a few ReST-os
[SVN r34833]
2006-08-07 02:03:21 +00:00
Dave Abrahams
de756246e7 deduced template parameters
[SVN r34832]
2006-08-07 01:46:13 +00:00
Dave Abrahams
de67d5fe6d class template progress
[SVN r34831]
2006-08-06 22:08:25 +00:00
Daniel Wallin
40332972ca Added predicate test to preprocessor.cpp
[SVN r34830]
2006-08-06 21:41:30 +00:00
Dave Abrahams
47292301e7 deduced function parameters
[SVN r34826]
2006-08-06 16:52:09 +00:00
Dave Abrahams
7a5a21dacc deduced function parameters
[SVN r34825]
2006-08-06 16:32:50 +00:00
Dave Abrahams
04aaeef41d naming convention
[SVN r34821]
2006-08-06 02:04:34 +00:00
Dave Abrahams
5a0bad4224 More doc progress
[SVN r34813]
2006-08-04 01:15:42 +00:00
Dave Abrahams
07f167eed3 More doc progress
[SVN r34809]
2006-08-03 04:44:35 +00:00
Dave Abrahams
6729c38504 Borland workaround
[SVN r34808]
2006-08-02 19:07:09 +00:00
Dave Abrahams
cf5d2c46f5 Workarounds for Borland
[SVN r34805]
2006-08-02 16:16:36 +00:00
nobody
49e928273d This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r34788]
2006-07-30 21:33:23 +00:00
Dave Abrahams
b34aa49ceb progress on tutorial
[SVN r34787]
2006-07-30 21:33:22 +00:00
Gennaro Prota
00bbfbb20c boost guidelines (mainly from inspect tool: tabs, license reference text, etc.); more to do...
[SVN r34753]
2006-07-27 11:48:49 +00:00
Daniel Wallin
f5dbd06b32 Fix for Borland.
[SVN r34746]
2006-07-26 22:55:25 +00:00
Dave Abrahams
ca120a3f04 merged from trunk
[SVN r34696]
2006-07-24 14:38:01 +00:00
Dave Abrahams
9bcd7c2fec Borland workaround
[SVN r34695]
2006-07-24 14:37:20 +00:00
Daniel Wallin
7f2abce0d4 Fixed 0-arity init.
[SVN r34528]
2006-07-13 08:16:55 +00:00
Daniel Wallin
b7036ee04f First attempt at reference for new macros.
[SVN r34484]
2006-07-08 22:13:59 +00:00
Daniel Wallin
36d25230e6 Added CallPolicies tests.
[SVN r34476]
2006-07-07 17:40:01 +00:00
Daniel Wallin
d298a327b5 Added support for CallPolicies.
[SVN r34475]
2006-07-07 17:39:20 +00:00
Daniel Wallin
8162166037 updated pp syntax
[SVN r34309]
2006-06-15 11:07:30 +00:00
Dave Abrahams
e2b452c1f4 merged from trunk
[SVN r34290]
2006-06-12 20:00:14 +00:00
Dave Abrahams
dbcf8de808 Borland workaround
[SVN r34289]
2006-06-12 19:59:15 +00:00
Dave Abrahams
07893af4c5 Avoid reserved names
[SVN r34184]
2006-06-05 10:35:52 +00:00
Daniel Wallin
2070231553 litre tests
[SVN r34126]
2006-05-31 10:41:34 +00:00
Daniel Wallin
5b1971f1ef Added support for static member functions
[SVN r34124]
2006-05-31 09:44:57 +00:00
Daniel Wallin
988bb4b365 Added support for static member functions.
[SVN r34123]
2006-05-31 09:44:35 +00:00
Daniel Wallin
64bfddc3a7 new macro renames and bugfix for vc6
[SVN r34117]
2006-05-30 08:50:53 +00:00
Daniel Wallin
2a0397c1b2 new macros, macro renames and bugfix
[SVN r34116]
2006-05-30 08:50:33 +00:00
Daniel Wallin
decd9ac9fd new Parameter.Python syntax
[SVN r34094]
2006-05-26 10:53:10 +00:00
Daniel Wallin
a181afc699 new Parameter.Python syntax
[SVN r34093]
2006-05-26 10:52:56 +00:00
Daniel Wallin
a6db5788f6 fixed expansion problem with msvc
[SVN r34092]
2006-05-26 10:52:42 +00:00
Dave Abrahams
d37e7cd513 Checked in updated HTML
[SVN r34003]
2006-05-18 14:59:38 +00:00
Daniel Wallin
6dd64214c2 more editing
[SVN r33964]
2006-05-15 07:13:57 +00:00
Dave Abrahams
96d3e0fd07 More editorial comments.
[SVN r33959]
2006-05-07 19:29:46 +00:00
Daniel Wallin
ac398b0e50 *** empty log message ***
[SVN r33956]
2006-05-07 12:48:02 +00:00
Daniel Wallin
3f1f0657f6 tutorial section, not complete
[SVN r33955]
2006-05-07 12:28:33 +00:00
Daniel Wallin
abae0c8d21 html version of python.rst
[SVN r33954]
2006-05-07 10:59:07 +00:00
Daniel Wallin
892a599999 doc changes
[SVN r33953]
2006-05-07 10:58:37 +00:00
Daniel Wallin
acbf69fdb6 *** empty log message ***
[SVN r33950]
2006-05-06 22:35:42 +00:00
Daniel Wallin
566e886887 *** empty log message ***
[SVN r33949]
2006-05-06 22:03:19 +00:00
Daniel Wallin
ae05e30eac New PP syntax, initial checkin.
[SVN r33948]
2006-05-06 22:00:28 +00:00
Daniel Wallin
310998435c New macro syntax, initial checkin.
[SVN r33947]
2006-05-06 21:54:22 +00:00
Dave Abrahams
647265bfd3 Added editorial comments
[SVN r33946]
2006-05-06 17:13:05 +00:00
Daniel Wallin
76af708b1f fixed rst syntax error
[SVN r33926]
2006-05-04 19:57:20 +00:00
Daniel Wallin
deb606ef59 fixed rst syntax error
[SVN r33925]
2006-05-04 19:56:42 +00:00
Daniel Wallin
721b294842 *** empty log message ***
[SVN r33924]
2006-05-04 15:08:44 +00:00
Daniel Wallin
f40418cf9a *** empty log message ***
[SVN r33923]
2006-05-04 07:43:57 +00:00
Dave Abrahams
b12dbd9f6a Add missing void specialization
[SVN r33886]
2006-05-01 12:47:37 +00:00
Daniel Wallin
6087feef11 python binding docs
[SVN r33836]
2006-04-27 09:42:45 +00:00
Dave Abrahams
e7d652f208 Fix for vc-7
[SVN r33774]
2006-04-24 02:11:11 +00:00
Dave Abrahams
51c3dd4cb1 add missing include
[SVN r33773]
2006-04-24 02:05:02 +00:00
Dave Abrahams
8cf35658bd add missing include
[SVN r33772]
2006-04-24 01:54:41 +00:00
Dave Abrahams
ee2b252418 Portability fixes
[SVN r33752]
2006-04-20 15:18:09 +00:00
Dave Abrahams
45d320a434 Reorganized preprocessor stuff, made vc6 work.
[SVN r33703]
2006-04-15 01:39:17 +00:00
Rene Rivera
6695f76c5f [merge from head] Allow keywords to be copyable and default constructable, to facilitate use of keywords outside of Boost.Parameter.
[SVN r33691]
2006-04-13 20:12:20 +00:00
Rene Rivera
76067ad5d2 Remove now uneeded header dependency.
[SVN r33690]
2006-04-13 20:07:57 +00:00
Rene Rivera
15b0729181 Allow keywords to be copyable and default constructable, to facilitate use of keywords outside of Boost.Parameter.
[SVN r33689]
2006-04-13 20:01:51 +00:00
Daniel Wallin
23d30d9ea6 Doc update.
[SVN r33677]
2006-04-12 09:39:51 +00:00
Dave Abrahams
012e0abd22 partially updated docs
[SVN r33645]
2006-04-10 20:41:06 +00:00
Daniel Wallin
225ee5072e Boost.Parameter python binding docs, work in progress.
[SVN r33613]
2006-04-09 20:11:13 +00:00
Daniel Wallin
384add2571 Fixed problem with using joint_view<>.
[SVN r33485]
2006-03-27 13:21:58 +00:00
nobody
bf25a637c8 This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r33417]
2006-03-21 02:26:31 +00:00
Daniel Wallin
05c3161112 keyword::operator= now returns const rvalues.
[SVN r33351]
2006-03-15 18:16:03 +00:00
Daniel Wallin
0fb6393510 fixed v2 jamfile
[SVN r33299]
2006-03-10 07:19:55 +00:00
Daniel Wallin
3449cb1c73 Missing files added.
[SVN r33278]
2006-03-09 08:20:20 +00:00
Daniel Wallin
d73cee75cf Fixed missing include.
[SVN r33269]
2006-03-08 15:51:25 +00:00
Daniel Wallin
4350ac39f5 More tests.
[SVN r33268]
2006-03-08 15:13:53 +00:00
Daniel Wallin
6530322582 More tests.
[SVN r33267]
2006-03-08 12:32:52 +00:00
Rene Rivera
d1f8f1f736 Fix to allow piecewise parameter composition.
[SVN r33189]
2006-03-01 16:55:11 +00:00
Dave Abrahams
764106fe93 Stop using assert() in tests
[SVN r33181]
2006-02-28 22:56:33 +00:00
Dave Abrahams
4a0c231377 Some Borland workarounds
[SVN r32978]
2006-02-17 19:33:42 +00:00
Daniel Wallin
20b7423e60 Boost.Parameter python binding support.
[SVN r32925]
2006-02-14 14:45:24 +00:00
Vladimir Prus
296832a99f Update Jamfile.v2
[SVN r32761]
2006-02-09 09:50:56 +00:00
Daniel Wallin
47281b5e61 VC7 workarounds.
[SVN r32698]
2006-02-07 11:22:58 +00:00
Daniel Wallin
f6dcc4a550 Workarounds for VC7.
[SVN r32693]
2006-02-07 09:50:39 +00:00
Daniel Wallin
cb9530157e Fixed bad include.
[SVN r32690]
2006-02-07 07:18:12 +00:00
Daniel Wallin
d21dfd48d8 New Boost.Parameter macros, initial checkin.
[SVN r32678]
2006-02-06 22:06:02 +00:00
Dave Abrahams
066d950c17 fixed outdated doc
[SVN r32593]
2006-02-05 18:24:27 +00:00
Daniel Wallin
2ad4d6a45b Removed use of parameter::aux::void_.
[SVN r32537]
2006-02-04 09:28:19 +00:00
Daniel Wallin
5f001699f7 Fixed NTP's so reference types work.
[SVN r32530]
2006-02-03 18:33:47 +00:00
Daniel Wallin
a6b93eb0af Test that NTP's work with reference types.
[SVN r32529]
2006-02-03 18:32:50 +00:00
Daniel Wallin
9479ed3f91 Made the unnamed keyword tag derive from parameter::template_keyword<>.
[SVN r32528]
2006-02-03 18:03:42 +00:00
Daniel Wallin
8872100508 Changes to semantics of binding<>.
[SVN r32527]
2006-02-03 18:02:21 +00:00
Daniel Wallin
3b90b4ffa4 Named Template Parameter support in Boost.Parameter.
[SVN r32525]
2006-02-03 15:17:54 +00:00
Dave Abrahams
da78942b0b Even single-element ArgumentPacks that result from keyword assignments are now valid MPL Forward Sequences.
[SVN r32447]
2006-01-27 23:20:49 +00:00
Dave Abrahams
3e0cdfa6ad Merge in material from the parameter-python branch that should have been included here.
[SVN r32445]
2006-01-27 21:37:05 +00:00
Dave Abrahams
31f38561ac Merge in material from the parameter-python branch that should have been included here.
[SVN r32444]
2006-01-27 21:21:56 +00:00
Vladimir Prus
4d64b38dad Update Jamfile.v2
[SVN r32351]
2006-01-18 12:46:30 +00:00
Daniel Wallin
9e89160e91 Made singular ArgPack's work.
[SVN r31930]
2005-12-06 11:37:17 +00:00
Daniel Wallin
88e1488e52 Added test for singular ArgumentPack's.
[SVN r31929]
2005-12-06 11:35:15 +00:00
Daniel Wallin
e129d30002 Removed files that were added on wrong branch
[SVN r31844]
2005-11-30 23:18:31 +00:00
Daniel Wallin
12da98e683 Boost.Parameter->BPL initial checkin
[SVN r31843]
2005-11-30 23:18:30 +00:00
185 changed files with 49012 additions and 4959 deletions

380
.travis.yml Normal file
View File

@@ -0,0 +1,380 @@
# Copyright 2016 Edward Diener
# Copyright 2017 Cromwell D. Enage
# Copyright 2021 Andrey Semashev
# 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
python: "2.7"
branches:
only:
- master
- develop
- /feature\/.*/
env:
matrix:
- BOGUS_JOB=true
matrix:
exclude:
- env: BOGUS_JOB=true
include:
# gcc, Linux
- os: linux
dist: trusty
compiler: gcc-4.4
env: TOOLSET=gcc COMPILER=g++-4.4 CXXSTD=98,0x
addons:
apt:
packages:
- g++-4.4
sources:
- ubuntu-toolchain-r-test
- os: linux
dist: trusty
compiler: gcc-4.6
env: TOOLSET=gcc COMPILER=g++-4.6 CXXSTD=03,0x
addons:
apt:
packages:
- g++-4.6
sources:
- ubuntu-toolchain-r-test
- os: linux
dist: trusty
compiler: gcc-4.7
env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=03,11
addons:
apt:
packages:
- g++-4.7
sources:
- ubuntu-toolchain-r-test
- os: linux
dist: xenial
compiler: gcc-4.8
env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=03,11
addons:
apt:
packages:
- g++-4.8
sources:
- ubuntu-toolchain-r-test
- os: linux
dist: xenial
compiler: gcc-4.9
env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=03,11
addons:
apt:
packages:
- g++-4.9
sources:
- ubuntu-toolchain-r-test
- os: linux
dist: xenial
compiler: gcc-5
env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=03,11,14
addons:
apt:
packages:
- g++-5
sources:
- ubuntu-toolchain-r-test
- os: linux
dist: xenial
compiler: gcc-6
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- g++-6
sources:
- ubuntu-toolchain-r-test
- os: linux
dist: xenial
compiler: gcc-6
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=03,11,14,1z CXXSTD_DIALECT=cxxstd-dialect=gnu
addons:
apt:
packages:
- g++-6
sources:
- ubuntu-toolchain-r-test
- os: linux
dist: xenial
compiler: gcc-7
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=03,11,14,17
addons:
apt:
packages:
- g++-7
sources:
- ubuntu-toolchain-r-test
- os: linux
dist: xenial
compiler: gcc-7
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=03,11,14,17 CXXSTD_DIALECT=cxxstd-dialect=gnu
addons:
apt:
packages:
- g++-7
sources:
- ubuntu-toolchain-r-test
- os: linux
dist: xenial
compiler: gcc-8
env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=03,11,14,17,2a
addons:
apt:
packages:
- g++-8
sources:
- ubuntu-toolchain-r-test
- os: linux
dist: bionic
compiler: gcc-9
env: TOOLSET=gcc COMPILER=g++-9 CXXSTD=03,11,14,17,2a
addons:
apt:
packages:
- g++-9
sources:
- sourceline: "ppa:ubuntu-toolchain-r/test"
- os: linux
dist: focal
compiler: gcc-10
env: TOOLSET=gcc COMPILER=g++-10 CXXSTD=03,11,14,17,20
addons:
apt:
packages:
- g++-10
sources:
- sourceline: "ppa:ubuntu-toolchain-r/test"
# clang, Linux
- os: linux
dist: trusty
compiler: clang-3.5
env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=03,11
addons:
apt:
packages:
- clang-3.5
sources:
- ubuntu-toolchain-r-test
- sourceline: "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.5 main"
key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key"
- os: linux
dist: trusty
compiler: clang-3.6
env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=03,11
addons:
apt:
packages:
- clang-3.6
sources:
- ubuntu-toolchain-r-test
- sourceline: "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.6 main"
key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key"
- os: linux
dist: trusty
compiler: clang-3.7
env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=03,11
addons:
apt:
packages:
- clang-3.7
sources:
- ubuntu-toolchain-r-test
- sourceline: "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.7 main"
key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key"
- os: linux
dist: xenial
compiler: clang-3.8
env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- clang-3.8
sources:
- ubuntu-toolchain-r-test
- sourceline: "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-3.8 main"
key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key"
- os: linux
dist: xenial
compiler: clang-3.9
env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- clang-3.9
sources:
- ubuntu-toolchain-r-test
- sourceline: "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-3.9 main"
key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key"
- os: linux
dist: xenial
compiler: clang-4
env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- clang-4.0
sources:
- ubuntu-toolchain-r-test
- sourceline: "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-4.0 main"
key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key"
- os: linux
dist: xenial
compiler: clang-5
env: TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=03,11,14,1z
addons:
apt:
packages:
- clang-5.0
sources:
- ubuntu-toolchain-r-test
- sourceline: "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-5.0 main"
key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key"
- os: linux
dist: xenial
compiler: clang-6
env: TOOLSET=clang COMPILER=clang++-6.0 CXXSTD=03,11,14,1z,2a
addons:
apt:
packages:
- clang-6.0
- libc6-dbg
- libc++-dev
- libstdc++-8-dev
sources:
- ubuntu-toolchain-r-test
- sourceline: "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-6.0 main"
key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key"
- os: linux
dist: xenial
compiler: clang-7
env: TOOLSET=clang COMPILER=clang++-7 CXXSTD=14,1z,2a
addons:
apt:
packages:
- clang-7
- libc6-dbg
- libc++-dev
- libstdc++-8-dev
sources:
- ubuntu-toolchain-r-test
- sourceline: "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main"
key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key"
- os: linux
dist: xenial
compiler: clang-8
env: TOOLSET=clang COMPILER=clang++-8 CXXSTD=14,1z,2a
addons:
apt:
packages:
- clang-8
- libc6-dbg
- libc++-dev
- libstdc++-8-dev
sources:
- ubuntu-toolchain-r-test
- sourceline: "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main"
key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key"
- os: linux
dist: bionic
compiler: clang-9
env: TOOLSET=clang COMPILER=clang++-9 CXXSTD=14,17,2a
addons:
apt:
packages:
- clang-9
- libstdc++-9-dev
sources:
- sourceline: "ppa:ubuntu-toolchain-r/test"
- sourceline: "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main"
key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key"
- os: linux
dist: focal
compiler: clang-10
env: TOOLSET=clang COMPILER=clang++-10 CXXSTD=14,17,20
addons:
apt:
packages:
- clang-10
- libstdc++-9-dev
sources:
- sourceline: "ppa:ubuntu-toolchain-r/test"
- sourceline: "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-10 main"
key_url: "https://apt.llvm.org/llvm-snapshot.gpg.key"
- os: osx
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z
osx_image: xcode7.3
- os: osx
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z
osx_image: xcode8.3
- os: osx
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z
osx_image: xcode9.4.1
install:
- GIT_FETCH_JOBS=8
- BOOST_BRANCH=develop
- if [ "$TRAVIS_BRANCH" = "master" ]; then BOOST_BRANCH=master; fi
- cd ..
- git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
- cd boost-root
- git submodule init tools/build
- git submodule init tools/boostdep
- git submodule init tools/boost_install
- git submodule init libs/headers
- git submodule init libs/config
- git submodule init libs/parameter_python
- git submodule update --jobs $GIT_FETCH_JOBS
- cp -r $TRAVIS_BUILD_DIR/* libs/parameter
- python tools/boostdep/depinst/depinst.py --git_args "--jobs $GIT_FETCH_JOBS" parameter
- ./bootstrap.sh
- ./b2 headers
script:
- |-
echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam
- ./b2 --verbose-test libs/config/test//config_info toolset=$TOOLSET cxxstd=$CXXSTD || true
- BUILD_JOBS=`(nproc || sysctl -n hw.ncpu) 2> /dev/null`
- ./b2 -j $BUILD_JOBS libs/parameter/test toolset=$TOOLSET cxxstd=$CXXSTD $CXXSTD_DIALECT
notifications:
email:
on_success: always

36
CMakeLists.txt Normal file
View File

@@ -0,0 +1,36 @@
# Copyright 2019 Mike Dev
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
#
# NOTE: CMake support for Boost.Parameter is currently experimental at best
# and the interface is likely to change in the future
cmake_minimum_required( VERSION 3.5 )
project( BoostParameter LANGUAGES CXX)
option(BOOST_PARAMETER_INCLUDE_TESTS OFF "Include Boost.Parameter tests")
add_library( boost_parameter INTERFACE )
add_library( Boost::parameter ALIAS boost_parameter )
target_include_directories( boost_parameter INTERFACE include )
target_link_libraries( boost_parameter
INTERFACE
Boost::config
Boost::core
Boost::function
Boost::fusion
# TODO: we only need mp11 or mpl
Boost::mp11
Boost::mpl
Boost::optional
Boost::preprocessor
Boost::type_traits
Boost::utility
)
if(BOOST_PARAMETER_INCLUDE_TESTS)
enable_testing()
add_subdirectory(test)
endif()

26
README.md Normal file
View File

@@ -0,0 +1,26 @@
# Boost.Parameter
Boost.Parameter, part of collection of the [Boost C++ Libraries](https://github.com/boostorg), is a header-only library that implements named parameters for functions and templates in C++.
### Directories
* **doc** - Documentation sources
* **include** - Interface headers of Boost.Parameter
* **test** - Boost.Parameter unit tests
### More information
* [Documentation](https://www.boost.org/libs/parameter)
* [Report bugs](https://github.com/boostorg/parameter/issues/new). Be sure to mention Boost version, platform and compiler you're using. A small compilable code sample to reproduce the problem is always good as well.
* Submit your patches as [pull requests](https://github.com/boostorg/parameter/compare) against **develop** branch. Note that by submitting patches you agree to license your modifications under the [Boost Software License, Version 1.0](https://www.boost.org/LICENSE_1_0.txt).
### Build status
Branch | Travis CI | AppVeyor | Test Matrix | Dependencies |
:-------------: | --------- | -------- | ----------- | ------------ |
[`master`](https://github.com/boostorg/parameter/tree/master) | [![Travis CI](https://travis-ci.org/boostorg/parameter.svg?branch=master)](https://travis-ci.org/boostorg/parameter) | [![AppVeyor](https://ci.appveyor.com/api/projects/status/e9iptg55otiv040a/branch/master?svg=true)](https://ci.appveyor.com/project/Lastique/parameter/branch/master) | [![Tests](https://img.shields.io/badge/matrix-master-brightgreen.svg)](http://www.boost.org/development/tests/master/developer/parameter.html) | [![Dependencies](https://img.shields.io/badge/deps-master-brightgreen.svg)](https://pdimov.github.io/boostdep-report/master/parameter.html)
[`develop`](https://github.com/boostorg/parameter/tree/develop) | [![Travis CI](https://travis-ci.org/boostorg/parameter.svg?branch=develop)](https://travis-ci.org/boostorg/parameter) | [![AppVeyor](https://ci.appveyor.com/api/projects/status/e9iptg55otiv040a/branch/develop?svg=true)](https://ci.appveyor.com/project/Lastique/parameter/branch/develop) | [![Tests](https://img.shields.io/badge/matrix-develop-brightgreen.svg)](http://www.boost.org/development/tests/develop/developer/parameter.html) | [![Dependencies](https://img.shields.io/badge/deps-develop-brightgreen.svg)](https://pdimov.github.io/boostdep-report/develop/parameter.html)
### License
Distributed under the [Boost Software License, Version 1.0](https://www.boost.org/LICENSE_1_0.txt).

73
appveyor.yml Normal file
View File

@@ -0,0 +1,73 @@
# Copyright 2017 Edward Diener
# Copyright 2017 Cromwell D. Enage
# Copyright 2021 Andrey Semashev
# 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:
- ARGS: toolset=msvc-9.0,msvc-10.0,msvc-11.0,msvc-12.0 address-model=32
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- ARGS: toolset=msvc-14.0 address-model=32,64 cxxstd=14,latest
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- ARGS: toolset=msvc-14.1 address-model=32,64 cxxstd=14,17,latest
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- ARGS: toolset=msvc-14.2 address-model=32,64 cxxstd=14,17,latest
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- ARGS: toolset=gcc address-model=32 cxxstd=03,11,14,1z
PATH: C:\cygwin\bin;%PATH%
# Cygwin does not have python headers installed, the compiler picks up Win32 headers in C:\Python27\Include and fails
BOOST_PARAMETER_TEST_WITHOUT_PYTHON_TESTS: 1
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- ARGS: toolset=gcc address-model=64 cxxstd=03,11,14,1z
PATH: C:\cygwin64\bin;%PATH%
# Cygwin64 does not have python headers installed, the compiler picks up Win32 headers in C:\Python27\Include and fails
BOOST_PARAMETER_TEST_WITHOUT_PYTHON_TESTS: 1
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- ARGS: toolset=gcc address-model=32 cxxstd=03,11 linkflags=-Wl,-allow-multiple-definition
PATH: C:\MinGW\bin;%PATH%
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- ARGS: toolset=gcc address-model=32 cxxstd=03,11,14
PATH: C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin;%PATH%
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- ARGS: toolset=gcc address-model=64 cxxstd=03,11,14,1z
PATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH%
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- ARGS: toolset=gcc address-model=64 cxxstd=03,11,14,1z
PATH: C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64\bin;%PATH%
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
install:
- set GIT_FETCH_JOBS=8
- 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 init tools/build
- git submodule init tools/boostdep
- git submodule init tools/boost_install
- git submodule init libs/headers
- git submodule init libs/config
- git submodule init libs/parameter_python
- git submodule update --jobs %GIT_FETCH_JOBS%
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\parameter
- python tools/boostdep/depinst/depinst.py --git_args "--jobs %GIT_FETCH_JOBS%" parameter
- cmd /c bootstrap
- b2 headers
build: off
test_script:
- b2 -j %NUMBER_OF_PROCESSORS% libs/parameter/test %ARGS%

17
doc/Jamfile.v2 Executable file → Normal file
View File

@@ -1,9 +1,12 @@
# Copyright David Abrahams 2006. 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)
import docutils ;
import path ;
sources = [ path.glob . : *.rst ] ;
sources = [ glob *.rst ] ;
bases = $(sources:S=) ;
# This is a path relative to the html/ subdirectory where the
# generated output will eventually be moved.
stylesheet = "--stylesheet=rst.css" ;
@@ -13,9 +16,15 @@ for local b in $(bases)
html $(b) : $(b).rst :
#
<docutils-html>"-gdt --traceback --trim-footnote-reference-space --footnote-references=superscript "$(stylesheet)
<docutils-html>"-gdt --link-stylesheet --traceback --trim-footnote-reference-space --footnote-references=superscript "$(stylesheet)
;
}
alias htmls : $(bases) ;
stage html : $(bases) ;
###############################################################################
alias boostdoc ;
explicit boostdoc ;
alias boostrelease : html ;
explicit boostrelease ;

3375
doc/html/index.html Executable file → Normal file

File diff suppressed because it is too large Load Diff

7403
doc/html/reference.html Executable file → Normal file

File diff suppressed because it is too large Load Diff

13
doc/html/rst.css Executable file → Normal file
View File

@@ -1,3 +1,8 @@
/* Copyright David Abrahams 2006. 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)
*/
@import "../../../../rst.css";
div.section div.section div.section dl {
@@ -14,8 +19,12 @@ img {
}
span.vellipsis {
line-height: 30% ;
font-size: 200% ;
display: block;
width: 5px;
height: 22px;
background: url("vellipsis.gif");
margin-left: 3em;
text-indent: -1000px;
}

BIN
doc/html/vellipsis.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 B

3738
doc/index.rst Executable file → Normal file

File diff suppressed because it is too large Load Diff

7355
doc/reference.rst Executable file → Normal file

File diff suppressed because it is too large Load Diff

22
include/boost/parameter.hpp Executable file → Normal file
View File

@@ -1,16 +1,30 @@
// Copyright David Abrahams, Daniel Wallin 2005. Use, modification and
// distribution is subject to the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// Copyright David Abrahams, Daniel Wallin 2005.
// 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 www.boost.org/libs/parameter for documentation.
#ifndef BOOST_PARAMETER_050401_HPP
#define BOOST_PARAMETER_050401_HPP
#include <boost/parameter/parameters.hpp>
#include <boost/parameter/are_tagged_arguments.hpp>
#include <boost/parameter/is_argument_pack.hpp>
#include <boost/parameter/required.hpp>
#include <boost/parameter/optional.hpp>
#include <boost/parameter/deduced.hpp>
#include <boost/parameter/template_keyword.hpp>
#include <boost/parameter/keyword.hpp>
#include <boost/parameter/nested_keyword.hpp>
#include <boost/parameter/binding.hpp>
#include <boost/parameter/value_type.hpp>
#include <boost/parameter/macros.hpp>
#include <boost/parameter/match.hpp>
#include <boost/parameter/name.hpp>
#include <boost/parameter/compose.hpp>
#include <boost/parameter/preprocessor.hpp>
#include <boost/parameter/preprocessor_no_spec.hpp>
#endif // BOOST_PARAMETER_050401_HPP
#endif // include guard

View File

@@ -0,0 +1,125 @@
// Copyright Cromwell D. Enage 2018.
// 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)
#ifndef BOOST_PARAMETER_ARE_TAGGED_ARGUMENTS_HPP
#define BOOST_PARAMETER_ARE_TAGGED_ARGUMENTS_HPP
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
namespace boost { namespace parameter {
template <typename TaggedArg0, typename ...TaggedArgs>
struct are_tagged_arguments;
}} // namespace boost::parameter
#include <boost/parameter/aux_/is_tagged_argument.hpp>
namespace boost { namespace parameter {
template <typename TaggedArg0>
struct are_tagged_arguments<TaggedArg0>
: ::boost::parameter::aux::is_tagged_argument<TaggedArg0>
{
};
}} // namespace boost::parameter
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
namespace boost { namespace parameter {
template <typename TaggedArg0, typename ...TaggedArgs>
struct are_tagged_arguments
: ::boost::mpl::if_<
::boost::parameter::aux::is_tagged_argument<TaggedArg0>
, ::boost::parameter::are_tagged_arguments<TaggedArgs...>
, ::boost::mpl::false_
>::type
{
};
}} // namespace boost::parameter
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
#define BOOST_PARAMETER_ARE_TAGGED_ARGUMENTS_END_Z(z, n, false_t) , false_t>
/**/
#include <boost/parameter/aux_/is_tagged_argument.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/preprocessor/cat.hpp>
#define BOOST_PARAMETER_ARE_TAGGED_ARGUMENTS_BEGIN_Z(z, n, prefix) \
::boost::mpl::eval_if< \
::boost::parameter::aux::is_tagged_argument<BOOST_PP_CAT(prefix, n)>,
/**/
#include <boost/parameter/aux_/void.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/preprocessor/arithmetic/sub.hpp>
#include <boost/preprocessor/facilities/intercept.hpp>
#include <boost/preprocessor/repetition/repeat.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
#define BOOST_PARAMETER_ARE_TAGGED_ARGUMENTS_OVERLOADS_Z(z, n, prefix) \
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename prefix)> \
struct are_tagged_arguments< \
BOOST_PP_ENUM_PARAMS_Z(z, n, prefix) \
BOOST_PP_ENUM_TRAILING_PARAMS_Z( \
z \
, BOOST_PP_SUB(BOOST_PARAMETER_COMPOSE_MAX_ARITY, n) \
, ::boost::parameter::void_ BOOST_PP_INTERCEPT \
) \
> : BOOST_PP_CAT(BOOST_PP_REPEAT_, z)( \
n \
, BOOST_PARAMETER_ARE_TAGGED_ARGUMENTS_BEGIN_Z \
, prefix \
) \
::boost::mpl::true_ \
BOOST_PP_CAT(BOOST_PP_REPEAT_, z)( \
n \
, BOOST_PARAMETER_ARE_TAGGED_ARGUMENTS_END_Z \
, ::boost::mpl::false_ \
)::type \
{ \
};
/**/
#include <boost/preprocessor/arithmetic/inc.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
namespace boost { namespace parameter {
template <
BOOST_PP_ENUM_BINARY_PARAMS(
BOOST_PP_INC(BOOST_PARAMETER_COMPOSE_MAX_ARITY)
, typename TaggedArg
, = ::boost::parameter::void_ BOOST_PP_INTERCEPT
)
>
struct are_tagged_arguments;
}} // namespace boost::parameter
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
namespace boost { namespace parameter {
BOOST_PP_REPEAT_FROM_TO(
1
, BOOST_PP_INC(BOOST_PARAMETER_COMPOSE_MAX_ARITY)
, BOOST_PARAMETER_ARE_TAGGED_ARGUMENTS_OVERLOADS_Z
, TaggedArg
)
}} // namespace boost::parameter
#undef BOOST_PARAMETER_ARE_TAGGED_ARGUMENTS_OVERLOADS_Z
#undef BOOST_PARAMETER_ARE_TAGGED_ARGUMENTS_BEGIN_Z
#undef BOOST_PARAMETER_ARE_TAGGED_ARGUMENTS_END_Z
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
#endif // include guard

View File

@@ -0,0 +1,42 @@
// Copyright Cromwell D. Enage 2019.
// 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)
#ifndef BOOST_PARAMETER_AUX_ALWAYS_TRUE_PREDICATE_HPP
#define BOOST_PARAMETER_AUX_ALWAYS_TRUE_PREDICATE_HPP
#include <boost/parameter/config.hpp>
#include <boost/mpl/bool.hpp>
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/integral.hpp>
#endif
#else
#include <boost/mpl/always.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
struct always_true_predicate
{
template <typename ...>
struct apply
{
typedef ::boost::mpl::true_ type;
};
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
template <typename ...>
using fn = ::boost::mp11::mp_true;
#endif
};
#else
typedef ::boost::mpl::always< ::boost::mpl::true_> always_true_predicate;
#endif // BOOST_NO_CXX11_VARIADIC_TEMPLATES
}}} // namespace boost::parameter::aux
#endif // include guard

1641
include/boost/parameter/aux_/arg_list.hpp Executable file → Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,25 @@
// Copyright Daniel Wallin 2006.
// 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)
#ifndef BOOST_PARAMETER_AUX_AS_LVALUE_HPP
#define BOOST_PARAMETER_AUX_AS_LVALUE_HPP
namespace boost { namespace parameter { namespace aux {
template <typename T>
T const& as_lvalue(T const& value)
{
return value;
}
template <typename T>
T& as_lvalue(T& value)
{
return value;
}
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,198 @@
// Copyright Cromwell D. Enage 2018.
// 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)
#ifndef BOOST_PARAMETER_AUGMENT_PREDICATE_HPP
#define BOOST_PARAMETER_AUGMENT_PREDICATE_HPP
#include <boost/parameter/keyword_fwd.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/type_traits/is_lvalue_reference.hpp>
#include <boost/type_traits/is_scalar.hpp>
#include <boost/type_traits/is_same.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename V, typename R, typename Tag>
struct augment_predicate_check_consume_ref
: ::boost::mpl::eval_if<
::boost::is_scalar<V>
, ::boost::mpl::true_
, ::boost::mpl::eval_if<
::boost::is_same<
typename Tag::qualifier
, ::boost::parameter::consume_reference
>
, ::boost::mpl::if_<
::boost::is_lvalue_reference<R>
, ::boost::mpl::false_
, ::boost::mpl::true_
>
, boost::mpl::true_
>
>::type
{
};
}}} // namespace boost::parameter::aux
#include <boost/type_traits/is_const.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename V, typename R, typename Tag>
struct augment_predicate_check_out_ref
: ::boost::mpl::eval_if<
::boost::is_same<
typename Tag::qualifier
, ::boost::parameter::out_reference
>
, ::boost::mpl::eval_if<
::boost::is_lvalue_reference<R>
, ::boost::mpl::if_<
::boost::is_const<V>
, ::boost::mpl::false_
, ::boost::mpl::true_
>
, ::boost::mpl::false_
>
, ::boost::mpl::true_
>::type
{
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/lambda_tag.hpp>
#include <boost/mpl/apply_wrap.hpp>
#include <boost/mpl/lambda.hpp>
namespace boost { namespace parameter { namespace aux {
template <
typename Predicate
, typename R
, typename Tag
, typename T
, typename Args
>
class augment_predicate
{
typedef typename ::boost::mpl::lambda<
Predicate
, ::boost::parameter::aux::lambda_tag
>::type _actual_predicate;
public:
typedef typename ::boost::mpl::eval_if<
typename ::boost::mpl::if_<
::boost::parameter::aux
::augment_predicate_check_consume_ref<T,R,Tag>
, ::boost::parameter::aux
::augment_predicate_check_out_ref<T,R,Tag>
, ::boost::mpl::false_
>::type
, ::boost::mpl::apply_wrap2<_actual_predicate,T,Args>
, ::boost::mpl::false_
>::type type;
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/integral.hpp>
#include <boost/mp11/utility.hpp>
#include <type_traits>
namespace boost { namespace parameter { namespace aux {
template <typename V, typename R, typename Tag>
using augment_predicate_check_consume_ref_mp11 = ::boost::mp11::mp_if<
::std::is_scalar<V>
, ::boost::mp11::mp_true
, ::boost::mp11::mp_if<
::std::is_same<
typename Tag::qualifier
, ::boost::parameter::consume_reference
>
, ::boost::mp11::mp_if<
::std::is_lvalue_reference<R>
, ::boost::mp11::mp_false
, ::boost::mp11::mp_true
>
, boost::mp11::mp_true
>
>;
template <typename V, typename R, typename Tag>
using augment_predicate_check_out_ref_mp11 = ::boost::mp11::mp_if<
::std::is_same<
typename Tag::qualifier
, ::boost::parameter::out_reference
>
, ::boost::mp11::mp_if<
::std::is_lvalue_reference<R>
, ::boost::mp11::mp_if<
::std::is_const<V>
, ::boost::mp11::mp_false
, ::boost::mp11::mp_true
>
, ::boost::mp11::mp_false
>
, ::boost::mp11::mp_true
>;
}}} // namespace boost::parameter::aux
#include <boost/mp11/list.hpp>
namespace boost { namespace parameter { namespace aux {
template <
typename Predicate
, typename R
, typename Tag
, typename T
, typename Args
>
struct augment_predicate_mp11_impl
{
using type = ::boost::mp11::mp_if<
::boost::mp11::mp_if<
::boost::parameter::aux
::augment_predicate_check_consume_ref_mp11<T,R,Tag>
, ::boost::parameter::aux
::augment_predicate_check_out_ref_mp11<T,R,Tag>
, ::boost::mp11::mp_false
>
, ::boost::mp11
::mp_apply_q<Predicate,::boost::mp11::mp_list<T,Args> >
, ::boost::mp11::mp_false
>;
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/has_nested_template_fn.hpp>
namespace boost { namespace parameter { namespace aux {
template <
typename Predicate
, typename R
, typename Tag
, typename T
, typename Args
>
using augment_predicate_mp11 = ::boost::mp11::mp_if<
::boost::parameter::aux::has_nested_template_fn<Predicate>
, ::boost::parameter::aux
::augment_predicate_mp11_impl<Predicate,R,Tag,T,Args>
, ::boost::parameter::aux
::augment_predicate<Predicate,R,Tag,T,Args>
>;
}}} // namespace boost::parameter::aux
#endif // BOOST_PARAMETER_CAN_USE_MP11
#endif // include guard

View File

@@ -0,0 +1,12 @@
// Copyright Daniel Wallin 2006.
// 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)
#ifndef BOOST_PARAMETER_CAST_060902_HPP
#define BOOST_PARAMETER_CAST_060902_HPP
#include <boost/parameter/aux_/preprocessor/impl/function_cast.hpp>
#endif // include guard

160
include/boost/parameter/aux_/default.hpp Executable file → Normal file
View File

@@ -1,67 +1,111 @@
// Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
// distribution is subject to the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// Copyright Daniel Wallin, David Abrahams 2005.
// Copyright Cromwell D. Enage 2017.
// 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)
#ifndef DEFAULT_050329_HPP
#define DEFAULT_050329_HPP
#ifndef BOOST_PARAMETER_AUX_DEFAULT_HPP
#define BOOST_PARAMETER_AUX_DEFAULT_HPP
namespace boost { namespace parameter { namespace aux {
// A wrapper for the default value passed by the user when resolving
// the value of the parameter with the given Keyword
template <class Keyword, class Value>
struct default_
{
default_(Value& x)
: value(x)
{}
Value& value;
};
//
// lazy_default --
//
// A wrapper for the default value computation function passed by
// the user when resolving the value of the parameter with the
// given keyword
//
#if BOOST_WORKAROUND(__EDG_VERSION__, <= 300)
// These compilers need a little extra help with overload
// resolution; we have empty_arg_list's operator[] accept a base
// class to make that overload less preferable.
template <class KW, class DefaultComputer>
struct lazy_default_base
{
lazy_default_base(DefaultComputer const& x)
: compute_default(x)
{}
DefaultComputer const& compute_default;
};
template <class KW, class DefaultComputer>
struct lazy_default
: lazy_default_base<KW,DefaultComputer>
{
lazy_default(DefaultComputer const & x)
: lazy_default_base<KW,DefaultComputer>(x)
{}
};
# define BOOST_PARAMETER_lazy_default_fallback lazy_default_base
#else
template <class KW, class DefaultComputer>
struct lazy_default
{
lazy_default(const DefaultComputer& x)
: compute_default(x)
{}
DefaultComputer const& compute_default;
};
# define BOOST_PARAMETER_lazy_default_fallback lazy_default
#endif
// A wrapper for the default value passed by the user when resolving
// the value of the parameter with the given Keyword
template <typename Keyword, typename Value>
struct default_
{
inline BOOST_CONSTEXPR default_(Value& x) : value(x)
{
}
Value& value;
};
}}} // namespace boost::parameter::aux
#endif // DEFAULT_050329_HPP
#include <boost/parameter/config.hpp>
namespace boost { namespace parameter { namespace aux {
// lazy_default -- A wrapper for the default value computation function
// passed by the user when resolving the value of the parameter with the
// given keyword.
#if BOOST_WORKAROUND(__EDG_VERSION__, <= 300)
// These compilers need a little extra help with overload resolution;
// we have empty_arg_list's operator[] accept a base class
// to make that overload less preferable.
template <typename KW, typename DefaultComputer>
struct lazy_default_base
{
inline BOOST_CONSTEXPR lazy_default_base(DefaultComputer& x)
: compute_default(x)
{
}
DefaultComputer& compute_default;
};
template <typename KW, typename DefaultComputer>
struct lazy_default
: ::boost::parameter::aux::lazy_default_base<KW,DefaultComputer>
{
inline BOOST_CONSTEXPR lazy_default(DefaultComputer& x)
: ::boost::parameter::aux::lazy_default_base<KW,DefaultComputer>(x)
{
}
};
#else // !BOOST_WORKAROUND(__EDG_VERSION__, <= 300)
template <typename KW, typename DefaultComputer>
struct lazy_default
{
inline BOOST_CONSTEXPR lazy_default(DefaultComputer& x)
: compute_default(x)
{
}
DefaultComputer& compute_default;
};
#endif // EDG workarounds needed.
}}} // namespace boost::parameter::aux
#if BOOST_WORKAROUND(__EDG_VERSION__, <= 300)
#define BOOST_PARAMETER_lazy_default_fallback \
::boost::parameter::aux::lazy_default_base
/**/
#else
#define BOOST_PARAMETER_lazy_default_fallback \
::boost::parameter::aux::lazy_default
/**/
#endif
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
#include <utility>
namespace boost { namespace parameter { namespace aux {
template <typename Keyword, typename Value>
struct default_r_
{
inline BOOST_CONSTEXPR default_r_(Value&& x)
: value(::std::forward<Value>(x))
{
}
#if BOOST_WORKAROUND(BOOST_MSVC, < 1910)
// MSVC 2015 miscompiles moves for classes containing rvalue ref members
// using the default generated move constructor
// when moving into a function
// https://github.com/boostorg/parameter/pull/109
inline BOOST_CONSTEXPR default_r_(default_r_&& x)
: value(::std::forward<Value>(x.value))
{
}
#endif
Value&& value;
};
}}} // namespace boost::parameter::aux
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
#endif // include guard

View File

@@ -0,0 +1,111 @@
// Copyright Cromwell D. Enage 2019.
// 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)
#ifndef BOOST_PARAMETER_AUX_HAS_NESTED_TEMPLATE_FN_HPP
#define BOOST_PARAMETER_AUX_HAS_NESTED_TEMPLATE_FN_HPP
#include <boost/parameter/aux_/yesno.hpp>
#include <boost/parameter/aux_/preprocessor/nullptr.hpp>
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/integral.hpp>
#include <boost/mp11/utility.hpp>
#else
#include <boost/mpl/bool.hpp>
#include <boost/mpl/identity.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
template <template <typename ...> class F>
struct has_nested_template_fn_variadic
{
};
#else
template <template <typename P0, typename P1> class F>
struct has_nested_template_fn_arity_2
{
};
#endif
template <typename T>
class has_nested_template_fn_impl
{
template <typename U>
static ::boost::parameter::aux::no_tag _check(...);
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
template <typename U>
static ::boost::parameter::aux::yes_tag
_check(
::boost::mp11::mp_identity<U> const volatile*
, ::boost::parameter::aux::has_nested_template_fn_variadic<
U::template fn
>* = BOOST_PARAMETER_AUX_PP_NULLPTR
);
#else
template <typename U>
static BOOST_CONSTEXPR ::boost::parameter::aux::yes_tag
_check(
::boost::mpl::identity<U> const volatile*
, ::boost::parameter::aux::has_nested_template_fn_arity_2<
U::template fn
>* = BOOST_PARAMETER_AUX_PP_NULLPTR
);
#endif
public:
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using type = ::boost::mp11::mp_bool<
#else
typedef ::boost::mpl::bool_<
#endif
sizeof(
::boost::parameter::aux::has_nested_template_fn_impl<T>
::template _check<T>(
static_cast<
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
::boost::mp11::mp_identity<T> const volatile*
#else
::boost::mpl::identity<T> const volatile*
#endif
>(BOOST_PARAMETER_AUX_PP_NULLPTR)
)
) == sizeof(::boost::parameter::aux::yes_tag)
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
>;
#else
> type;
#endif
};
}}} // namespace boost::parameter::aux
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <type_traits>
#else
#include <boost/type_traits/remove_const.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
template <typename T>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using has_nested_template_fn = typename ::boost::parameter::aux
::has_nested_template_fn_impl<typename ::std::remove_const<T>::type>
::type;
#else
struct has_nested_template_fn
: ::boost::parameter::aux::has_nested_template_fn_impl<
typename ::boost::remove_const<T>::type
>::type
{
};
#endif
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,52 @@
// Copyright Daniel Wallin, David Abrahams 2010.
// 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)
#ifndef BOOST_PARAMETER_IS_MAYBE_050329_HPP
#define BOOST_PARAMETER_IS_MAYBE_050329_HPP
namespace boost { namespace parameter { namespace aux {
struct maybe_base
{
};
}}} // namespace boost::parameter::aux
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <type_traits>
namespace boost { namespace parameter { namespace aux {
template <typename T>
using is_maybe = ::std::is_base_of<
::boost::parameter::aux::maybe_base
, typename ::std::remove_const<T>::type
>;
}}} // namespace boost::parameter::aux
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#include <boost/type_traits/is_base_of.hpp>
#include <boost/type_traits/remove_const.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename T>
struct is_maybe
: ::boost::mpl::if_<
::boost::is_base_of<
::boost::parameter::aux::maybe_base
, typename ::boost::remove_const<T>::type
>
, ::boost::mpl::true_
, ::boost::mpl::false_
>::type
{
};
}}} // namespace boost::parameter::aux
#endif // BOOST_PARAMETER_CAN_USE_MP11
#endif // include guard

View File

@@ -0,0 +1,64 @@
// Copyright Cromwell D. Enage 2019.
// 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)
#ifndef BOOST_PARAMETER_AUX_IS_PLACEHOLDER_HPP
#define BOOST_PARAMETER_AUX_IS_PLACEHOLDER_HPP
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/integral.hpp>
#else
#include <boost/mpl/bool.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
template <typename T>
struct is_mpl_placeholder
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
: ::boost::mp11::mp_false
#else
: ::boost::mpl::false_
#endif
{
};
}}} // namespace boost::parameter::aux
#include <boost/mpl/arg_fwd.hpp>
namespace boost { namespace parameter { namespace aux {
template <int I>
struct is_mpl_placeholder< ::boost::mpl::arg<I> >
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
: ::boost::mp11::mp_true
#else
: ::boost::mpl::true_
#endif
{
};
}}} // namespace boost::parameter::aux
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/bind.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename T>
struct is_mp11_placeholder : ::boost::mp11::mp_false
{
};
template < ::std::size_t I>
struct is_mp11_placeholder< ::boost::mp11::mp_arg<I> >
: ::boost::mp11::mp_true
{
};
}}} // namespace boost::parameter::aux
#endif // BOOST_PARAMETER_CAN_USE_MP11
#endif // include guard

View File

@@ -0,0 +1,95 @@
// Copyright Daniel Wallin, David Abrahams 2005.
// Copyright Cromwell D. Enage 2017.
// 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)
#ifndef BOOST_PARAMETER_IS_TAGGED_ARGUMENT_HPP
#define BOOST_PARAMETER_IS_TAGGED_ARGUMENT_HPP
namespace boost { namespace parameter { namespace aux {
struct tagged_argument_base
{
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/config.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING) || \
(0 < BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY)
#include <boost/type_traits/is_base_of.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/type_traits/remove_reference.hpp>
namespace boost { namespace parameter { namespace aux {
// This metafunction identifies tagged_argument specializations
// and their derived classes.
template <typename T>
struct is_tagged_argument
: ::boost::mpl::if_<
// Cannot use is_convertible<> to check if T is derived from
// tagged_argument_base. -- Cromwell D. Enage
::boost::is_base_of<
::boost::parameter::aux::tagged_argument_base
, typename ::boost::remove_const<
typename ::boost::remove_reference<T>::type
>::type
>
, ::boost::mpl::true_
, ::boost::mpl::false_
>::type
{
};
}}} // namespace boost::parameter::aux
#else // no perfect forwarding support and no exponential overloads
#include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/is_lvalue_reference.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename T>
struct is_tagged_argument_aux
: ::boost::is_convertible<
T*
, ::boost::parameter::aux::tagged_argument_base const*
>
{
};
// This metafunction identifies tagged_argument specializations
// and their derived classes.
template <typename T>
struct is_tagged_argument
: ::boost::mpl::if_<
::boost::is_lvalue_reference<T>
, ::boost::mpl::false_
, ::boost::parameter::aux::is_tagged_argument_aux<T>
>::type
{
};
}}} // namespace boost::parameter::aux
#endif // perfect forwarding support, or exponential overloads
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <type_traits>
namespace boost { namespace parameter { namespace aux {
template <typename T>
using is_tagged_argument_mp11 = ::std::is_base_of<
::boost::parameter::aux::tagged_argument_base
, typename ::std::remove_const<
typename ::std::remove_reference<T>::type
>::type
>;
}}} // namespace boost::parameter::aux
#endif // BOOST_PARAMETER_CAN_USE_MP11
#endif // include guard

View File

@@ -0,0 +1,16 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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)
#ifndef BOOST_PARAMETER_AUX_LAMBDA_TAG_HPP
#define BOOST_PARAMETER_AUX_LAMBDA_TAG_HPP
namespace boost { namespace parameter { namespace aux {
// Tag type passed to MPL lambda.
struct lambda_tag;
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,151 @@
// Copyright Daniel Wallin 2006.
// 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)
//
// 2009.10.21 TDS remove depenency on boost::python::detail::referent_storage
//
#ifndef BOOST_PARAMETER_MAYBE_091021_HPP
#define BOOST_PARAMETER_MAYBE_091021_HPP
namespace boost { namespace parameter { namespace aux {
template <typename T>
struct referent_size;
}}} // namespace boost::parameter::aux
#include <boost/parameter/config.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename T>
struct referent_size<T&>
{
BOOST_STATIC_CONSTANT(::std::size_t, value = sizeof(T));
};
}}} // namespace boost::parameter::aux
#include <boost/type_traits/aligned_storage.hpp>
namespace boost { namespace parameter { namespace aux {
// A metafunction returning a POD type which can store U, where T == U&.
// If T is not a reference type, returns a POD which can store T.
template <typename T>
struct referent_storage
: ::boost::aligned_storage<
::boost::parameter::aux::referent_size<T>::value
>
{
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/is_maybe.hpp>
#include <boost/optional/optional.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <type_traits>
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/type_traits/add_lvalue_reference.hpp>
#include <boost/type_traits/remove_cv.hpp>
#if !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
#include <boost/type_traits/add_const.hpp>
#endif
#endif // BOOST_PARAMETER_CAN_USE_MP11
namespace boost { namespace parameter { namespace aux {
template <typename T>
struct maybe : ::boost::parameter::aux::maybe_base
{
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
typedef typename ::std::add_lvalue_reference<
typename ::std::add_const<T>::type
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
typedef typename ::boost::add_lvalue_reference<
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
T const
#else
typename ::boost::add_const<T>::type
#endif
#endif // BOOST_PARAMETER_CAN_USE_MP11
>::type reference;
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
typedef typename ::std::remove_cv<
typename ::std::remove_reference<reference>::type
#else
typedef typename ::boost::remove_cv<
BOOST_DEDUCED_TYPENAME ::boost::remove_reference<reference>::type
#endif
>::type non_cv_value;
inline explicit maybe(T value_) : value(value_), constructed(false)
{
}
inline maybe() : value(), constructed(false)
{
}
~maybe()
{
if (this->constructed)
{
this->destroy();
}
}
inline reference construct(reference value_) const
{
return value_;
}
template <typename U>
reference construct2(U const& value_) const
{
new (this->m_storage.address()) non_cv_value(value_);
this->constructed = true;
return *reinterpret_cast<non_cv_value*>(
this->m_storage.address()
);
}
template <typename U>
inline reference construct(U const& value_) const
{
return this->construct2(value_);
}
void destroy()
{
reinterpret_cast<non_cv_value*>(
this->m_storage.address()
)->~non_cv_value();
}
typedef reference(
::boost::parameter::aux::maybe<T>::*safe_bool
)() const;
inline operator safe_bool() const
{
return this->value ? &::boost::parameter::aux::maybe<T>::get : 0;
}
inline reference get() const
{
return this->value.get();
}
private:
::boost::optional<T> value;
mutable bool constructed;
mutable typename ::boost::parameter::aux
::referent_storage<reference>::type m_storage;
};
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,93 @@
// Copyright Daniel Wallin 2006.
// 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)
#ifndef BOOST_PARAMETER_AUX_NAME_HPP
#define BOOST_PARAMETER_AUX_NAME_HPP
namespace boost { namespace parameter { namespace aux {
struct name_tag_base
{
};
template <typename Tag>
struct name_tag
{
};
}}} // namespace boost::parameter::aux
#include <boost/mpl/bool.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename T>
struct is_name_tag : ::boost::mpl::false_
{
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/value_type.hpp>
#include <boost/mpl/placeholders.hpp>
#include <boost/config.hpp>
#include <boost/config/workaround.hpp>
#if !defined(BOOST_NO_SFINAE) && \
!BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x592))
#include <boost/parameter/aux_/lambda_tag.hpp>
#include <boost/mpl/lambda.hpp>
#include <boost/mpl/bind.hpp>
#include <boost/mpl/quote.hpp>
#include <boost/core/enable_if.hpp>
namespace boost { namespace mpl {
template <typename T>
struct lambda<
T
, typename ::boost::enable_if<
::boost::parameter::aux::is_name_tag<T>
, ::boost::parameter::aux::lambda_tag
>::type
>
{
typedef ::boost::mpl::true_ is_le;
typedef ::boost::mpl::bind3<
::boost::mpl::quote3< ::boost::parameter::value_type>
, ::boost::mpl::arg<2>
, T
, void
> result_;
typedef result_ type;
};
}} // namespace boost::mpl
#endif // SFINAE enabled, not Borland.
#include <boost/parameter/aux_/void.hpp>
#define BOOST_PARAMETER_TAG_PLACEHOLDER_TYPE(tag) \
::boost::parameter::value_type< \
::boost::mpl::_2,tag,::boost::parameter::void_ \
>
/**/
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#define BOOST_PARAMETER_TAG_MP11_PLACEHOLDER_VALUE(name, tag) \
template <typename ArgumentPack> \
using name = typename ::boost::parameter \
::value_type<ArgumentPack,tag,::boost::parameter::void_>::type
/**/
#include <boost/parameter/binding.hpp>
#define BOOST_PARAMETER_TAG_MP11_PLACEHOLDER_BINDING(name, tag) \
template <typename ArgumentPack> \
using name = typename ::boost::parameter \
::binding<ArgumentPack,tag,::boost::parameter::void_>::type
/**/
#endif // BOOST_PARAMETER_CAN_USE_MP11
#endif // include guard

View File

@@ -1,77 +0,0 @@
// Copyright David Abrahams, Daniel Wallin 2003. Use, modification and
// distribution is subject to 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)
// This file generates overloads in this format:
//
// template<class A0, class A1>
// typename mpl::apply_wrap1<
// aux::make_arg_list<
// PS0,A0
// , aux::make_arg_list<
// PS1,A1
// , mpl::identity<aux::empty_arg_list>
// >
// >
// , unnamed_list
// >::type
// operator()(A0 const& a0, A1 const& a1) const
// {
// typedef typename mpl::apply_wrap1<
// aux::make_arg_list<
// PS0,A0
// , aux::make_arg_list<
// PS1,A1
// , mpl::identity<aux::empty_arg_list>
// >
// >
// >::type arg_tuple;
//
// return arg_tuple(
// a0
// , a1
// , aux::void_()
// ...
// );
// }
//
#if !defined(BOOST_PP_IS_ITERATING)
# error Boost.Parameters - do not include this file!
#endif
#define N BOOST_PP_ITERATION()
#define BOOST_PARAMETER_open_list(z, n, text) \
aux::make_arg_list< \
BOOST_PP_CAT(PS, n), BOOST_PP_CAT(A, n)
#define BOOST_PARAMETER_close_list(z, n, text) >
#define BOOST_PARAMETER_arg_list(n) \
mpl::apply_wrap1< \
BOOST_PP_ENUM(N, BOOST_PARAMETER_open_list, _) \
, mpl::always<aux::empty_arg_list> \
BOOST_PP_REPEAT(N, BOOST_PARAMETER_close_list, _) \
, unnamed_list>
template<BOOST_PP_ENUM_PARAMS(N, class A)>
typename BOOST_PARAMETER_arg_list(N)::type
operator()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& a)) const
{
typedef typename BOOST_PARAMETER_arg_list(N)::type arg_tuple;
return arg_tuple(
BOOST_PP_ENUM_PARAMS(N, a)
BOOST_PP_ENUM_TRAILING_PARAMS(
BOOST_PP_SUB(BOOST_PARAMETER_MAX_ARITY, N)
, aux::void_() BOOST_PP_INTERCEPT
));
}
#undef BOOST_PARAMETER_arg_list
#undef BOOST_PARAMETER_open_list
#undef BOOST_PARAMETER_close_list
#undef N

View File

@@ -0,0 +1,32 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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)
#ifndef BOOST_PARAMETER_AUX_PACK_AS_PARAMETER_REQUIREMENTS_HPP
#define BOOST_PARAMETER_AUX_PACK_AS_PARAMETER_REQUIREMENTS_HPP
#include <boost/parameter/aux_/pack/parameter_requirements.hpp>
#include <boost/parameter/aux_/pack/tag_type.hpp>
#include <boost/parameter/aux_/pack/predicate.hpp>
#include <boost/parameter/deduced.hpp>
namespace boost { namespace parameter { namespace aux {
// Converts a ParameterSpec into a specialization of
// parameter_requirements. We need to do this in order to get the
// tag_type into the type in a way that can be conveniently matched
// by a satisfies(...) member function in arg_list.
template <typename ParameterSpec>
struct as_parameter_requirements
{
typedef ::boost::parameter::aux::parameter_requirements<
typename ::boost::parameter::aux::tag_type<ParameterSpec>::type
, typename ::boost::parameter::aux::predicate<ParameterSpec>::type
, ::boost::parameter::aux::has_default<ParameterSpec>
> type;
};
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,217 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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)
#ifndef BOOST_PARAMETER_AUX_PACK_DEDUCE_TAG_HPP
#define BOOST_PARAMETER_AUX_PACK_DEDUCE_TAG_HPP
namespace boost { namespace parameter { namespace aux {
template <
typename Argument
, typename ArgumentPack
, typename DeducedArgs
, typename UsedArgs
, typename TagFn
, typename EmitsErrors
>
struct deduce_tag;
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/lambda_tag.hpp>
#include <boost/parameter/config.hpp>
#include <boost/mpl/apply_wrap.hpp>
#include <boost/mpl/lambda.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
namespace boost { namespace parameter { namespace aux {
template <typename Predicate, typename Argument, typename ArgumentPack>
struct deduce_tag_condition_mpl
: ::boost::mpl::apply_wrap2<
typename ::boost::mpl::lambda<
Predicate
, ::boost::parameter::aux::lambda_tag
>::type
, Argument
, ArgumentPack
>
{
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/has_nested_template_fn.hpp>
#include <boost/mp11/list.hpp>
#include <boost/mp11/utility.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename Predicate, typename Argument, typename ArgumentPack>
struct deduce_tag_condition_mp11
{
using type = ::boost::mp11::mp_apply_q<
Predicate
, ::boost::mp11::mp_list<Argument,ArgumentPack>
>;
};
template <typename Predicate, typename Argument, typename ArgumentPack>
using deduce_tag_condition = ::boost::mp11::mp_if<
::boost::parameter::aux::has_nested_template_fn<Predicate>
, ::boost::parameter::aux
::deduce_tag_condition_mp11<Predicate,Argument,ArgumentPack>
, ::boost::parameter::aux
::deduce_tag_condition_mpl<Predicate,Argument,ArgumentPack>
>;
}}} // namespace boost::parameter::aux
#else
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/assert.hpp>
#endif // BOOST_PARAMETER_CAN_USE_MP11
#include <boost/parameter/aux_/set.hpp>
#include <boost/parameter/aux_/pack/tag_type.hpp>
#include <boost/parameter/aux_/pack/tag_deduced.hpp>
namespace boost { namespace parameter { namespace aux {
// Helper for deduce_tag<...>, below.
template <
typename Argument
, typename ArgumentPack
, typename DeducedArgs
, typename UsedArgs
, typename TagFn
, typename EmitsErrors
>
class deduce_tag0
{
typedef typename DeducedArgs::spec _spec;
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
typedef typename ::boost::parameter::aux::deduce_tag_condition<
typename _spec::predicate
#else
typedef typename ::boost::mpl::apply_wrap2<
typename ::boost::mpl::lambda<
typename _spec::predicate
, ::boost::parameter::aux::lambda_tag
>::type
#endif
, Argument
, ArgumentPack
>::type _condition;
#if !defined(BOOST_PARAMETER_CAN_USE_MP11)
// Deduced parameter matches several arguments.
BOOST_MPL_ASSERT((
typename ::boost::mpl::eval_if<
typename ::boost::parameter::aux::has_key_<
UsedArgs
, typename ::boost::parameter::aux::tag_type<_spec>::type
>::type
, ::boost::mpl::eval_if<
_condition
, ::boost::mpl::if_<
EmitsErrors
, ::boost::mpl::false_
, ::boost::mpl::true_
>
, ::boost::mpl::true_
>
, ::boost::mpl::true_
>::type
));
#endif // BOOST_PARAMETER_CAN_USE_MP11
public:
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using type = typename ::boost::mp11::mp_if<
#else
typedef typename ::boost::mpl::eval_if<
#endif
_condition
, ::boost::parameter::aux
::tag_deduced<UsedArgs,_spec,Argument,TagFn>
, ::boost::parameter::aux::deduce_tag<
Argument
, ArgumentPack
, typename DeducedArgs::tail
, UsedArgs
, TagFn
, EmitsErrors
>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
>::type;
#else
>::type type;
#endif
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/void.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <type_traits>
#else
#include <boost/mpl/pair.hpp>
#include <boost/type_traits/is_same.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
// Tries to deduced a keyword tag for a given Argument.
// Returns an mpl::pair<> consisting of the tagged_argument<>,
// and an mpl::set<> where the new tag has been inserted.
//
// Argument: The argument type to be tagged.
//
// ArgumentPack: The ArgumentPack built so far.
//
// DeducedArgs: A specialization of deduced_item<> (see below).
// A list containing only the deduced ParameterSpecs.
//
// UsedArgs: An mpl::set<> containing the keyword tags used so far.
//
// TagFn: A metafunction class used to tag positional or deduced
// arguments with a keyword tag.
template <
typename Argument
, typename ArgumentPack
, typename DeducedArgs
, typename UsedArgs
, typename TagFn
, typename EmitsErrors
>
struct deduce_tag
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
: ::boost::mp11::mp_if<
::std::is_same<DeducedArgs,::boost::parameter::void_>
, ::boost::mp11::mp_identity<
::boost::mp11::mp_list< ::boost::parameter::void_,UsedArgs>
>
#else
: ::boost::mpl::eval_if<
::boost::is_same<DeducedArgs,::boost::parameter::void_>
, ::boost::mpl::pair< ::boost::parameter::void_,UsedArgs>
#endif
, ::boost::parameter::aux::deduce_tag0<
Argument
, ArgumentPack
, DeducedArgs
, UsedArgs
, TagFn
, EmitsErrors
>
>
{
};
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,34 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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)
#ifndef BOOST_PARAMETER_AUX_PACK_DEDUCED_ITEM_HPP
#define BOOST_PARAMETER_AUX_PACK_DEDUCED_ITEM_HPP
#include <boost/parameter/aux_/void.hpp>
namespace boost { namespace parameter { namespace aux {
// A typelist that stored deduced parameter specs.
template <
typename ParameterSpec
, typename Tail = ::boost::parameter::void_
>
struct deduced_item
{
typedef ParameterSpec spec;
typedef Tail tail;
};
// Evaluate Tail and construct deduced_item list.
template <typename Spec, typename Tail>
struct make_deduced_item
{
typedef ::boost::parameter::aux
::deduced_item<Spec,typename Tail::type> type;
};
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,23 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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)
#ifndef BOOST_PARAMETER_AUX_PACK_INSERT_TAGGED_HPP
#define BOOST_PARAMETER_AUX_PACK_INSERT_TAGGED_HPP
#include <boost/parameter/aux_/set.hpp>
namespace boost { namespace parameter { namespace aux {
// Inserts Tagged::key_type into the UserArgs set.
// Extra indirection to lazily evaluate Tagged::key_type.
template <typename UsedArgs, typename Tagged>
struct insert_tagged
: ::boost::parameter::aux::insert_<UsedArgs,typename Tagged::key_type>
{
};
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,43 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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)
#ifndef BOOST_PARAMETER_AUX_PACK_IS_NAMED_ARGUMENT_HPP
#define BOOST_PARAMETER_AUX_PACK_IS_NAMED_ARGUMENT_HPP
#include <boost/parameter/aux_/template_keyword.hpp>
#include <boost/parameter/aux_/is_tagged_argument.hpp>
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/integral.hpp>
#include <boost/mp11/utility.hpp>
#else
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
template <typename T>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using is_named_argument = ::boost::mp11::mp_if<
::boost::parameter::aux::is_template_keyword<T>
, ::boost::mp11::mp_true
, ::boost::parameter::aux::is_tagged_argument_mp11<T>
>;
#else
struct is_named_argument
: ::boost::mpl::if_<
::boost::parameter::aux::is_template_keyword<T>
, ::boost::mpl::true_
, ::boost::parameter::aux::is_tagged_argument<T>
>::type
{
};
#endif
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,47 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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)
#ifndef BOOST_PARAMETER_AUX_PACK_ITEM_HPP
#define BOOST_PARAMETER_AUX_PACK_ITEM_HPP
#include <boost/parameter/aux_/void.hpp>
#include <boost/config.hpp>
#include <boost/config/workaround.hpp>
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/remove_reference.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
// A parameter spec item typelist.
template <
typename Spec
, typename Arg
, typename Tail = ::boost::parameter::void_
>
struct item
{
typedef Spec spec;
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
typedef ::boost::is_const<
typename ::boost::remove_reference<Arg>::type
> is_arg_const;
#endif
typedef Arg arg;
typedef Tail tail;
};
template <typename Spec, typename Arg, typename Tail>
struct make_item
{
typedef boost::parameter::aux
::item<Spec,Arg,typename Tail::type> type;
};
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,438 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// Copyright Cromwell D. Enage 2018.
// 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)
#ifndef BOOST_PARAMETER_AUX_PACK_MAKE_ARG_LIST_HPP
#define BOOST_PARAMETER_AUX_PACK_MAKE_ARG_LIST_HPP
namespace boost { namespace parameter { namespace aux {
template <
typename List
, typename DeducedArgs
, typename TagFn
, typename IsPositional
, typename UsedArgs
, typename ArgumentPack
, typename Error
, typename EmitsErrors
>
struct make_arg_list_aux;
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/arg_list.hpp>
#include <boost/parameter/aux_/void.hpp>
#include <boost/parameter/aux_/pack/unmatched_argument.hpp>
#include <boost/parameter/aux_/pack/tag_type.hpp>
#include <boost/parameter/aux_/pack/is_named_argument.hpp>
#include <boost/parameter/aux_/pack/insert_tagged.hpp>
#include <boost/parameter/aux_/pack/deduce_tag.hpp>
#include <boost/parameter/deduced.hpp>
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/integral.hpp>
#include <boost/mp11/list.hpp>
#include <boost/mp11/utility.hpp>
#include <type_traits>
#else
#include <boost/mpl/bool.hpp>
#include <boost/mpl/pair.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/apply_wrap.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/type_traits/remove_reference.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
template <typename ArgumentPack, typename TaggedArg, typename EmitsErrors>
struct append_to_make_arg_list
{
using type = ::boost::mp11::mp_push_front<
ArgumentPack
, ::boost::parameter::aux::flat_like_arg_tuple<
typename TaggedArg::key_type
, TaggedArg
, EmitsErrors
>
>;
};
#endif
// Borland needs the insane extra-indirection workaround below so that
// it doesn't magically drop the const qualifier from the argument type.
template <
typename List
, typename DeducedArgs
, typename TagFn
, typename IsPositional
, typename UsedArgs
, typename ArgumentPack
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
, typename _argument
#endif
, typename Error
, typename EmitsErrors
>
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
class make_arg_list00
#else
class make_arg_list0
#endif
{
#if !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
typedef typename List::arg _argument;
#endif
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using _arg_type = typename ::std::remove_const<
typename ::std::remove_reference<_argument>::type
>::type;
using _is_tagged = ::boost::parameter::aux
::is_named_argument<_argument>;
#else
typedef typename ::boost::remove_const<
typename ::boost::remove_reference<_argument>::type
>::type _arg_type;
typedef ::boost::parameter::aux
::is_named_argument<_argument> _is_tagged;
#endif
typedef typename List::spec _parameter_spec;
typedef typename ::boost::parameter::aux
::tag_type<_parameter_spec>::type _tag;
// If this argument is either explicitly tagged or a deduced
// parameter, then turn off positional matching.
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using _is_positional = ::boost::mp11::mp_if<
IsPositional
, ::boost::mp11::mp_if<
::boost::parameter::aux::is_deduced<_parameter_spec>
, ::boost::mp11::mp_false
, ::boost::mp11::mp_if<
_is_tagged
, ::boost::mp11::mp_false
, ::boost::mp11::mp_true
>
>
, ::boost::mp11::mp_false
>;
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
typedef typename ::boost::mpl::eval_if<
IsPositional
, ::boost::mpl::eval_if<
::boost::parameter::aux::is_deduced<_parameter_spec>
, ::boost::mpl::false_
, ::boost::mpl::if_<
_is_tagged
, ::boost::mpl::false_
, ::boost::mpl::true_
>
>
, ::boost::mpl::false_
>::type _is_positional;
#endif // BOOST_PARAMETER_CAN_USE_MP11
// If this parameter is explicitly tagged, then add it to the
// used-parmeters set. We only really need to add parameters
// that are deduced, but we would need a way to check if
// a given tag corresponds to a deduced parameter spec.
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using _used_args = typename ::boost::mp11::mp_if<
_is_tagged
, ::boost::parameter::aux::insert_tagged<UsedArgs,_arg_type>
, ::boost::mp11::mp_identity<UsedArgs>
>::type;
#else
typedef typename ::boost::mpl::eval_if<
_is_tagged
, ::boost::parameter::aux::insert_tagged<UsedArgs,_arg_type>
, ::boost::mpl::identity<UsedArgs>
>::type _used_args;
#endif
// If this parameter is neither explicitly tagged nor positionally
// matched, then deduce the tag from the deduced parameter specs.
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using _deduced_data = typename ::boost::mp11::mp_if<
::boost::mp11::mp_if<
_is_tagged
, ::boost::mp11::mp_true
, _is_positional
>
, ::boost::mp11::mp_identity<
::boost::mp11::mp_list< ::boost::parameter::void_,_used_args>
>
#else
typedef typename ::boost::mpl::eval_if<
typename ::boost::mpl::if_<
_is_tagged
, ::boost::mpl::true_
, _is_positional
>::type
, ::boost::mpl::pair< ::boost::parameter::void_,_used_args>
#endif
, ::boost::parameter::aux::deduce_tag<
_argument
, ArgumentPack
, DeducedArgs
, _used_args
, TagFn
, EmitsErrors
>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
>::type;
#else
>::type _deduced_data;
#endif
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
// If this parameter is explicitly tagged ...
using _tagged = ::boost::mp11::mp_if<
_is_tagged
// ... just use it
, _arg_type
// ... else ...
, ::boost::mp11::mp_if<
// if positional matching is turned on ...
_is_positional
// ... tag it positionally
, ::boost::mp11::mp_apply_q<
TagFn
, ::boost::mp11::mp_list<_tag,_argument>
>
// ... else, use the deduced tag
, ::boost::mp11::mp_at_c<_deduced_data,0>
>
>;
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
// If this parameter is explicitly tagged ...
typedef typename ::boost::mpl::eval_if<
_is_tagged
// ... just use it
, ::boost::mpl::identity<_arg_type>
// ... else ...
, ::boost::mpl::eval_if<
// if positional matching is turned on ...
_is_positional
// ... tag it positionally
, ::boost::mpl::apply_wrap2<TagFn,_tag,_argument>
// ... else, use the deduced tag
, ::boost::mpl::first<_deduced_data>
>
>::type _tagged;
#endif // BOOST_PARAMETER_CAN_USE_MP11
// Build the arg_list incrementally, prepending new nodes.
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using _error = ::boost::mp11::mp_if<
::boost::mp11::mp_if<
::std::is_same<Error,::boost::parameter::void_>
, ::std::is_same<_tagged,::boost::parameter::void_>
, ::boost::mp11::mp_false
>
#else
typedef typename ::boost::mpl::if_<
typename ::boost::mpl::if_<
::boost::is_same<Error,::boost::parameter::void_>
, ::boost::is_same<_tagged,::boost::parameter::void_>
, ::boost::mpl::false_
>::type
#endif
, ::boost::parameter::aux::unmatched_argument<_argument>
, ::boost::parameter::void_
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
>;
#else
>::type _error;
#endif
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using _argument_pack = typename ::boost::mp11::mp_if<
::std::is_same<_tagged,::boost::parameter::void_>
, ::boost::mp11::mp_identity<ArgumentPack>
, ::boost::parameter::aux
::append_to_make_arg_list<ArgumentPack,_tagged,EmitsErrors>
>::type;
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
typedef typename ::boost::mpl::if_<
::boost::is_same<_tagged,::boost::parameter::void_>
, ArgumentPack
#if defined(BOOST_NO_SFINAE) || BOOST_WORKAROUND(BOOST_MSVC, < 1800)
, ::boost::parameter::aux::arg_list<_tagged,ArgumentPack>
#else
, ::boost::parameter::aux
::arg_list<_tagged,ArgumentPack,EmitsErrors>
#endif
>::type _argument_pack;
#endif // BOOST_PARAMETER_CAN_USE_MP11
public:
typedef typename ::boost::parameter::aux::make_arg_list_aux<
typename List::tail
, DeducedArgs
, TagFn
, _is_positional
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
, ::boost::mp11::mp_at_c<_deduced_data,1>
#else
, typename _deduced_data::second
#endif
, _argument_pack
, _error
, EmitsErrors
>::type type;
};
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
template <
typename List
, typename DeducedArgs
, typename TagFn
, typename IsPositional
, typename UsedArgs
, typename ArgumentPack
, typename Error
, typename EmitsErrors
>
struct make_arg_list0
{
typedef typename ::boost::mpl::eval_if<
typename List::is_arg_const
, ::boost::parameter::aux::make_arg_list00<
List
, DeducedArgs
, TagFn
, IsPositional
, UsedArgs
, ArgumentPack
, typename List::arg const
, Error
, EmitsErrors
>
, ::boost::parameter::aux::make_arg_list00<
List
, DeducedArgs
, TagFn
, IsPositional
, UsedArgs
, ArgumentPack
, typename List::arg
, Error
, EmitsErrors
>
>::type type;
};
#endif // Borland workarounds needed.
// Returns an ArgumentPack where the list of arguments has been tagged
// with keyword tags.
//
// List: A specialization of item<> (see below). Contains both
// the ordered ParameterSpecs, and the given arguments.
//
// DeducedArgs: A specialization of deduced_item<> (see below).
// A list containing only the deduced ParameterSpecs.
//
// TagFn: A metafunction class used to tag positional or deduced
// arguments with a keyword tag.
//
// IsPositional: An mpl::bool_<> specialization indicating if positional
// matching is to be performed.
//
// DeducedSet: An mpl::set<> containing the keyword tags used so far.
//
// ArgumentPack: The ArgumentPack built so far. This is initially an
// empty_arg_list and is built incrementally.
template <
typename List
, typename DeducedArgs
, typename TagFn
, typename IsPositional
, typename DeducedSet
, typename ArgumentPack
, typename Error
, typename EmitsErrors
>
struct make_arg_list_aux
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
: ::boost::mp11::mp_if<
::std::is_same<List,::boost::parameter::void_>
, ::boost::mp11::mp_identity<
::boost::mp11::mp_list<ArgumentPack,Error>
>
#else
: ::boost::mpl::eval_if<
::boost::is_same<List,::boost::parameter::void_>
, ::boost::mpl::identity< ::boost::mpl::pair<ArgumentPack,Error> >
#endif
, ::boost::parameter::aux::make_arg_list0<
List
, DeducedArgs
, TagFn
, IsPositional
, DeducedSet
, ArgumentPack
, Error
, EmitsErrors
>
>
{
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/set.hpp>
namespace boost { namespace parameter { namespace aux {
// VC6.5 was choking on the default parameters for make_arg_list_aux,
// so this just forwards to that adding in the defaults.
template <
typename List
, typename DeducedArgs
, typename TagFn
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
, typename EmitsErrors = ::boost::mp11::mp_true
#else
, typename EmitsErrors = ::boost::mpl::true_
#endif
>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using make_arg_list = ::boost::parameter::aux::make_arg_list_aux<
#else
struct make_arg_list
: ::boost::parameter::aux::make_arg_list_aux<
#endif
List
, DeducedArgs
, TagFn
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
, ::boost::mp11::mp_true
#else
, ::boost::mpl::true_
#endif
, ::boost::parameter::aux::set0
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
, ::boost::parameter::aux::flat_like_arg_list<>
#else
, ::boost::parameter::aux::empty_arg_list
#endif
, ::boost::parameter::void_
, EmitsErrors
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
>;
#else
>
{
};
#endif
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,53 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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)
#ifndef BOOST_PARAMETER_AUX_PACK_MAKE_DEDUCED_ITEMS_HPP
#define BOOST_PARAMETER_AUX_PACK_MAKE_DEDUCED_ITEMS_HPP
#include <boost/parameter/aux_/void.hpp>
#include <boost/parameter/aux_/pack/deduced_item.hpp>
#include <boost/parameter/deduced.hpp>
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/utility.hpp>
#include <type_traits>
#else
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/type_traits/is_same.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
template <typename Spec, typename Tail>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using make_deduced_items = ::boost::mp11::mp_if<
::std::is_same<Spec,::boost::parameter::void_>
, ::boost::mp11::mp_identity< ::boost::parameter::void_>
, ::boost::mp11::mp_if<
::boost::parameter::aux::is_deduced<Spec>
, ::boost::parameter::aux::make_deduced_item<Spec,Tail>
, Tail
>
>;
#else
struct make_deduced_items
: ::boost::mpl::eval_if<
::boost::is_same<Spec,::boost::parameter::void_>
, ::boost::mpl::identity< ::boost::parameter::void_>
, ::boost::mpl::eval_if<
::boost::parameter::aux::is_deduced<Spec>
, ::boost::parameter::aux::make_deduced_item<Spec,Tail>
, Tail
>
>
{
};
#endif // BOOST_PARAMETER_CAN_USE_MP11
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,45 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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)
#ifndef BOOST_PARAMETER_AUX_PACK_MAKE_ITEMS_HPP
#define BOOST_PARAMETER_AUX_PACK_MAKE_ITEMS_HPP
#include <boost/parameter/aux_/void.hpp>
#include <boost/parameter/aux_/pack/item.hpp>
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/utility.hpp>
#include <type_traits>
#else
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/type_traits/is_same.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
// Creates a item typelist.
template <typename Spec, typename Arg, typename Tail>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using make_items = ::boost::mp11::mp_if<
::std::is_same<Arg,::boost::parameter::void_>
, ::boost::mp11::mp_identity< ::boost::parameter::void_>
, ::boost::parameter::aux::make_item<Spec,Arg,Tail>
>;
#else
struct make_items
: ::boost::mpl::eval_if<
::boost::is_same<Arg,::boost::parameter::void_>
, ::boost::mpl::identity< ::boost::parameter::void_>
, ::boost::parameter::aux::make_item<Spec,Arg,Tail>
>
{
};
#endif
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,244 @@
// Copyright Cromwell D. Enage 2017.
// 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)
#ifndef BOOST_PARAMETER_AUX_PACK_MAKE_PARAMETER_SPEC_ITEMS_HPP
#define BOOST_PARAMETER_AUX_PACK_MAKE_PARAMETER_SPEC_ITEMS_HPP
namespace boost { namespace parameter { namespace aux {
// This recursive metafunction forwards successive elements of
// parameters::parameter_spec to make_deduced_items<>.
// -- Cromwell D. Enage
template <typename SpecSeq>
struct make_deduced_list;
// Helper for match_parameters_base_cond<...>, below.
template <typename ArgumentPackAndError, typename SpecSeq>
struct match_parameters_base_cond_helper;
// Helper metafunction for make_parameter_spec_items<...>, below.
template <typename SpecSeq, typename ...Args>
struct make_parameter_spec_items_helper;
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/void.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename SpecSeq>
struct make_parameter_spec_items_helper<SpecSeq>
{
typedef ::boost::parameter::void_ type;
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/pack/make_deduced_items.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/list.hpp>
#else
#include <boost/mpl/front.hpp>
#include <boost/mpl/pop_front.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
template <typename SpecSeq>
struct make_deduced_list_not_empty
: ::boost::parameter::aux::make_deduced_items<
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
::boost::mp11::mp_front<SpecSeq>
#else
typename ::boost::mpl::front<SpecSeq>::type
#endif
, ::boost::parameter::aux::make_deduced_list<
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
::boost::mp11::mp_pop_front<SpecSeq>
#else
typename ::boost::mpl::pop_front<SpecSeq>::type
#endif
>
>
{
};
}}} // namespace boost::parameter::aux
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/utility.hpp>
#else
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/empty.hpp>
#include <boost/mpl/identity.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
template <typename SpecSeq>
struct make_deduced_list
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
: ::boost::mp11::mp_if<
::boost::mp11::mp_empty<SpecSeq>
, ::boost::mp11::mp_identity< ::boost::parameter::void_>
#else
: ::boost::mpl::eval_if<
::boost::mpl::empty<SpecSeq>
, ::boost::mpl::identity< ::boost::parameter::void_>
#endif
, ::boost::parameter::aux::make_deduced_list_not_empty<SpecSeq>
>
{
};
}}} // namespace boost::parameter::aux
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <type_traits>
#else
#include <boost/mpl/bool.hpp>
#include <boost/mpl/pair.hpp>
#include <boost/mpl/if.hpp>
#include <boost/type_traits/is_same.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename ArgumentPackAndError>
struct is_arg_pack_error_void
: ::boost::mpl::if_<
::boost::is_same<
typename ::boost::mpl::second<ArgumentPackAndError>::type
, ::boost::parameter::void_
>
, ::boost::mpl::true_
, ::boost::mpl::false_
>::type
{
};
}}} // namespace boost::parameter::aux
#endif // BOOST_PARAMETER_CAN_USE_MP11
namespace boost { namespace parameter { namespace aux {
// Checks if the arguments match the criteria of overload resolution.
// If NamedList satisfies the PS0, PS1, ..., this is a metafunction
// returning parameters. Otherwise it has no nested ::type.
template <typename ArgumentPackAndError, typename SpecSeq>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using match_parameters_base_cond = ::boost::mp11::mp_if<
::boost::mp11::mp_empty<SpecSeq>
, ::std::is_same<
::boost::mp11::mp_at_c<ArgumentPackAndError,1>
, ::boost::parameter::void_
>
, ::boost::parameter::aux::match_parameters_base_cond_helper<
ArgumentPackAndError
, SpecSeq
>
>;
#else
struct match_parameters_base_cond
: ::boost::mpl::eval_if<
::boost::mpl::empty<SpecSeq>
, ::boost::parameter::aux
::is_arg_pack_error_void<ArgumentPackAndError>
, ::boost::parameter::aux::match_parameters_base_cond_helper<
ArgumentPackAndError
, SpecSeq
>
>
{
};
#endif // BOOST_PARAMETER_CAN_USE_MP11
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/pack/satisfies.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename ArgumentPackAndError, typename SpecSeq>
struct match_parameters_base_cond_helper
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
: ::boost::mp11::mp_if<
#else
: ::boost::mpl::eval_if<
#endif
::boost::parameter::aux::satisfies_requirements_of<
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
::boost::mp11::mp_at_c<ArgumentPackAndError,0>
, ::boost::mp11::mp_front<SpecSeq>
#else
typename ::boost::mpl::first<ArgumentPackAndError>::type
, typename ::boost::mpl::front<SpecSeq>::type
#endif
>
, ::boost::parameter::aux::match_parameters_base_cond<
ArgumentPackAndError
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
, ::boost::mp11::mp_pop_front<SpecSeq>
#else
, typename ::boost::mpl::pop_front<SpecSeq>::type
#endif
>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
, ::boost::mp11::mp_false
#else
, ::boost::mpl::false_
#endif
>
{
};
// This parameters item chaining metafunction class does not require
// the lengths of the SpecSeq and of Args parameter pack to match.
// Used by argument_pack to build the items in the resulting arg_list.
// -- Cromwell D. Enage
template <typename SpecSeq, typename ...Args>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using make_parameter_spec_items = ::boost::mp11::mp_if<
::boost::mp11::mp_empty<SpecSeq>
, ::boost::mp11::mp_identity< ::boost::parameter::void_>
, ::boost::parameter::aux
::make_parameter_spec_items_helper<SpecSeq,Args...>
>;
#else
struct make_parameter_spec_items
: ::boost::mpl::eval_if<
::boost::mpl::empty<SpecSeq>
, ::boost::mpl::identity< ::boost::parameter::void_>
, ::boost::parameter::aux
::make_parameter_spec_items_helper<SpecSeq,Args...>
>
{
};
#endif
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/pack/make_items.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename SpecSeq, typename A0, typename ...Args>
struct make_parameter_spec_items_helper<SpecSeq,A0,Args...>
: ::boost::parameter::aux::make_items<
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
::boost::mp11::mp_front<SpecSeq>
#else
typename ::boost::mpl::front<SpecSeq>::type
#endif
, A0
, ::boost::parameter::aux::make_parameter_spec_items<
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
::boost::mp11::mp_pop_front<SpecSeq>
#else
typename ::boost::mpl::pop_front<SpecSeq>::type
#endif
, Args...
>
>
{
};
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,25 @@
// Copyright Daniel Wallin, David Abrahams 2005.
// 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)
#ifndef BOOST_PARAMETER_AUX_PACK_PARAMETER_REQUIREMENTS_HPP
#define BOOST_PARAMETER_AUX_PACK_PARAMETER_REQUIREMENTS_HPP
namespace boost { namespace parameter { namespace aux {
// Used to pass static information about parameter requirements through
// the satisfies() overload set (below). The matched function is never
// invoked, but its type indicates whether a parameter matches at
// compile-time.
template <typename Keyword, typename Predicate, typename HasDefault>
struct parameter_requirements
{
typedef Keyword keyword;
typedef Predicate predicate;
typedef HasDefault has_default;
};
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,87 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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)
#ifndef BOOST_PARAMETER_AUX_PACK_PREDICATE_HPP
#define BOOST_PARAMETER_AUX_PACK_PREDICATE_HPP
namespace boost { namespace parameter { namespace aux {
// helper for get_predicate<...>, below
template <typename T>
struct get_predicate_or_default
{
typedef T type;
};
// helper for predicate<...>, below
template <typename T>
struct get_predicate
: ::boost::parameter::aux
::get_predicate_or_default<typename T::predicate>
{
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/use_default.hpp>
#include <boost/parameter/aux_/always_true_predicate.hpp>
namespace boost { namespace parameter { namespace aux {
template <>
struct get_predicate_or_default< ::boost::parameter::aux::use_default>
{
typedef ::boost::parameter::aux::always_true_predicate type;
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/required.hpp>
#include <boost/parameter/optional.hpp>
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/integral.hpp>
#include <boost/mp11/utility.hpp>
#else
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
template <typename T>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using predicate = ::boost::mp11::mp_if<
::boost::mp11::mp_if<
::boost::parameter::aux::is_optional<T>
, ::boost::mp11::mp_true
, ::boost::parameter::aux::is_required<T>
>
, ::boost::parameter::aux::get_predicate<T>
, ::boost::mp11::mp_identity<
::boost::parameter::aux::always_true_predicate
>
>;
#else
struct predicate
: ::boost::mpl::eval_if<
typename ::boost::mpl::if_<
::boost::parameter::aux::is_optional<T>
, ::boost::mpl::true_
, ::boost::parameter::aux::is_required<T>
>::type
, ::boost::parameter::aux::get_predicate<T>
, ::boost::mpl::identity<
::boost::parameter::aux::always_true_predicate
>
>
{
};
#endif // BOOST_PARAMETER_CAN_USE_MP11
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,142 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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)
#ifndef BOOST_PARAMETER_AUX_PACK_SATISFIES_HPP
#define BOOST_PARAMETER_AUX_PACK_SATISFIES_HPP
#include <boost/parameter/config.hpp>
#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
#include <boost/parameter/aux_/arg_list.hpp>
#include <boost/parameter/aux_/augment_predicate.hpp>
#include <boost/parameter/aux_/void.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/apply_wrap.hpp>
#include <boost/type_traits/is_same.hpp>
#else // !BOOST_WORKAROUND(BOOST_MSVC, == 1310)
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/integral.hpp>
#else
#include <boost/mpl/bool.hpp>
#endif
#include <boost/parameter/aux_/yesno.hpp>
#include <boost/parameter/aux_/preprocessor/nullptr.hpp>
#endif // MSVC-7.1 workarounds needed
namespace boost { namespace parameter { namespace aux {
#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
template <typename ArgList, typename ParameterRequirements, typename Bound>
struct satisfies_impl
: ::boost::parameter::aux::augment_predicate<
typename ParameterRequirements::predicate
, typename ArgList::reference
, typename ArgList::key_type
, Bound
, ArgList
>
{
};
#endif
// Returns mpl::true_ iff the given ParameterRequirements are satisfied by
// ArgList.
template <typename ArgList, typename ParameterRequirements>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using satisfies = ::boost::mp11::mp_bool<
sizeof(
::boost::parameter::aux::to_yesno(
ArgList::satisfies(
static_cast<ParameterRequirements*>(
BOOST_PARAMETER_AUX_PP_NULLPTR
)
, static_cast<ArgList*>(BOOST_PARAMETER_AUX_PP_NULLPTR)
)
)
) == sizeof(::boost::parameter::aux::yes_tag)
>;
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
class satisfies
{
#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
// VC7.1 can't handle the sizeof() implementation below,
// so we use this instead.
typedef typename ::boost::mpl::apply_wrap3<
typename ArgList::binding
, typename ParameterRequirements::keyword
, ::boost::parameter::void_
, ::boost::mpl::false_
>::type _bound;
public:
typedef typename ::boost::mpl::eval_if<
::boost::is_same<_bound,::boost::parameter::void_>
, typename ParameterRequirements::has_default
, ::boost::mpl::eval_if<
::boost::is_same<
ArgList
, ::boost::parameter::aux::empty_arg_list
>
, ::boost::mpl::false_
, ::boost::parameter::aux::satisfies_impl<
ArgList
, ParameterRequirements
, _bound
>
>
>::type type;
#else // !BOOST_WORKAROUND(BOOST_MSVC, == 1310)
BOOST_STATIC_CONSTANT(
bool, _value = (
sizeof(
::boost::parameter::aux::to_yesno(
ArgList::satisfies(
static_cast<ParameterRequirements*>(
BOOST_PARAMETER_AUX_PP_NULLPTR
)
, static_cast<ArgList*>(BOOST_PARAMETER_AUX_PP_NULLPTR)
)
)
) == sizeof(::boost::parameter::aux::yes_tag)
)
);
public:
typedef ::boost::mpl::bool_<
::boost::parameter::aux
::satisfies<ArgList,ParameterRequirements>::_value
> type;
#endif // MSVC-7.1 workarounds needed
};
#endif // BOOST_PARAMETER_CAN_USE_MP11
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/pack/as_parameter_requirements.hpp>
namespace boost { namespace parameter { namespace aux {
// Returns mpl::true_ if the requirements of the given ParameterSpec
// are satisfied by ArgList.
template <typename ArgList, typename ParameterSpec>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using satisfies_requirements_of = ::boost::parameter::aux::satisfies<
ArgList
, typename ::boost::parameter::aux
::as_parameter_requirements<ParameterSpec>::type
>;
#else
struct satisfies_requirements_of
: ::boost::parameter::aux::satisfies<
ArgList
, typename ::boost::parameter::aux
::as_parameter_requirements<ParameterSpec>::type
>::type
{
};
#endif // BOOST_PARAMETER_CAN_USE_MP11
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,59 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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)
#ifndef BOOST_PARAMETER_AUX_PACK_TAG_DEDUCED_HPP
#define BOOST_PARAMETER_AUX_PACK_TAG_DEDUCED_HPP
#include <boost/parameter/aux_/set.hpp>
#include <boost/parameter/aux_/pack/tag_type.hpp>
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/list.hpp>
#include <boost/mp11/utility.hpp>
#else
#include <boost/mpl/pair.hpp>
#include <boost/mpl/apply_wrap.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
// Tags a deduced argument Arg with the keyword tag of Spec using TagFn.
// Returns the tagged argument and the mpl::set<> UsedArgs with the
// tag of Spec inserted.
template <typename UsedArgs, typename Spec, typename Arg, typename TagFn>
struct tag_deduced
{
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using type = ::boost::mp11::mp_list<
::boost::mp11::mp_apply_q<
TagFn
, ::boost::mp11::mp_list<
typename ::boost::parameter::aux::tag_type<Spec>::type
, Arg
>
>
#else
typedef ::boost::mpl::pair<
typename ::boost::mpl::apply_wrap2<
TagFn
, typename ::boost::parameter::aux::tag_type<Spec>::type
, Arg
>::type
#endif // BOOST_PARAMETER_CAN_USE_MP11
, typename ::boost::parameter::aux::insert_<
UsedArgs
, typename ::boost::parameter::aux::tag_type<Spec>::type
>::type
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
>;
#else
> type;
#endif
};
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,30 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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)
#ifndef BOOST_PARAMETER_AUX_PACK_TAG_KEYWORD_ARG_HPP
#define BOOST_PARAMETER_AUX_PACK_TAG_KEYWORD_ARG_HPP
#include <boost/parameter/aux_/tag.hpp>
#include <boost/parameter/config.hpp>
namespace boost { namespace parameter { namespace aux {
struct tag_keyword_arg
{
template <typename K, typename T>
struct apply
{
typedef typename ::boost::parameter::aux::tag<K,T>::type type;
};
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
template <typename K, typename T>
using fn = typename ::boost::parameter::aux::tag<K,T>::type;
#endif
};
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,67 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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)
#ifndef BOOST_PARAMETER_AUX_PACK_TAG_KEYWORD_ARG_REF_HPP
#define BOOST_PARAMETER_AUX_PACK_TAG_KEYWORD_ARG_REF_HPP
#include <boost/parameter/aux_/unwrap_cv_reference.hpp>
#include <boost/parameter/aux_/tagged_argument.hpp>
#include <boost/parameter/config.hpp>
namespace boost { namespace parameter { namespace aux {
template <
typename Keyword
, typename ActualArg
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
, typename = typename ::boost::parameter::aux
::is_cv_reference_wrapper<ActualArg>::type
#endif
>
struct tag_ref
{
typedef ::boost::parameter::aux::tagged_argument<
Keyword
, typename ::boost::parameter::aux
::unwrap_cv_reference<ActualArg>::type
> type;
};
}}} // namespace boost::parameter::aux_
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
#include <boost/mpl/bool.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename Keyword, typename ActualArg>
struct tag_ref<Keyword,ActualArg,::boost::mpl::false_>
{
typedef ::boost::parameter::aux
::tagged_argument<Keyword,ActualArg> type;
};
}}} // namespace boost::parameter::aux_
#endif // Borland workarounds needed.
namespace boost { namespace parameter { namespace aux {
struct tag_keyword_arg_ref
{
template <typename K, typename T>
struct apply
{
typedef typename ::boost::parameter::aux::tag_ref<K,T>::type type;
};
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
template <typename K, typename T>
using fn = typename ::boost::parameter::aux::tag_ref<K,T>::type;
#endif
};
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,30 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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)
#ifndef BOOST_PARAMETER_AUX_PACK_TAG_TEMPLATE_KEYWORD_ARG_HPP
#define BOOST_PARAMETER_AUX_PACK_TAG_TEMPLATE_KEYWORD_ARG_HPP
#include <boost/parameter/template_keyword.hpp>
#include <boost/parameter/config.hpp>
namespace boost { namespace parameter { namespace aux {
struct tag_template_keyword_arg
{
template <typename K, typename T>
struct apply
{
typedef ::boost::parameter::template_keyword<K,T> type;
};
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
template <typename K, typename T>
using fn = ::boost::parameter::template_keyword<K,T>;
#endif
};
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,89 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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)
#ifndef BOOST_PARAMETER_AUX_PACK_TAG_TYPE_HPP
#define BOOST_PARAMETER_AUX_PACK_TAG_TYPE_HPP
namespace boost { namespace parameter { namespace aux {
// helper for tag_type<...>, below.
template <typename T>
struct get_tag_type0
{
typedef typename T::key_type type;
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/deduced.hpp>
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/utility.hpp>
#else
#include <boost/mpl/eval_if.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
template <typename T>
struct get_tag_type
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
: ::boost::mp11::mp_if<
#else
: ::boost::mpl::eval_if<
#endif
::boost::parameter::aux::is_deduced0<T>
, ::boost::parameter::aux::get_tag_type0<typename T::key_type>
, ::boost::parameter::aux::get_tag_type0<T>
>
{
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/required.hpp>
#include <boost/parameter/optional.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/integral.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename T>
using tag_type = ::boost::mp11::mp_if<
::boost::mp11::mp_if<
::boost::parameter::aux::is_optional<T>
, ::boost::mp11::mp_true
, ::boost::parameter::aux::is_required<T>
>
, ::boost::parameter::aux::get_tag_type<T>
, ::boost::mp11::mp_identity<T>
>;
}}} // namespace boost::parameter::aux
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/identity.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename T>
struct tag_type
: ::boost::mpl::eval_if<
typename ::boost::mpl::if_<
::boost::parameter::aux::is_optional<T>
, ::boost::mpl::true_
, ::boost::parameter::aux::is_required<T>
>::type
, ::boost::parameter::aux::get_tag_type<T>
, ::boost::mpl::identity<T>
>
{
};
}}} // namespace boost::parameter::aux
#endif // BOOST_PARAMETER_CAN_USE_MP11
#endif // include guard

View File

@@ -0,0 +1,41 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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)
#ifndef BOOST_PARAMETER_AUX_PACK_UNMATCHED_ARGUMENT_HPP
#define BOOST_PARAMETER_AUX_PACK_UNMATCHED_ARGUMENT_HPP
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <type_traits>
#else
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/type_traits/is_same.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
template <typename T>
struct unmatched_argument
{
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
static_assert(::std::is_same<T,void>::value, "T == void");
#else
BOOST_MPL_ASSERT((
typename ::boost::mpl::if_<
::boost::is_same<T,void>
, ::boost::mpl::true_
, ::boost::mpl::false_
>::type
));
#endif
typedef int type;
};
}}} // namespace boost::parameter::aux
#endif // include guard

27
include/boost/parameter/aux_/parameter_requirements.hpp Executable file → Normal file
View File

@@ -1,25 +1,12 @@
// Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
// distribution is subject to the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// Copyright Daniel Wallin, David Abrahams 2005.
// 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)
#ifndef PARAMETER_REQUIREMENTS_050331_HPP
#define PARAMETER_REQUIREMENTS_050331_HPP
#ifndef BOOST_PARAMETER_AUX_PARAMETER_REQUIREMENTS_HPP
#define BOOST_PARAMETER_AUX_PARAMETER_REQUIREMENTS_HPP
namespace boost { namespace parameter { namespace aux {
#include <boost/parameter/aux_/pack/parameter_requirements.hpp>
// Used to pass static information about parameter requirements
// through the satisfies() overload set (below). The
// matched function is never invoked, but its type indicates whether
// a parameter matches at compile-time
template <class Keyword, class Predicate, class HasDefault>
struct parameter_requirements
{
typedef Keyword keyword;
typedef Predicate predicate;
typedef HasDefault has_default;
};
#endif // include guard
}}} // namespace boost::parameter::aux
#endif // PARAMETER_REQUIREMENTS_050331_HPP

View File

@@ -0,0 +1,12 @@
// Copyright David Abrahams 2006.
// 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)
#ifndef BOOST_PARAMETER_AUX_PARENTHESIZED_TYPE_DWA2006414_HPP
#define BOOST_PARAMETER_AUX_PARENTHESIZED_TYPE_DWA2006414_HPP
#include <boost/parameter/aux_/preprocessor/impl/parenthesized_type.hpp>
#endif // include guard

View File

@@ -0,0 +1,91 @@
// Copyright Daniel Wallin 2006.
// Copyright Cromwell D. Enage 2017.
// 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)
#ifndef BOOST_PARAMETER_AUX_PP_IMPL_ARGUMENT_PACK_HPP
#define BOOST_PARAMETER_AUX_PP_IMPL_ARGUMENT_PACK_HPP
#include <boost/parameter/aux_/pack/tag_keyword_arg.hpp>
#include <boost/parameter/aux_/pack/make_arg_list.hpp>
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
#include <boost/parameter/aux_/pack/make_parameter_spec_items.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/integral.hpp>
#include <boost/mp11/list.hpp>
#else
#include <boost/mpl/bool.hpp>
#include <boost/mpl/pair.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
template <typename Parameters, typename ...Args>
struct argument_pack
{
typedef typename ::boost::parameter::aux::make_arg_list<
typename ::boost::parameter::aux::make_parameter_spec_items<
typename Parameters::parameter_spec
, Args...
>::type
, typename Parameters::deduced_list
, ::boost::parameter::aux::tag_keyword_arg
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
, ::boost::mp11::mp_false
#else
, ::boost::mpl::false_
#endif
>::type result;
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using type = ::boost::mp11::mp_at_c<result,0>;
#else
typedef typename ::boost::mpl::first<result>::type type;
#endif
};
}}} // namespace boost::parameter::aux
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
#include <boost/parameter/aux_/void.hpp>
#include <boost/parameter/aux_/pack/make_items.hpp>
#include <boost/parameter/aux_/preprocessor/no_perfect_forwarding_begin.hpp>
#include <boost/preprocessor/facilities/intercept.hpp>
#include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/pair.hpp>
namespace boost { namespace parameter { namespace aux {
template <
typename Parameters
BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(
BOOST_PARAMETER_MAX_ARITY
, typename A
, = ::boost::parameter::void_ BOOST_PP_INTERCEPT
)
>
struct argument_pack
{
typedef typename ::boost::parameter::aux::make_arg_list<
typename BOOST_PARAMETER_build_arg_list(
BOOST_PARAMETER_MAX_ARITY
, ::boost::parameter::aux::make_items
, typename Parameters::parameter_spec
, A
)::type
, typename Parameters::deduced_list
, ::boost::parameter::aux::tag_keyword_arg
, ::boost::mpl::false_
>::type result;
typedef typename ::boost::mpl::first<result>::type type;
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/preprocessor/no_perfect_forwarding_end.hpp>
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
#endif // include guard

View File

@@ -0,0 +1,55 @@
// Copyright Daniel Wallin 2006.
// Copyright Cromwell D. Enage 2017.
// 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)
#ifndef BOOST_PARAMETER_AUX_PP_IMPL_MATCH_HPP
#define BOOST_PARAMETER_AUX_PP_IMPL_MATCH_HPP
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
namespace boost { namespace parameter { namespace aux {
// Recast the ParameterSpec's nested match metafunction
// as a free metafunction.
//
// No more limits set by BOOST_PARAMETER_MAX_ARITY. -- Cromwell D. Enage
template <typename Parameters, typename ...Args>
struct match : Parameters::BOOST_NESTED_TEMPLATE match<Args...>
{
};
}}} // namespace boost::parameter::aux
#else
#include <boost/parameter/aux_/void.hpp>
#include <boost/preprocessor/facilities/intercept.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
namespace boost { namespace parameter { namespace aux {
// Recast the ParameterSpec's nested match metafunction
// as a free metafunction.
template <
typename Parameters
BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(
BOOST_PARAMETER_MAX_ARITY
, typename A
, = ::boost::parameter::void_ BOOST_PP_INTERCEPT
)
>
struct match
: Parameters::BOOST_NESTED_TEMPLATE match<
BOOST_PP_ENUM_PARAMS(BOOST_PARAMETER_MAX_ARITY, A)
>
{
};
}}} // namespace boost::parameter::aux
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
#endif // include guard

View File

@@ -0,0 +1,97 @@
// Copyright Daniel Wallin 2006.
// 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)
#ifndef BOOST_PARAMETER_AUX_PP_IMPL_UNWRAP_PREDICATE_HPP
#define BOOST_PARAMETER_AUX_PP_IMPL_UNWRAP_PREDICATE_HPP
namespace boost { namespace parameter { namespace aux {
// Given Match, which is "void x" where x is an argument matching
// criterion, extract a corresponding MPL predicate.
template <typename Match>
struct unwrap_predicate;
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/always_true_predicate.hpp>
namespace boost { namespace parameter { namespace aux {
// Match anything
template <>
struct unwrap_predicate<void*>
{
typedef ::boost::parameter::aux::always_true_predicate type;
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/config.hpp>
#if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580))
#include <boost/parameter/aux_/void.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
// A matching predicate is explicitly specified.
#if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580))
template <typename Predicate>
struct unwrap_predicate< ::boost::parameter::aux::voidstar(Predicate)>
{
typedef Predicate type;
};
#else
template <typename Predicate>
struct unwrap_predicate<void *(Predicate)>
{
typedef Predicate type;
};
#endif // SunProCC workarounds needed.
}}} // namespace boost::parameter::aux
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <type_traits>
#else
#include <boost/mpl/placeholders.hpp>
#include <boost/type_traits/is_convertible.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
// A type to which the argument is supposed to be convertible is
// specified.
template <typename Target>
struct unwrap_predicate<void (Target)>
{
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
struct type
{
template <typename Argument, typename ArgumentPack>
struct apply
: ::boost::mpl::if_<
::std::is_convertible<Argument,Target>
, ::boost::mpl::true_
, ::boost::mpl::false_
>
{
};
template <typename Argument, typename ArgumentPack>
using fn = ::std::is_convertible<Argument,Target>;
};
#else
typedef ::boost::mpl::if_<
::boost::is_convertible< ::boost::mpl::_,Target>
, ::boost::mpl::true_
, ::boost::mpl::false_
> type;
#endif // BOOST_PARAMETER_CAN_USE_MP11
};
}}} // namespace boost::parameter::aux
#endif // include guard

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,65 @@
// Copyright Cromwell D. Enage 2017.
// 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)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_BINARY_SEQ_TO_ARGS_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_BINARY_SEQ_TO_ARGS_HPP
#include <boost/preprocessor/seq/elem.hpp>
#include <boost/preprocessor/cat.hpp>
#define BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_0_1(n, prefix_seq) \
BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(0, prefix_seq), n) const&
/**/
#define BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_1_1(n, prefix_seq) \
BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(0, prefix_seq), n)&
/**/
#define BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_0_2(n, prefix_seq) \
BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_0_1(n, prefix_seq) \
BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(1, prefix_seq), n)
/**/
#define BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_1_2(n, prefix_seq) \
BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_1_1(n, prefix_seq) \
BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(1, prefix_seq), n)
/**/
#include <boost/preprocessor/seq/size.hpp>
#define BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_0(prefix_seq) \
BOOST_PP_CAT( \
BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_0_ \
, BOOST_PP_SEQ_SIZE(prefix_seq) \
)
/**/
#define BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_1(prefix_seq) \
BOOST_PP_CAT( \
BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_1_ \
, BOOST_PP_SEQ_SIZE(prefix_seq) \
)
/**/
#include <boost/parameter/aux_/preprocessor/convert_binary_seq.hpp>
// This macro converts the specified Boost.Preprocessor sequence of 1s and 0s
// into a formal function parameter list.
//
// Example:
// BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARGS((1)(0)(1)(0), (P)(p))
// expands to
// P0 & p0, P1 const& p1, P2 & p2, P3 const& p3
#define BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARGS(binary_seq, prefix_seq) \
BOOST_PARAMETER_AUX_PP_CONVERT_BINARY_SEQ( \
binary_seq \
, BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_0(prefix_seq) \
, BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_1(prefix_seq) \
, prefix_seq \
)
/**/
#endif // include guard

View File

@@ -0,0 +1,57 @@
// Copyright Cromwell D. Enage 2013.
// 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)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_CONVERT_BINARY_SEQ_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_CONVERT_BINARY_SEQ_HPP
#include <boost/preprocessor/seq/size.hpp>
#include <boost/preprocessor/seq/push_back.hpp>
#define BOOST_PARAMETER_AUX_PP_AUGMENT_BINARY_SEQ_INDEX_FOLD_OP(s, seq, idx) \
BOOST_PP_SEQ_PUSH_BACK(seq, (idx, BOOST_PP_SEQ_SIZE(seq)))
/**/
#include <boost/preprocessor/control/iif.hpp>
#include <boost/preprocessor/seq/elem.hpp>
#include <boost/preprocessor/tuple/elem.hpp>
#define BOOST_PARAMETER_AUX_PP_CONVERT_BINARY_SEQ_FOLD_OP(s, seq, elem) \
( \
BOOST_PP_SEQ_PUSH_BACK( \
BOOST_PP_SEQ_ELEM(0, seq) \
, BOOST_PP_IIF( \
BOOST_PP_TUPLE_ELEM(2, 0, elem) \
, BOOST_PP_SEQ_ELEM(2, seq) \
, BOOST_PP_SEQ_ELEM(1, seq) \
)(BOOST_PP_TUPLE_ELEM(2, 1, elem), BOOST_PP_SEQ_ELEM(3, seq)) \
) \
)(BOOST_PP_SEQ_ELEM(1, seq))(BOOST_PP_SEQ_ELEM(2, seq)) \
(BOOST_PP_SEQ_ELEM(3, seq))
/**/
#include <boost/parameter/aux_/preprocessor/seq_enum.hpp>
#include <boost/preprocessor/facilities/empty.hpp>
#include <boost/preprocessor/seq/seq.hpp>
#include <boost/preprocessor/seq/fold_left.hpp>
#define BOOST_PARAMETER_AUX_PP_CONVERT_BINARY_SEQ(seq, macro0, macro1, data) \
BOOST_PARAMETER_SEQ_ENUM( \
BOOST_PP_SEQ_ELEM( \
0 \
, BOOST_PP_SEQ_FOLD_LEFT( \
BOOST_PARAMETER_AUX_PP_CONVERT_BINARY_SEQ_FOLD_OP \
, (BOOST_PP_SEQ_NIL)(macro0)(macro1)(data) \
, BOOST_PP_SEQ_FOLD_LEFT( \
BOOST_PARAMETER_AUX_PP_AUGMENT_BINARY_SEQ_INDEX_FOLD_OP \
, BOOST_PP_EMPTY() \
, seq \
) \
) \
) \
)
/**/
#endif // include guard

View File

@@ -0,0 +1,12 @@
// Copyright Daniel Wallin 2005.
// 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)
#ifndef BOOST_PARAMETER_FLATTEN_051217_HPP
#define BOOST_PARAMETER_FLATTEN_051217_HPP
#include <boost/parameter/aux_/preprocessor/impl/flatten.hpp>
#endif // include guard

View File

@@ -0,0 +1,12 @@
// Copyright Daniel Wallin 2005.
// 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)
#ifndef BOOST_PARAMETER_FOR_EACH_051217_HPP
#define BOOST_PARAMETER_FOR_EACH_051217_HPP
#include <boost/parameter/aux_/preprocessor/impl/for_each.hpp>
#endif // include guard

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,24 @@
// Copyright Daniel Wallin 2006.
// 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)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_ARGUMENT_SPECS_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_ARGUMENT_SPECS_HPP
#include <boost/preprocessor/tuple/elem.hpp>
// Accessor macros for the argument specs tuple.
#define BOOST_PARAMETER_FN_ARG_QUALIFIER(x) BOOST_PP_TUPLE_ELEM(4, 0, x)
#define BOOST_PARAMETER_FN_ARG_KEYWORD(x) BOOST_PP_TUPLE_ELEM(4, 1, x)
#define BOOST_PARAMETER_FN_ARG_PRED(x) BOOST_PP_TUPLE_ELEM(4, 2, x)
#define BOOST_PARAMETER_FN_ARG_DEFAULT(x) BOOST_PP_TUPLE_ELEM(4, 3, x)
#include <boost/parameter/aux_/preprocessor/qualifier.hpp>
#define BOOST_PARAMETER_FN_ARG_NAME(x) \
BOOST_PARAMETER_UNQUALIFIED(BOOST_PARAMETER_FN_ARG_KEYWORD(x))
/**/
#endif // include guard

View File

@@ -0,0 +1,42 @@
// Copyright Daniel Wallin 2006.
// 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)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_ARITY_RANGE_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_ARITY_RANGE_HPP
// Helper macros for BOOST_PARAMETER_ARITY_RANGE.
#define BOOST_PARAMETER_ARITY_RANGE_M_optional(state) state
#define BOOST_PARAMETER_ARITY_RANGE_M_deduced_optional(state) state
#include <boost/preprocessor/arithmetic/inc.hpp>
#define BOOST_PARAMETER_ARITY_RANGE_M_required(state) BOOST_PP_INC(state)
#define BOOST_PARAMETER_ARITY_RANGE_M_deduced_required(state) \
BOOST_PP_INC(state)
/**/
#include <boost/parameter/aux_/preprocessor/impl/argument_specs.hpp>
#include <boost/preprocessor/cat.hpp>
#define BOOST_PARAMETER_ARITY_RANGE_M(s, state, x) \
BOOST_PP_CAT( \
BOOST_PARAMETER_ARITY_RANGE_M_ \
, BOOST_PARAMETER_FN_ARG_QUALIFIER(x) \
)(state)
/**/
#include <boost/preprocessor/seq/fold_left.hpp>
#include <boost/preprocessor/seq/size.hpp>
// Calculates [begin, end) arity range.
#define BOOST_PARAMETER_ARITY_RANGE(args) \
( \
BOOST_PP_SEQ_FOLD_LEFT(BOOST_PARAMETER_ARITY_RANGE_M, 0, args) \
, BOOST_PP_INC(BOOST_PP_SEQ_SIZE(args)) \
)
/**/
#endif // include guard

View File

@@ -0,0 +1,143 @@
// Copyright Daniel Wallin 2005.
// 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)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FLATTEN_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FLATTEN_HPP
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPLIT_required required,
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPLIT_optional optional,
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPLIT_deduced deduced,
#define BOOST_PARAMETER_AUX_PP_FLATTEN_IDENTITY(x) x
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC0_DUMMY_ELEM(z, n, data) ~
#include <boost/preprocessor/cat.hpp>
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPLIT(sub) \
BOOST_PP_CAT(BOOST_PARAMETER_AUX_PP_FLATTEN_SPLIT_, sub)
/**/
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_AS_DEDUCED(x) \
BOOST_PP_CAT(deduced_, x)
/**/
#include <boost/preprocessor/detail/split.hpp>
#define BOOST_PARAMETER_AUX_PP_FLATTEN_QUALIFIER(sub) \
BOOST_PP_SPLIT(0, BOOST_PARAMETER_AUX_PP_FLATTEN_SPLIT(sub))
/**/
#define BOOST_PARAMETER_AUX_PP_FLATTEN_ARGS(sub) \
BOOST_PP_SPLIT(1, BOOST_PARAMETER_AUX_PP_FLATTEN_SPLIT(sub))
/**/
#include <boost/preprocessor/tuple/elem.hpp>
#define BOOST_PARAMETER_AUX_PP_FLATTEN_ARITY_optional(arities) \
BOOST_PP_TUPLE_ELEM(3, 0, arities)
/**/
#define BOOST_PARAMETER_AUX_PP_FLATTEN_ARITY_required(arities) \
BOOST_PP_TUPLE_ELEM(3, 1, arities)
/**/
#include <boost/preprocessor/arithmetic/sub.hpp>
#include <boost/preprocessor/repetition/enum_trailing.hpp>
#include <boost/preprocessor/tuple/rem.hpp>
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC0(r, n, elem, data) \
(( \
BOOST_PP_TUPLE_ELEM(3, 2, data) \
, BOOST_PP_TUPLE_REM(BOOST_PP_TUPLE_ELEM(3, 0, data)) elem \
BOOST_PP_ENUM_TRAILING( \
BOOST_PP_SUB( \
BOOST_PP_TUPLE_ELEM(3, 1, data) \
, BOOST_PP_TUPLE_ELEM(3, 0, data) \
) \
, BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC0_DUMMY_ELEM \
, ~ \
) \
))
/**/
#include <boost/parameter/aux_/preprocessor/impl/for_each.hpp>
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_AUX( \
r, arity, max_arity, spec, xform \
) \
BOOST_PARAMETER_AUX_PP_FOR_EACH_R( \
r \
, arity \
, BOOST_PARAMETER_AUX_PP_FLATTEN_ARGS(spec) \
, ( \
arity \
, max_arity \
, xform(BOOST_PARAMETER_AUX_PP_FLATTEN_QUALIFIER(spec)) \
) \
, BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC0 \
)
/**/
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_optional(r, arities, spec) \
BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_AUX( \
r \
, BOOST_PP_CAT( \
BOOST_PARAMETER_AUX_PP_FLATTEN_ARITY_ \
, BOOST_PARAMETER_AUX_PP_FLATTEN_QUALIFIER(spec) \
)(arities) \
, BOOST_PP_TUPLE_ELEM(3, 2, arities) \
, spec \
, BOOST_PARAMETER_AUX_PP_FLATTEN_IDENTITY \
)
/**/
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_required(r, arities, spec) \
BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_optional(r, arities, spec)
/**/
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_deduced_M(r, arities, n, spec) \
BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_AUX( \
r \
, BOOST_PP_CAT( \
BOOST_PARAMETER_AUX_PP_FLATTEN_ARITY_ \
, BOOST_PARAMETER_AUX_PP_FLATTEN_QUALIFIER(spec) \
)(arities) \
, BOOST_PP_TUPLE_ELEM(3, 2, arities) \
, spec \
, BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_AS_DEDUCED \
)
/**/
#include <boost/preprocessor/seq/for_each_i.hpp>
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_deduced(r, arities, spec) \
BOOST_PP_SEQ_FOR_EACH_I_R( \
r \
, BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_deduced_M \
, arities \
, BOOST_PARAMETER_AUX_PP_FLATTEN_ARGS(spec) \
)
/**/
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC(r, arities, spec) \
BOOST_PP_CAT( \
BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_ \
, BOOST_PARAMETER_AUX_PP_FLATTEN_QUALIFIER(spec) \
)(r, arities, spec)
/**/
#include <boost/preprocessor/seq/for_each.hpp>
#define BOOST_PARAMETER_AUX_PP_FLATTEN( \
opt_arity, req_arity, wanted_arity, specs \
) \
BOOST_PP_SEQ_FOR_EACH( \
BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC \
, (opt_arity, req_arity, wanted_arity) \
, specs \
)
/**/
#endif // include guard

View File

@@ -0,0 +1,152 @@
// Copyright Daniel Wallin 2005.
// 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)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FOR_EACH_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FOR_EACH_HPP
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_head_aux2(x, y) (x, y), ~
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_head_aux3(x, y, z) (x, y, z), ~
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_head_aux4(x, y, z, u) (x, y, z, u), ~
#define \
BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux_BOOST_PARAMETER_AUX_PP_FOR_EACH_END_S
/**/
#include <boost/preprocessor/detail/split.hpp>
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_SPLIT_FIRST(x) \
BOOST_PP_SPLIT(0, x)
/**/
#include <boost/preprocessor/cat.hpp>
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_head(n, x) \
BOOST_PP_SPLIT( \
0 \
, BOOST_PP_CAT(BOOST_PARAMETER_AUX_PP_FOR_EACH_head_aux, n) x \
)
/**/
#include <boost/preprocessor/facilities/is_empty.hpp>
#include <boost/preprocessor/logical/not.hpp>
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux_check(x) \
BOOST_PP_NOT(BOOST_PP_IS_EMPTY( \
BOOST_PP_CAT(BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux_, x) \
)), ~
/**/
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux2(x, y) \
BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux_check(x)
/**/
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux3(x, y, z) \
BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux_check(x)
/**/
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux4(x, y, z, u) \
BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux_check(x)
/**/
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux0(n, x) \
BOOST_PP_CAT(BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux, n) x
/**/
#include <boost/preprocessor/tuple/elem.hpp>
#if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_pred(r, state) \
BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_SPLIT_FIRST( \
BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux0( \
BOOST_PP_TUPLE_ELEM(5, 3, state) \
, BOOST_PP_TUPLE_ELEM(5, 0, state) \
) \
)
/**/
#else // !(BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC())
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_pred(r, state) \
BOOST_PP_SPLIT( \
0 \
, BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux0( \
BOOST_PP_TUPLE_ELEM(5, 3, state) \
, BOOST_PP_TUPLE_ELEM(5, 0, state) \
) \
)
/**/
#endif // BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
#include <boost/preprocessor/arithmetic/inc.hpp>
#include <boost/preprocessor/tuple/eat.hpp>
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_op(r, state) \
( \
BOOST_PP_TUPLE_EAT(BOOST_PP_TUPLE_ELEM(5, 3, state)) \
BOOST_PP_TUPLE_ELEM(5, 0, state) \
, BOOST_PP_TUPLE_ELEM(5, 1, state) \
, BOOST_PP_TUPLE_ELEM(5, 2, state) \
, BOOST_PP_TUPLE_ELEM(5, 3, state) \
, BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(5, 4, state)) \
)
/**/
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_macro(r, state) \
BOOST_PP_TUPLE_ELEM(5, 2, state)( \
r \
, BOOST_PP_TUPLE_ELEM(5, 4, state) \
, BOOST_PARAMETER_AUX_PP_FOR_EACH_head( \
BOOST_PP_TUPLE_ELEM(5, 3, state) \
, BOOST_PP_TUPLE_ELEM(5, 0, state) \
) \
, BOOST_PP_TUPLE_ELEM(5, 1, state) \
)
/**/
#include <boost/preprocessor/punctuation/comma_if.hpp>
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_build_end_sentinel(z, n, text) \
BOOST_PP_COMMA_IF(n) BOOST_PARAMETER_AUX_PP_FOR_EACH_END_S
/**/
#include <boost/preprocessor/repetition/repeat.hpp>
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_build_end_sentinel_tuple(arity) \
( \
BOOST_PP_REPEAT( \
arity, BOOST_PARAMETER_AUX_PP_FOR_EACH_build_end_sentinel, _ \
) \
)
/**/
#include <boost/preprocessor/repetition/for.hpp>
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_R(r, arity, list, data, macro) \
BOOST_PP_CAT(BOOST_PP_FOR_, r)( \
(list \
BOOST_PARAMETER_AUX_PP_FOR_EACH_build_end_sentinel_tuple(arity) \
, data \
, macro \
, arity \
, 0 \
) \
, BOOST_PARAMETER_AUX_PP_FOR_EACH_pred \
, BOOST_PARAMETER_AUX_PP_FOR_EACH_op \
, BOOST_PARAMETER_AUX_PP_FOR_EACH_macro \
)
/**/
#include <boost/preprocessor/repetition/deduce_r.hpp>
#define BOOST_PARAMETER_AUX_PP_FOR_EACH(arity, list, data, macro) \
BOOST_PARAMETER_AUX_PP_FOR_EACH_R( \
BOOST_PP_DEDUCE_R(), arity, list, data, macro \
)
/**/
#endif // include guard

View File

@@ -0,0 +1,509 @@
// Copyright Daniel Wallin 2006.
// Copyright Cromwell D. Enage 2017.
// 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)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FORWARDING_OVERLOADS_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FORWARDING_OVERLOADS_HPP
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
#include <boost/preprocessor/cat.hpp>
// Expands to a forwarding parameter for a constructor or forwarding function.
#define BOOST_PARAMETER_FUNCTION_ARG_TYPE_Z(z, n, type_prefix) \
BOOST_PP_CAT(type_prefix, n)&&
/**/
#include <utility>
// Expands to an argument passed from a forwarding function to the front-end
// implementation function, or from a constructor to its delegate.
#define BOOST_PARAMETER_FUNCTION_FORWARD_PARAM_Z(z, n, type_prefix) \
::std::forward<BOOST_PP_CAT(type_prefix, n)>(BOOST_PP_CAT(a, n))
/**/
#include <boost/parameter/aux_/preprocessor/impl/parenthesized_type.hpp>
#include <boost/preprocessor/tuple/elem.hpp>
// Expands to the default constructor, whose job is to pass an empty back to
// the delegate constructor of the base class.
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_0_Z(z, n, data) \
inline BOOST_PP_TUPLE_ELEM(2, 0, data)() \
: BOOST_PARAMETER_PARENTHESIZED_TYPE(BOOST_PP_TUPLE_ELEM(2, 1, data))( \
BOOST_PP_CAT(constructor_parameters, __LINE__)()() \
) \
{ \
}
/**/
#include <boost/parameter/aux_/pp_impl/argument_pack.hpp>
#include <boost/parameter/aux_/preprocessor/impl/function_name.hpp>
#include <boost/preprocessor/control/expr_if.hpp>
// Expands to a 0-arity forwarding function, whose job is to pass an empty
// pack to the front-end implementation function.
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_0_Z(z, n, data) \
BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(BOOST_PP_TUPLE_ELEM(4, 1, data)) \
inline BOOST_PARAMETER_FUNCTION_RESULT_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, data) \
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
)< \
::boost::parameter::aux::argument_pack< \
BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, data) \
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
) \
>::type \
>::type \
BOOST_PARAMETER_MEMBER_FUNCTION_NAME(BOOST_PP_TUPLE_ELEM(3, 0, data))() \
BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 3, data), const) \
{ \
return BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 2, data), this->) \
BOOST_PARAMETER_FUNCTION_IMPL_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, data) \
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
)( \
BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, data) \
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
)()() \
); \
}
/**/
#include <boost/parameter/aux_/preprocessor/impl/function_forward_match.hpp>
#include <boost/preprocessor/repetition/enum.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
// Expands to a forwarding function, whose job is to consolidate its arguments
// into a pack for the front-end implementation function to take in.
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_1_Z(z, n, data) \
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename ParameterArgumentType)> \
BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(BOOST_PP_TUPLE_ELEM(4, 1, data)) \
inline typename BOOST_PARAMETER_FUNCTION_RESULT_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, data) \
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
)< \
typename ::boost::parameter::aux::argument_pack< \
BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, data) \
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
) \
, BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
n \
, BOOST_PARAMETER_FUNCTION_ARG_TYPE_Z \
, ParameterArgumentType \
) \
>::type \
>::type \
BOOST_PARAMETER_MEMBER_FUNCTION_NAME(BOOST_PP_TUPLE_ELEM(4, 0, data))( \
BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, ParameterArgumentType, && a) \
BOOST_PARAMETER_FUNCTION_FORWARD_MATCH_Z( \
z \
, BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, data) \
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
) \
, n \
, ParameterArgumentType \
) \
) BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 3, data), const) \
{ \
return BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 2, data), this->) \
BOOST_PARAMETER_FUNCTION_IMPL_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, data) \
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
)( \
BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, data) \
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
)()( \
BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
n \
, BOOST_PARAMETER_FUNCTION_FORWARD_PARAM_Z \
, ParameterArgumentType \
) \
) \
); \
}
/**/
#include <boost/preprocessor/comparison/equal.hpp>
// Expands to a constructor whose job is to consolidate its arguments into a
// pack for the delegate constructor of the base class to take in.
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_1_Z(z, n, data) \
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename ParameterArgumentType)> \
BOOST_PP_EXPR_IF(BOOST_PP_EQUAL(n, 1), explicit) \
inline BOOST_PP_TUPLE_ELEM(2, 0, data)( \
BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, ParameterArgumentType, && a) \
BOOST_PARAMETER_FUNCTION_FORWARD_MATCH_Z( \
z \
, BOOST_PP_CAT(constructor_parameters, __LINE__) \
, n \
, ParameterArgumentType \
) \
) : BOOST_PARAMETER_PARENTHESIZED_TYPE(BOOST_PP_TUPLE_ELEM(2, 1, data))( \
BOOST_PP_CAT(constructor_parameters, __LINE__)()( \
BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
n \
, BOOST_PARAMETER_FUNCTION_FORWARD_PARAM_Z \
, ParameterArgumentType \
) \
) \
) \
{ \
}
/**/
#include <boost/preprocessor/control/if.hpp>
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_Z(z, n, data) \
BOOST_PP_IF( \
n \
, BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_1_Z \
, BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_0_Z \
)(z, n, data)
/**/
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_Z(z, n, data) \
BOOST_PP_IF( \
n \
, BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_1_Z \
, BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_0_Z \
)(z, n, data)
/**/
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
// Helper macro for BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS.
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS_AUX(nm, impl, r, is_m, c) \
BOOST_PP_REPEAT_FROM_TO( \
BOOST_PP_TUPLE_ELEM(2, 0, r) \
, BOOST_PP_TUPLE_ELEM(2, 1, r) \
, BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_Z \
, ( \
nm \
, impl \
, BOOST_PP_IF( \
BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(nm) \
, 0 \
, is_m \
) \
, c \
) \
)
/**/
// Helper macro for BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS.
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS_AUX(class_, base, range) \
BOOST_PP_REPEAT_FROM_TO( \
BOOST_PP_TUPLE_ELEM(2, 0, range) \
, BOOST_PP_TUPLE_ELEM(2, 1, range) \
, BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_Z \
, (class_, base) \
)
/**/
#include <boost/parameter/aux_/preprocessor/impl/arity_range.hpp>
// Expands to the layer of forwarding functions for the function with the
// specified name, whose arguments determine the range of arities.
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS(name, impl, a, is_m, c) \
BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS_AUX( \
name, impl, BOOST_PARAMETER_ARITY_RANGE(a), is_m, c \
)
/**/
// Expands to the layer of forwarding functions for the constructor in the
// specified class, whose arguments determine the range of arities.
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS(class_, base, args) \
BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS_AUX( \
class_, base, BOOST_PARAMETER_ARITY_RANGE(args) \
)
/**/
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
#include <boost/parameter/aux_/preprocessor/impl/parenthesized_type.hpp>
#include <boost/preprocessor/seq/seq.hpp>
#include <boost/preprocessor/tuple/elem.hpp>
#include <boost/preprocessor/cat.hpp>
// Expands to the default constructor, whose job is to pass an empty argument
// pack back to the delegate constructor of the base class.
#define BOOST_PARAMETER_DEFAULT_CONSTRUCTOR(z, n, seq) \
inline \
BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)))() \
: BOOST_PARAMETER_PARENTHESIZED_TYPE( \
BOOST_PP_TUPLE_ELEM( \
2, 1, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
) \
)(BOOST_PP_CAT(constructor_parameters, __LINE__)()()) \
{ \
}
/**/
#include <boost/parameter/aux_/pp_impl/argument_pack.hpp>
#include <boost/parameter/aux_/preprocessor/impl/function_name.hpp>
#include <boost/preprocessor/control/expr_if.hpp>
// Expands to a 0-arity forwarding function, whose job is to pass an empty
// argument pack to the front-end implementation function.
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_0_ARITY(z, n, seq) \
BOOST_PARAMETER_MEMBER_FUNCTION_STATIC( \
BOOST_PP_TUPLE_ELEM( \
4, 1, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
) \
) \
inline BOOST_PARAMETER_FUNCTION_RESULT_NAME( \
BOOST_PP_TUPLE_ELEM( \
4, 1, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
) \
, BOOST_PP_TUPLE_ELEM( \
4, 3, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
) \
)< \
::boost::parameter::aux::argument_pack< \
BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
BOOST_PP_TUPLE_ELEM( \
4, 1, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
) \
, BOOST_PP_TUPLE_ELEM( \
4, 3, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
) \
) \
>::type \
>::type \
BOOST_PARAMETER_MEMBER_FUNCTION_NAME( \
BOOST_PP_TUPLE_ELEM( \
4, 0, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
) \
)() BOOST_PP_EXPR_IF( \
BOOST_PP_TUPLE_ELEM( \
4, 3, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
) \
, const \
) \
{ \
return BOOST_PP_EXPR_IF( \
BOOST_PP_TUPLE_ELEM( \
4, 2, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
) \
, this-> \
) BOOST_PARAMETER_FUNCTION_IMPL_NAME( \
BOOST_PP_TUPLE_ELEM( \
4, 1, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
) \
, BOOST_PP_TUPLE_ELEM( \
4, 3, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
) \
)( \
BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
BOOST_PP_TUPLE_ELEM( \
4, 1, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
) \
, BOOST_PP_TUPLE_ELEM( \
4, 3, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
) \
)()() \
); \
}
/**/
#include <boost/parameter/aux_/preprocessor/binary_seq_to_args.hpp>
#include <boost/parameter/aux_/preprocessor/impl/function_forward_match.hpp>
#include <boost/preprocessor/comparison/equal.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/seq/size.hpp>
// Expands to a constructor whose job is to consolidate its arguments into a
// pack for the delegate constructor of the base class to take in. Each
// element in BOOST_PP_SEQ_TAIL(seq) determines the const-ness of the
// corresponding argument.
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_R(r, seq) \
template < \
BOOST_PP_ENUM_PARAMS( \
BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_TAIL(seq)) \
, typename ParameterArgumentType \
) \
> \
BOOST_PP_EXPR_IF( \
BOOST_PP_EQUAL(BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_TAIL(seq)), 1) \
, explicit \
) \
inline BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_SEQ_HEAD(seq))( \
BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARGS( \
BOOST_PP_SEQ_TAIL(seq), (ParameterArgumentType)(a) \
) \
BOOST_PARAMETER_FUNCTION_FORWARD_MATCH( \
BOOST_PP_CAT(constructor_parameters, __LINE__) \
, BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_TAIL(seq)) \
, ParameterArgumentType \
) \
) : BOOST_PARAMETER_PARENTHESIZED_TYPE( \
BOOST_PP_TUPLE_ELEM(2, 1, BOOST_PP_SEQ_HEAD(seq)) \
)( \
BOOST_PP_CAT(constructor_parameters, __LINE__)()( \
BOOST_PP_ENUM_PARAMS( \
BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_TAIL(seq)), a \
) \
) \
) \
{ \
}
/**/
// Expands to a forwarding function, whose job is to consolidate its arguments
// into a pack for the front-end implementation function to take in. Each
// element in BOOST_PP_SEQ_TAIL(seq) determines the const-ness of the
// corresponding argument.
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_R(r, seq) \
template < \
BOOST_PP_ENUM_PARAMS( \
BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_TAIL(seq)) \
, typename ParameterArgumentType \
) \
> \
BOOST_PARAMETER_MEMBER_FUNCTION_STATIC( \
BOOST_PP_TUPLE_ELEM(4, 1, BOOST_PP_SEQ_HEAD(seq)) \
) \
inline typename BOOST_PARAMETER_FUNCTION_RESULT_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, BOOST_PP_SEQ_HEAD(seq)) \
, BOOST_PP_TUPLE_ELEM(4, 3, BOOST_PP_SEQ_HEAD(seq)) \
)< \
typename ::boost::parameter::aux::argument_pack< \
BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, BOOST_PP_SEQ_HEAD(seq)) \
, BOOST_PP_TUPLE_ELEM(4, 3, BOOST_PP_SEQ_HEAD(seq)) \
) \
, BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARGS( \
BOOST_PP_SEQ_TAIL(seq), (ParameterArgumentType) \
) \
>::type \
>::type \
BOOST_PARAMETER_MEMBER_FUNCTION_NAME( \
BOOST_PP_TUPLE_ELEM(4, 0, BOOST_PP_SEQ_HEAD(seq)) \
)( \
BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARGS( \
BOOST_PP_SEQ_TAIL(seq), (ParameterArgumentType)(a) \
) \
BOOST_PARAMETER_FUNCTION_FORWARD_MATCH( \
BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, BOOST_PP_SEQ_HEAD(seq)) \
, BOOST_PP_TUPLE_ELEM(4, 3, BOOST_PP_SEQ_HEAD(seq)) \
) \
, BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_TAIL(seq)) \
, ParameterArgumentType \
) \
) BOOST_PP_EXPR_IF( \
BOOST_PP_TUPLE_ELEM(4, 3, BOOST_PP_SEQ_HEAD(seq)), const \
) \
{ \
return BOOST_PP_EXPR_IF( \
BOOST_PP_TUPLE_ELEM(4, 2, BOOST_PP_SEQ_HEAD(seq)) \
, this-> \
) BOOST_PARAMETER_FUNCTION_IMPL_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, BOOST_PP_SEQ_HEAD(seq)) \
, BOOST_PP_TUPLE_ELEM(4, 3, BOOST_PP_SEQ_HEAD(seq)) \
)( \
BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, BOOST_PP_SEQ_HEAD(seq)) \
, BOOST_PP_TUPLE_ELEM(4, 3, BOOST_PP_SEQ_HEAD(seq)) \
)()( \
BOOST_PP_ENUM_PARAMS( \
BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_TAIL(seq)), a \
) \
) \
); \
}
/**/
#include <boost/parameter/aux_/preprocessor/binary_seq_for_each.hpp>
#include <boost/preprocessor/control/if.hpp>
// Expands to all constructors that take in n arguments. Enables
// BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS_AUX to use
// BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_Z within BOOST_PP_REPEAT_FROM_TO.
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_Z(z, n, data) \
BOOST_PP_IF( \
n \
, BOOST_PARAMETER_AUX_PP_BINARY_SEQ_FOR_EACH_Z \
, BOOST_PARAMETER_DEFAULT_CONSTRUCTOR \
)(z, n, (BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_R)(data))
/**/
// Expands to all forwarding functions that take in n arguments. Enables
// BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS_AUX to use
// BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_Z within BOOST_PP_REPEAT_FROM_TO.
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_Z(z, n, data) \
BOOST_PP_IF( \
n \
, BOOST_PARAMETER_AUX_PP_BINARY_SEQ_FOR_EACH_Z \
, BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_0_ARITY \
)(z, n, (BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_R)(data))
/**/
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
// Helper macro for BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS.
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS_AUX(class_, base, range) \
BOOST_PP_REPEAT_FROM_TO( \
BOOST_PP_TUPLE_ELEM(2, 0, range) \
, BOOST_PP_TUPLE_ELEM(2, 1, range) \
, BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_Z \
, (class_, base) \
)
/**/
// Helper macro for BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS.
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS_AUX(nm, impl, r, is_m, c) \
BOOST_PP_REPEAT_FROM_TO( \
BOOST_PP_TUPLE_ELEM(2, 0, r) \
, BOOST_PP_TUPLE_ELEM(2, 1, r) \
, BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_Z \
, ( \
nm \
, impl \
, BOOST_PP_IF( \
BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(impl) \
, 0 \
, is_m \
) \
, c \
) \
)
/**/
#include <boost/parameter/aux_/preprocessor/impl/arity_range.hpp>
// Expands to the layer of forwarding functions for the constructor in the
// specified class, whose arguments determine the range of arities.
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS(class_, base, args) \
BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS_AUX( \
class_ \
, base \
, BOOST_PARAMETER_ARITY_RANGE(args) \
)
/**/
// Expands to the layer of forwarding functions for the function with the
// specified name, whose arguments determine the range of arities.
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS(name, impl, a, is_m, c) \
BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS_AUX( \
name \
, impl \
, BOOST_PARAMETER_ARITY_RANGE(a) \
, is_m \
, c \
)
/**/
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
#endif // include guard

View File

@@ -0,0 +1,730 @@
// Copyright Daniel Wallin 2006.
// Copyright Cromwell D. Enage 2017.
// 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)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_CAST_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_CAST_HPP
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
namespace boost { namespace parameter { namespace aux {
// Handles possible implicit casts. Used by preprocessor.hpp
// to normalize user input.
//
// cast<void*>::execute() is identity
// cast<void*(X)>::execute() is identity
// cast<void(X)>::execute() casts to X
//
// preprocessor.hpp uses this like this:
//
// #define X(value, predicate)
// cast<void predicate>::execute(value)
//
// X(something, *)
// X(something, *(predicate))
// X(something, (int))
template <typename VoidExpr, typename Args>
struct cast;
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/use_default_tag.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename T, typename B>
inline ::boost::parameter::aux::use_default_tag
forward(::boost::parameter::aux::use_default_tag)
{
return ::boost::parameter::aux::use_default_tag();
}
}}} // namespace boost::parameter::aux
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/integral.hpp>
#include <boost/mp11/utility.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
template <typename Args>
struct cast<void*,Args>
{
template <typename T, typename B>
struct apply
{
typedef typename ::boost::mpl
::if_<B,T,::boost::mpl::true_>::type type;
};
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
template <typename T, typename B>
using fn = ::boost::mp11::mp_if<B,T,::boost::mp11::mp_true>;
#endif
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/void.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename Predicate, typename Args>
struct cast<void*(Predicate),Args>
: ::boost::parameter::aux::cast<void*,Args>
{
};
}}} // namespace boost::parameter::aux
#include <boost/mpl/placeholders.hpp>
namespace boost { namespace parameter { namespace aux {
// This is a hack used in cast<> to turn the user supplied type,
// which may or may not be a placeholder expression, into one,
// so that it will be properly evaluated by mpl::apply.
template <typename T, typename Dummy = ::boost::mpl::_1>
struct as_placeholder_expr
{
typedef T type;
};
}}} // namespace boost::parameter::aux
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/list.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename Target, typename Source, typename Args>
struct apply_target_fn
{
using type = ::boost::mp11
::mp_apply_q<Target,::boost::mp11::mp_list<Source,Args> >;
};
}}} // namespace boost::parameter::aux
#endif
#include <boost/mpl/apply.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/parameter/aux_/has_nested_template_fn.hpp>
#include <type_traits>
#else
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/type_traits/remove_reference.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
template <typename Target, typename Source, typename Args>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using is_target_same_as_source = ::std::is_same<
typename ::std::remove_const<
typename ::std::remove_reference<
typename ::boost::mp11::mp_if<
::boost::parameter::aux::has_nested_template_fn<Target>
, ::boost::parameter::aux
::apply_target_fn<Target,Source,Args>
, ::boost::mpl::apply2<
::boost::parameter::aux::as_placeholder_expr<Target>
, Source
, Args
>
>::type
>::type
>::type
, typename ::std::remove_const<Source>::type
>;
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
struct is_target_same_as_source
: ::boost::mpl::if_<
::boost::is_same<
typename ::boost::remove_const<
typename ::boost::remove_reference<
typename ::boost::mpl::apply2<
::boost::parameter::aux
::as_placeholder_expr<Target>
, Source
, Args
>::type
>::type
>::type
, typename ::boost::remove_const<Source>::type
>
, ::boost::mpl::true_
, ::boost::mpl::false_
>::type
{
};
#endif // BOOST_PARAMETER_CAN_USE_MP11
}}} // namespace boost::parameter::aux
#if !defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/type_traits/add_const.hpp>
#include <boost/type_traits/is_const.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
// Covers the case where is_convertible<Source,Target> but not
// is_same<Source,Target>. Use cases are covered
// by test/normalize_argument_types.cpp
template <typename Source, typename Target>
class cast_convert
{
typedef ::boost::parameter::aux::cast_convert<Source,Target> _self;
public:
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using type = typename ::boost::mp11::mp_if<
::std::is_const<Source>
, ::std::add_const<Target>
, ::std::remove_const<Target>
>::type;
#else
typedef typename boost::mpl::eval_if<
::boost::is_const<Source>
, ::boost::add_const<Target>
, ::boost::remove_const<Target>
>::type type;
#endif
private:
inline static typename _self::type
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
_copy(typename ::std::remove_const<Target>::type value)
#else
_copy(typename ::boost::remove_const<Target>::type value)
#endif
{
return value;
}
public:
inline static typename _self::type evaluate(Source&& source)
{
return _self::_copy(source);
}
};
template <typename Target, typename Source, typename Args>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using cast_impl = ::std::remove_reference<
typename ::boost::mp11::mp_if<
::boost::parameter::aux::has_nested_template_fn<Target>
, ::boost::parameter::aux
::is_target_same_as_source<Target,Source,Args>
, ::boost::mpl::apply2<
::boost::parameter::aux::as_placeholder_expr<Target>
, Source
, Args
>
>::type
>;
#else
struct cast_impl
: ::boost::remove_reference<
typename ::boost::mpl::apply2<
::boost::parameter::aux::as_placeholder_expr<Target>
, Source
, Args
>::type
>
{
};
#endif // BOOST_PARAMETER_CAN_USE_MP11
}}} // namespace boost::parameter::aux
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename Target, typename Args>
struct cast<void(Target),Args>
{
template <typename T, typename B>
struct apply
{
typedef typename ::boost::mpl::eval_if<
B
, ::boost::mpl::eval_if<
::boost::parameter::aux
::is_target_same_as_source<Target,T,Args>
, ::boost::mpl::identity<T>
, ::boost::parameter::aux::cast_impl<Target,T,Args>
>
, ::boost::parameter::aux
::is_target_same_as_source<Target,T,Args>
>::type type;
};
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
template <typename T, typename B>
using fn = typename ::boost::mp11::mp_if<
B
, ::boost::mp11::mp_if<
::boost::parameter::aux
::is_target_same_as_source<Target,T,Args>
, ::boost::mp11::mp_identity<T>
, ::boost::parameter::aux::cast_impl<Target,T,Args>
>
, ::boost::parameter::aux
::is_target_same_as_source<Target,T,Args>
>::type;
#endif
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/value_type.hpp>
#if !defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mpl/apply_wrap.hpp>
#endif
// Expands to the target type of the argument as indicated by the predicate.
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#define BOOST_PARAMETER_FUNCTION_CAST_T(tag, predicate, args) \
::boost::mp11::mp_apply_q< \
::boost::parameter::aux::cast<void predicate, args> \
, ::boost::mp11::mp_list< \
typename ::boost::parameter::value_type< \
args \
, tag \
, ::boost::parameter::aux::use_default_tag \
>::type \
, ::boost::mp11::mp_true \
> \
>
/**/
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
#define BOOST_PARAMETER_FUNCTION_CAST_T(tag, predicate, args) \
typename ::boost::mpl::apply_wrap2< \
::boost::parameter::aux::cast<void predicate, args> \
, typename ::boost::parameter::value_type< \
args \
, tag \
, ::boost::parameter::aux::use_default_tag \
>::type \
, ::boost::mpl::true_ \
>::type
/**/
#endif // BOOST_PARAMETER_CAN_USE_MP11
// Expands to boost::mpl::true_ if and only if the argument's source and
// target types are the same.
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#define BOOST_PARAMETER_FUNCTION_CAST_B(tag, predicate, args) \
::boost::mp11::mp_apply_q< \
::boost::parameter::aux::cast<void predicate, args> \
, ::boost::mp11::mp_list< \
typename ::boost::parameter::value_type< \
args \
, tag \
, ::boost::parameter::aux::use_default_tag \
>::type \
, ::boost::mp11::mp_false \
> \
>
/**/
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
#define BOOST_PARAMETER_FUNCTION_CAST_B(tag, predicate, args) \
typename ::boost::mpl::apply_wrap2< \
::boost::parameter::aux::cast<void predicate, args> \
, typename ::boost::parameter::value_type< \
args \
, tag \
, ::boost::parameter::aux::use_default_tag \
>::type \
, ::boost::mpl::false_ \
>::type
/**/
#endif // BOOST_PARAMETER_CAN_USE_MP11
#include <boost/core/enable_if.hpp>
#include <utility>
namespace boost { namespace parameter { namespace aux {
// If the source and target types are not the same,
// then perform an implicit conversion.
template <typename Target, typename B, typename Source>
inline typename ::boost::lazy_disable_if<
B
, ::boost::parameter::aux::cast_convert<Source,Target>
>::type
forward(Source&& source)
{
return ::boost::parameter::aux::cast_convert<Source,Target>
::evaluate(::std::forward<Source>(source));
}
// If the source and target types are the same,
// then simply forward the argument.
// However, treat rvalue references to scalars as const lvalue references.
template <typename T, typename B>
inline typename ::boost::enable_if<B,T const&>::type forward(T const& t)
{
return t;
}
template <typename T, typename B>
inline typename ::boost::enable_if<
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
::boost::mp11::mp_if<
B
, ::boost::mp11::mp_if<
::std::is_const<T>
, ::boost::mp11::mp_false
, ::boost::mp11::mp_true
>
, ::boost::mp11::mp_false
>
#else
typename ::boost::mpl::eval_if<
B
, ::boost::mpl::if_<
::boost::is_const<T>
, ::boost::mpl::false_
, ::boost::mpl::true_
>
, ::boost::mpl::false_
>::type
#endif // BOOST_PARAMETER_CAN_USE_MP11
, T&
>::type
forward(T& t)
{
return t;
}
}}} // namespace boost::parameter::aux
#include <boost/type_traits/is_scalar.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename T, typename B>
inline typename ::boost::enable_if<
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
::boost::mp11::mp_if<
B
, ::boost::mp11::mp_if<
::std::is_scalar<T>
, ::boost::mp11::mp_false
, ::boost::mp11::mp_true
>
, ::boost::mp11::mp_false
>
#else
typename ::boost::mpl::eval_if<
B
, ::boost::mpl::if_<
::boost::is_scalar<T>
, ::boost::mpl::false_
, ::boost::mpl::true_
>
, ::boost::mpl::false_
>::type
#endif // BOOST_PARAMETER_CAN_USE_MP11
, T const&&
>::type
forward(T const&& t)
{
return static_cast<T const&&>(t);
}
template <typename T, typename B>
inline typename ::boost::enable_if<
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
::boost::mp11::mp_if<
B
, ::boost::mp11::mp_if<
::std::is_scalar<T>
, ::boost::mp11::mp_false
, ::boost::mp11::mp_true
>
, ::boost::mp11::mp_false
>
#else
typename ::boost::mpl::eval_if<
B
, ::boost::mpl::if_<
::boost::is_scalar<T>
, ::boost::mpl::false_
, ::boost::mpl::true_
>
, ::boost::mpl::false_
>::type
#endif // BOOST_PARAMETER_CAN_USE_MP11
, T&&
>::type
forward(T&& t)
{
return ::std::forward<T>(t);
}
}}} // namespace boost::parameter::aux
#elif BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
#define BOOST_PARAMETER_FUNCTION_CAST_T(value_t, predicate, args) value_t
#define BOOST_PARAMETER_FUNCTION_CAST_B(value, predicate, args) value
#else // no perfect forwarding support and no Borland workarounds needed
namespace boost { namespace parameter { namespace aux {
// Handles possible implicit casts. Used by preprocessor.hpp
// to normalize user input.
//
// cast<void*>::execute() is identity
// cast<void*(X)>::execute() is identity
// cast<void(X)>::execute() casts to X
//
// preprocessor.hpp uses this like this:
//
// #define X(value, predicate)
// cast<void predicate>::execute(value)
//
// X(something, *)
// X(something, *(predicate))
// X(something, (int))
template <typename VoidExpr, typename Args>
struct cast;
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/use_default_tag.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename Args>
struct cast<void*,Args>
{
template <typename T>
struct apply
{
typedef T& type;
};
inline static ::boost::parameter::aux::use_default_tag
execute(::boost::parameter::aux::use_default_tag)
{
return ::boost::parameter::aux::use_default_tag();
}
template <typename U>
inline static U& execute(U& value)
{
return value;
}
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/void.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename Predicate, typename Args>
#if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580))
struct cast< ::boost::parameter::aux::voidstar(Predicate),Args>
#else
struct cast<void*(Predicate),Args>
#endif
: ::boost::parameter::aux::cast<void*,Args>
{
};
}}} // namespace boost::parameter::aux
#include <boost/mpl/placeholders.hpp>
namespace boost { namespace parameter { namespace aux {
// This is a hack used in cast<> to turn the user supplied type,
// which may or may not be a placeholder expression, into one,
// so that it will be properly evaluated by mpl::apply.
template <typename T, typename Dummy = ::boost::mpl::_1>
struct as_placeholder_expr
{
typedef T type;
};
}}} // namespace boost::parameter::aux
#include <boost/mpl/apply.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/type_traits/remove_reference.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename Target, typename Source, typename Args>
struct is_target_same_as_source
: ::boost::mpl::if_<
::boost::is_same<
typename ::boost::remove_const<
typename ::boost::remove_reference<
typename ::boost::mpl::apply2<
::boost::parameter::aux
::as_placeholder_expr<Target>
, Source
, Args
>::type
>::type
>::type
, typename ::boost::remove_const<Source>::type
>
, ::boost::mpl::true_
, ::boost::mpl::false_
>::type
{
};
template <
typename Target
, typename Source
, typename Args
, typename Enable = ::boost::parameter::aux
::is_target_same_as_source<Target,Source,Args>
>
struct cast_impl
{
typedef Source& type;
inline static Source& evaluate(Source& value)
{
return value;
}
};
}}} // namespace boost::parameter::aux
#include <boost/type_traits/add_const.hpp>
#include <boost/type_traits/add_lvalue_reference.hpp>
namespace boost { namespace parameter { namespace aux {
// Covers the case where is_convertible<Source,Target> but not
// is_same<Source,Target>. Use cases are covered
// by test/normalize_argument_types.cpp
template <typename Source, typename Target>
class cast_convert
{
typedef ::boost::parameter::aux::cast_convert<Source,Target> _self;
public:
typedef typename ::boost::add_lvalue_reference<
typename ::boost::add_const<Target>::type
>::type type;
private:
template <typename U>
inline static typename _self::type _mod_const(U const& u)
{
return u;
}
inline static Target _copy(Target value)
{
return value;
}
public:
inline static typename _self::type evaluate(Source& source)
{
return _self::_mod_const(_self::_copy(source));
}
};
template <typename Target, typename Source, typename Args>
struct cast_impl<Target,Source,Args,::boost::mpl::false_>
: ::boost::parameter::aux::cast_convert<
Source,
typename ::boost::mpl::apply2<
::boost::parameter::aux::as_placeholder_expr<Target>
, Source
, Args
>::type
>
{
};
}}} // namespace boost::parameter::aux
#include <boost/mpl/eval_if.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename Target, typename Args>
struct cast<void(Target),Args>
{
template <typename T>
struct apply
{
typedef typename ::boost::mpl::eval_if<
::boost::parameter::aux
::is_target_same_as_source<Target,T,Args>
, ::boost::add_lvalue_reference<T>
, ::boost::parameter::aux::cast_impl<
Target
, T
, Args
, ::boost::mpl::false_
>
>::type type;
};
inline static ::boost::parameter::aux::use_default_tag
execute(::boost::parameter::aux::use_default_tag)
{
return ::boost::parameter::aux::use_default_tag();
}
template <typename U>
inline static typename ::boost::parameter::aux
::cast_impl<Target,U const,Args>::type
execute(U const& value)
{
return ::boost::parameter::aux
::cast_impl<Target,U const,Args>::evaluate(value);
}
template <typename U>
inline static typename ::boost::parameter::aux
::cast_impl<Target,U,Args>::type
execute(U& value)
{
return ::boost::parameter::aux
::cast_impl<Target,U,Args>::evaluate(value);
}
};
}}} // namespace boost::parameter::aux
#include <boost/mpl/apply_wrap.hpp>
#include <boost/parameter/value_type.hpp>
// Expands to the reference-qualified target type of the argument
// as indicated by the predicate.
#define BOOST_PARAMETER_FUNCTION_CAST_T(tag, predicate, args) \
typename ::boost::mpl::apply_wrap1< \
::boost::parameter::aux::cast<void predicate, args> \
, typename ::boost::parameter::value_type< \
args \
, tag \
, ::boost::parameter::aux::use_default_tag \
>::type \
>::type
/**/
// Expands to the converted or passed-through value
// as indicated by the predicate.
#define BOOST_PARAMETER_FUNCTION_CAST_B(value, predicate, args) \
::boost::parameter::aux::cast<void predicate, args>::execute(value)
/**/
#endif // perfect forwarding support, or Borland workarounds needed
#endif // include guard

View File

@@ -0,0 +1,474 @@
// Copyright Daniel Wallin 2006.
// Copyright Cromwell D. Enage 2017.
// 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)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_DISPATCH_LAYER_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_DISPATCH_LAYER_HPP
#include <boost/preprocessor/cat.hpp>
// Expands to keyword_tag_type for some keyword_tag.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_TYPE(keyword_tag) \
BOOST_PP_CAT(keyword_tag, _type)
/**/
// Expands to a template parameter for each dispatch function.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_TEMPLATE_ARG(r, macro, arg) \
, typename BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_TYPE(macro(arg))
/**/
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
// Expands to a forwarding parameter for a dispatch function.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_DEFN(r, macro, arg) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_TYPE(macro(arg))&& macro(arg)
/**/
#include <utility>
// Expands to an argument passed from one dispatch function to the next.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_FWD(r, macro, arg) \
, ::std::forward< \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_TYPE(macro(arg)) \
>(macro(arg))
/**/
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
// Expands to a forwarding parameter for a dispatch function. The parameter
// type stores its const-ness.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_DEFN(r, macro, arg) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_TYPE(macro(arg))& macro(arg)
/**/
#include <boost/parameter/aux_/as_lvalue.hpp>
// Expands to an argument passed from one dispatch function to the next.
// Explicit forwarding takes the form of forcing the argument to be an lvalue.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_FWD(r, macro, arg) \
, ::boost::parameter::aux::as_lvalue(macro(arg))
/**/
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
#include <boost/parameter/aux_/preprocessor/impl/argument_specs.hpp>
#include <boost/parameter/aux_/preprocessor/impl/split_args.hpp>
#include <boost/preprocessor/seq/for_each.hpp>
#include <boost/preprocessor/seq/first_n.hpp>
// Iterates through all required arguments and the first n optional arguments,
// passing each argument to the specified macro.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_REPEAT(macro, n, split_args) \
BOOST_PP_SEQ_FOR_EACH( \
macro \
, BOOST_PARAMETER_FN_ARG_NAME \
, BOOST_PARAMETER_SPLIT_ARG_REQ_SEQ(split_args) \
) \
BOOST_PP_SEQ_FOR_EACH( \
macro \
, BOOST_PARAMETER_FN_ARG_NAME \
, BOOST_PP_SEQ_FIRST_N( \
n, BOOST_PARAMETER_SPLIT_ARG_OPT_SEQ(split_args) \
) \
)
/**/
#include <boost/parameter/aux_/preprocessor/impl/function_dispatch_tuple.hpp>
#include <boost/parameter/aux_/preprocessor/impl/function_name.hpp>
#include <boost/preprocessor/control/if.hpp>
// Produces a name for the dispatch functions.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_NAME(x, n) \
BOOST_PP_CAT( \
BOOST_PP_CAT( \
BOOST_PP_IF( \
BOOST_PARAMETER_FUNCTION_DISPATCH_IS_CONST(x) \
, boost_param_dispatch_const_ \
, boost_param_dispatch_ \
) \
, BOOST_PP_CAT(BOOST_PP_CAT(n, boost_), __LINE__) \
) \
, BOOST_PARAMETER_MEMBER_FUNCTION_NAME( \
BOOST_PARAMETER_FUNCTION_DISPATCH_BASE_NAME(x) \
) \
)
/**/
// Expands to the template parameter list of the dispatch function with all
// required and first n optional parameters; also extracts the static keyword
// if present.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_TPL(n, x) \
template < \
typename ResultType, typename Args \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_REPEAT( \
BOOST_PARAMETER_FUNCTION_DISPATCH_TEMPLATE_ARG \
, n \
, BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
> BOOST_PARAMETER_MEMBER_FUNCTION_STATIC( \
BOOST_PARAMETER_FUNCTION_DISPATCH_BASE_NAME(x) \
)
/**/
#include <boost/parameter/aux_/use_default_tag.hpp>
#include <boost/preprocessor/control/expr_if.hpp>
#include <boost/preprocessor/punctuation/comma_if.hpp>
// Expands to the result type, name, parenthesized list of all required and
// n optional parameters, and const-ness of the dispatch function; the bit
// value b determines whether or not this dispatch function takes in
// boost::parameter::aux::use_default_tag as its last parameter.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_PRN(n, x, b1, b2) \
ResultType BOOST_PARAMETER_FUNCTION_DISPATCH_NAME(x, b1)( \
ResultType(*)(), Args const& args, long \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_REPEAT( \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_DEFN \
, n \
, BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
BOOST_PP_COMMA_IF(b2) \
BOOST_PP_EXPR_IF(b2, ::boost::parameter::aux::use_default_tag) \
) BOOST_PP_EXPR_IF(BOOST_PARAMETER_FUNCTION_DISPATCH_IS_CONST(x), const)
/**/
// Expands to a forward declaration of the dispatch function that takes in
// all required and the first n optional parameters, but not
// boost::parameter::aux::use_default_tag.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_FWD_DECL_0_Z(z, n, x) \
BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_TPL(n, x) \
BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_PRN(n, x, 0, 0);
/**/
// Expands to a forward declaration of the dispatch function that takes in
// all required parameters, the first n optional parameters, and
// boost::parameter::aux::use_default_tag.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_FWD_DECL_1_Z(z, n, x) \
BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_TPL(n, x) \
BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_PRN(n, x, 0, 1);
/**/
#include <boost/preprocessor/seq/elem.hpp>
// Expands to the default value of the (n + 1)th optional parameter.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_DEFAULT_AUX(n, s_args) \
BOOST_PARAMETER_FN_ARG_DEFAULT( \
BOOST_PP_SEQ_ELEM(n, BOOST_PARAMETER_SPLIT_ARG_OPT_SEQ(s_args)) \
)
/**/
#include <boost/parameter/keyword.hpp>
// Expands to the assignment portion which binds the default value to the
// (n + 1)th optional parameter before composing it with the argument-pack
// parameter passed in to the n-th dispatch function.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_DEFAULT(n, s_args, tag_ns) \
::boost::parameter::keyword< \
tag_ns::BOOST_PARAMETER_FN_ARG_NAME( \
BOOST_PP_SEQ_ELEM(n, BOOST_PARAMETER_SPLIT_ARG_OPT_SEQ(s_args)) \
) \
>::instance = BOOST_PARAMETER_FUNCTION_DISPATCH_DEFAULT_AUX(n, s_args)
/**/
#include <boost/parameter/aux_/preprocessor/impl/function_cast.hpp>
// Takes in the arg tuple (name, pred) and the tag namespace.
// Extracts the corresponding required argument from the pack.
// This form enables BOOST_PARAMETER_FUNCTION_DISPATCH_LAYER to use it
// from within BOOST_PP_SEQ_FOR_EACH.
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
// The boost::parameter::aux::forward wrapper is necessary to transmit the
// target type to the next dispatch function. Otherwise, the argument will
// retain its original type. -- Cromwell D. Enage
#define BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_CAST_R(r, tag_ns, arg) \
, ::boost::parameter::aux::forward< \
BOOST_PARAMETER_FUNCTION_CAST_T( \
tag_ns::BOOST_PARAMETER_FN_ARG_NAME(arg) \
, BOOST_PARAMETER_FN_ARG_PRED(arg) \
, Args \
) \
, BOOST_PARAMETER_FUNCTION_CAST_B( \
tag_ns::BOOST_PARAMETER_FN_ARG_NAME(arg) \
, BOOST_PARAMETER_FN_ARG_PRED(arg) \
, Args \
) \
>( \
args[ \
::boost::parameter::keyword< \
tag_ns::BOOST_PARAMETER_FN_ARG_NAME(arg) \
>::instance \
] \
)
/**/
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
// The explicit type cast is necessary to transmit the target type to the next
// dispatch function. Otherwise, the argument will retain its original type.
// -- Cromwell D. Enage
#define BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_CAST_R(r, tag_ns, arg) \
, BOOST_PARAMETER_FUNCTION_CAST_T( \
tag_ns::BOOST_PARAMETER_FN_ARG_NAME(arg) \
, BOOST_PARAMETER_FN_ARG_PRED(arg) \
, Args \
)( \
args[ \
::boost::parameter::keyword< \
tag_ns::BOOST_PARAMETER_FN_ARG_NAME(arg) \
>::instance \
] \
)
/**/
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
// Takes in the arg tuple (name, pred, default) and the tag namespace.
// Extracts the corresponding optional argument from the pack if specified,
// otherwise temporarily passes use_default_tag() to the dispatch functions.
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
// The boost::parameter::aux::forward wrapper is necessary to transmit the
// target type to the next dispatch function. Otherwise, the argument will
// retain its original type. -- Cromwell D. Enage
#define BOOST_PARAMETER_FUNCTION_DISPATCH_OPT_ARG_CAST(arg, tag_ns) \
::boost::parameter::aux::forward< \
BOOST_PARAMETER_FUNCTION_CAST_T( \
tag_ns::BOOST_PARAMETER_FN_ARG_NAME(arg) \
, BOOST_PARAMETER_FN_ARG_PRED(arg) \
, Args \
) \
, BOOST_PARAMETER_FUNCTION_CAST_B( \
tag_ns::BOOST_PARAMETER_FN_ARG_NAME(arg) \
, BOOST_PARAMETER_FN_ARG_PRED(arg) \
, Args \
) \
>( \
args[ \
::boost::parameter::keyword< \
tag_ns::BOOST_PARAMETER_FN_ARG_NAME(arg) \
>::instance || ::boost::parameter::aux::use_default_tag() \
] \
)
/**/
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
#define BOOST_PARAMETER_FUNCTION_DISPATCH_OPT_ARG_CAST(arg, tag_ns) \
BOOST_PARAMETER_FUNCTION_CAST_B( \
args[ \
::boost::parameter::keyword< \
tag_ns::BOOST_PARAMETER_FN_ARG_NAME(arg) \
>::instance || ::boost::parameter::aux::use_default_tag() \
] \
, BOOST_PARAMETER_FN_ARG_PRED(arg) \
, Args \
)
/**/
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
#include <boost/parameter/aux_/preprocessor/nullptr.hpp>
// Expands to three dispatch functions that take in all required parameters
// and the first n optional parameters. The third dispatch function bears
// the same name as the first but takes in use_default_tag as the last
// parameter. The second dispatch function bears a different name from the
// other two.
//
// x is a tuple:
//
// (name, split_args, is_const, tag_namespace)
//
// Where name is the base name of the functions, and split_args is a tuple:
//
// (required_count, required_args, optional_count, required_args)
//
// The first dispatch function queries args if it has bound the (n + 1)th
// optional parameter to a user-defined argument. If so, then it forwards
// its own arguments followed by the user-defined argument to the dispatch
// function that takes in all required parameters and the first (n + 1)
// optional parameters, but not use_default_tag. Otherwise, it forwards
// its own arguments to the third dispatch function.
//
// The third dispatch function appends the default value of the (n + 1)th
// optional parameter to its copy of args. Then it forwards this copy, all
// required parameters, and the first n (not n + 1) optional parameters to
// the second dispatch function.
//
// The second dispatch function forwards its arguments, then the (n + 1)th
// optional parameter that it extracts from args, to the other-named dispatch
// function that takes in all required parameters and the first (n + 1)
// optional parameters, but not use_default_tag.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_OVERLOAD_Z(z, n, x) \
BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_TPL(n, x) \
inline BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_PRN(n, x, 0, 0) \
{ \
return BOOST_PP_EXPR_IF( \
BOOST_PARAMETER_FUNCTION_DISPATCH_IS_MEMBER(x) \
, this-> \
) BOOST_PARAMETER_FUNCTION_DISPATCH_NAME(x, 0)( \
static_cast<ResultType(*)()>(BOOST_PARAMETER_AUX_PP_NULLPTR) \
, args \
, 0L \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_REPEAT( \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_FWD \
, n \
, BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_OPT_ARG_CAST( \
BOOST_PP_SEQ_ELEM( \
n \
, BOOST_PARAMETER_SPLIT_ARG_OPT_SEQ( \
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_TAG_NAMESPACE(x) \
) \
); \
} \
BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_TPL(n, x) \
inline BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_PRN(n, x, 1, 0) \
{ \
return BOOST_PP_EXPR_IF( \
BOOST_PARAMETER_FUNCTION_DISPATCH_IS_MEMBER(x) \
, this-> \
) BOOST_PARAMETER_FUNCTION_DISPATCH_NAME(x, 0)( \
static_cast<ResultType(*)()>(BOOST_PARAMETER_AUX_PP_NULLPTR) \
, args \
, 0L \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_REPEAT( \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_FWD \
, n \
, BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
, args[ \
::boost::parameter::keyword< \
BOOST_PARAMETER_FUNCTION_DISPATCH_TAG_NAMESPACE(x):: \
BOOST_PARAMETER_FN_ARG_NAME( \
BOOST_PP_SEQ_ELEM( \
n \
, BOOST_PARAMETER_SPLIT_ARG_OPT_SEQ( \
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
) \
) \
>::instance \
] \
); \
} \
BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_TPL(n, x) \
inline BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_PRN(n, x, 0, 1) \
{ \
return BOOST_PP_EXPR_IF( \
BOOST_PARAMETER_FUNCTION_DISPATCH_IS_MEMBER(x) \
, this-> \
) BOOST_PARAMETER_FUNCTION_DISPATCH_NAME(x, 1)( \
static_cast<ResultType(*)()>(BOOST_PARAMETER_AUX_PP_NULLPTR) \
, (args \
, BOOST_PARAMETER_FUNCTION_DISPATCH_DEFAULT( \
n \
, BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_TAG_NAMESPACE(x) \
) \
) \
, 0L \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_REPEAT( \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_FWD \
, n \
, BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
); \
}
/**/
#include <boost/preprocessor/arithmetic/inc.hpp>
#include <boost/preprocessor/control/if.hpp>
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
#include <boost/preprocessor/tuple/eat.hpp>
// x is a tuple:
//
// (base_name, split_args, is_member, is_const, tag_namespace)
//
// Generates all dispatch functions for the function named base_name. Each
// dispatch function that takes in n optional parameters passes the default
// value of the (n + 1)th optional parameter to the next dispatch function.
// The last dispatch function is the back-end implementation, so only the
// header is generated: the user is expected to supply the body.
//
// Also generates the front-end implementation function, which uses
// BOOST_PARAMETER_FUNCTION_CAST to extract each argument from the argument
// pack.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_LAYER(fwd_decl, x) \
BOOST_PP_IF(fwd_decl, BOOST_PP_REPEAT_FROM_TO, BOOST_PP_TUPLE_EAT(4))( \
0 \
, BOOST_PP_INC( \
BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT( \
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_FWD_DECL_0_Z \
, x \
) \
BOOST_PP_IF(fwd_decl, BOOST_PP_REPEAT_FROM_TO, BOOST_PP_TUPLE_EAT(4))( \
0 \
, BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT( \
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_FWD_DECL_1_Z \
, x \
) \
template <typename Args> BOOST_PARAMETER_MEMBER_FUNCTION_STATIC( \
BOOST_PARAMETER_FUNCTION_DISPATCH_BASE_NAME(x) \
) inline typename BOOST_PARAMETER_FUNCTION_RESULT_NAME( \
BOOST_PARAMETER_FUNCTION_DISPATCH_BASE_NAME(x) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_IS_CONST(x) \
)<Args>::type BOOST_PARAMETER_FUNCTION_IMPL_NAME( \
BOOST_PARAMETER_FUNCTION_DISPATCH_BASE_NAME(x) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_IS_CONST(x) \
)(Args const& args) \
BOOST_PP_EXPR_IF(BOOST_PARAMETER_FUNCTION_DISPATCH_IS_CONST(x), const) \
{ \
return BOOST_PP_EXPR_IF( \
BOOST_PARAMETER_FUNCTION_DISPATCH_IS_MEMBER(x) \
, this-> \
) BOOST_PARAMETER_FUNCTION_DISPATCH_NAME(x, 0)( \
static_cast< \
typename BOOST_PARAMETER_FUNCTION_RESULT_NAME( \
BOOST_PARAMETER_FUNCTION_DISPATCH_BASE_NAME(x) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_IS_CONST(x) \
)<Args>::type(*)() \
>(BOOST_PARAMETER_AUX_PP_NULLPTR) \
, args \
, 0L \
BOOST_PP_SEQ_FOR_EACH( \
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_CAST_R \
, BOOST_PARAMETER_FUNCTION_DISPATCH_TAG_NAMESPACE(x) \
, BOOST_PARAMETER_SPLIT_ARG_REQ_SEQ( \
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
) \
); \
} \
BOOST_PP_REPEAT_FROM_TO( \
0 \
, BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT( \
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
, BOOST_PARAMETER_FUNCTION_DISPATCH_OVERLOAD_Z \
, x \
) \
BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_TPL( \
BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT( \
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
, x \
) \
inline BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_PRN( \
BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT( \
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
) \
, x \
, 0 \
, 0 \
)
/**/
#endif // include guard

View File

@@ -0,0 +1,33 @@
// Copyright Daniel Wallin 2006.
// 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)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_DISPATCH_TUPLE_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_DISPATCH_TUPLE_HPP
#include <boost/preprocessor/tuple/elem.hpp>
// Accessor macros for the input tuple to the dispatch macros.
#define BOOST_PARAMETER_FUNCTION_DISPATCH_BASE_NAME(x) \
BOOST_PP_TUPLE_ELEM(5, 0, x)
/**/
#define BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
BOOST_PP_TUPLE_ELEM(5, 1, x)
/**/
#define BOOST_PARAMETER_FUNCTION_DISPATCH_IS_MEMBER(x) \
BOOST_PP_TUPLE_ELEM(5, 2, x)
/**/
#define BOOST_PARAMETER_FUNCTION_DISPATCH_IS_CONST(x) \
BOOST_PP_TUPLE_ELEM(5, 3, x)
/**/
#define BOOST_PARAMETER_FUNCTION_DISPATCH_TAG_NAMESPACE(x) \
BOOST_PP_TUPLE_ELEM(5, 4, x)
/**/
#endif // include guard

View File

@@ -0,0 +1,43 @@
// Copyright Daniel Wallin 2006.
// 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)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_FORWARD_MATCH_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_FORWARD_MATCH_HPP
#include <boost/parameter/config.hpp>
#if !defined(BOOST_NO_SFINAE) && \
!BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x592))
#include <boost/parameter/aux_/pp_impl/match.hpp>
#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
// Expands to an extra argument that is well-formed
// iff all Args... satisfy the requirements set by params.
#define BOOST_PARAMETER_FUNCTION_FORWARD_MATCH(params, n, prefix) \
, typename ::boost::parameter::aux::match< \
params BOOST_PP_ENUM_TRAILING_PARAMS(n, prefix) \
>::type = params()
/**/
#define BOOST_PARAMETER_FUNCTION_FORWARD_MATCH_Z(z, params, n, prefix) \
, typename ::boost::parameter::aux::match< \
params BOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, prefix) \
>::type = params()
/**/
#else // SFINAE/Borland workarounds needed.
#define BOOST_PARAMETER_FUNCTION_FORWARD_MATCH(params, n, prefix) \
, params = params()
/**/
#define BOOST_PARAMETER_FUNCTION_FORWARD_MATCH_Z(z, params, n, prefix) \
, params = params()
/**/
#endif
#endif // include guard

View File

@@ -0,0 +1,152 @@
// Copyright Daniel Wallin 2006.
// 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)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_NAME_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_NAME_HPP
#define BOOST_PARAMETER_MEMBER_FUNCTION_CHECK_STATIC_static ()
/**/
#include <boost/parameter/aux_/preprocessor/is_nullary.hpp>
#include <boost/preprocessor/cat.hpp>
#define BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(name) \
BOOST_PARAMETER_IS_NULLARY( \
BOOST_PP_CAT(BOOST_PARAMETER_MEMBER_FUNCTION_CHECK_STATIC_, name) \
)
/**/
#include <boost/preprocessor/seq/seq.hpp>
#include <boost/config.hpp>
#if defined(BOOST_MSVC)
// Workaround for MSVC preprocessor.
//
// When stripping static from "static f", msvc will produce " f". The leading
// whitespace doesn't go away when pasting the token with something else, so
// this thing is a hack to strip the whitespace.
#define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_static (
/**/
#define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_AUX(name) \
BOOST_PP_CAT(BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_, name))
/**/
#define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC(name) \
BOOST_PP_SEQ_HEAD( \
BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_AUX(name) \
)
/**/
#else
#define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_static
/**/
#define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC(name) \
BOOST_PP_CAT(BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_, name)
/**/
#endif // MSVC workarounds needed
#include <boost/preprocessor/control/expr_if.hpp>
#define BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(name) \
BOOST_PP_EXPR_IF( \
BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(name), static \
)
/**/
#include <boost/preprocessor/control/if.hpp>
#include <boost/preprocessor/tuple/eat.hpp>
#define BOOST_PARAMETER_MEMBER_FUNCTION_NAME(name) \
BOOST_PP_IF( \
BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(name) \
, BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC \
, name BOOST_PP_TUPLE_EAT(1) \
)(name)
/**/
// Produces a name for a parameter specification for the function named base.
#define BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME(base, is_const) \
BOOST_PP_CAT( \
BOOST_PP_CAT( \
BOOST_PP_IF( \
is_const \
, boost_param_parameters_const_ \
, boost_param_parameters_ \
) \
, __LINE__ \
) \
, BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base) \
)
/**/
// Produces a name for a result type metafunction for the no-spec function
// named base.
#define BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME(base, is_const) \
BOOST_PP_CAT( \
BOOST_PP_CAT( \
BOOST_PP_IF( \
is_const \
, boost_param_no_spec_result_const_ \
, boost_param_no_spec_result_ \
) \
, __LINE__ \
) \
, BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base) \
)
/**/
// Produces a name for a result type metafunction for the function named base.
#define BOOST_PARAMETER_FUNCTION_RESULT_NAME(base, is_const) \
BOOST_PP_CAT( \
BOOST_PP_CAT( \
BOOST_PP_IF( \
is_const \
, boost_param_result_const_ \
, boost_param_result_ \
) \
, __LINE__ \
) \
, BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base) \
)
/**/
// Produces a name for the implementation function to which the no-spec
// function named base forwards its result type and argument pack.
#define BOOST_PARAMETER_NO_SPEC_FUNCTION_IMPL_NAME(base, is_const) \
BOOST_PP_CAT( \
BOOST_PP_CAT( \
BOOST_PP_IF( \
is_const \
, boost_param_no_spec_impl_const \
, boost_param_no_spec_impl \
) \
, __LINE__ \
) \
, BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base) \
)
/**/
// Can't do boost_param_impl_ ## basee
// because base might start with an underscore.
// daniel: what? how is that relevant? the reason for using CAT()
// is to make sure base is expanded. i'm not sure we need to here,
// but it's more stable to do it.
#define BOOST_PARAMETER_FUNCTION_IMPL_NAME(base, is_const) \
BOOST_PP_CAT( \
BOOST_PP_CAT( \
BOOST_PP_IF(is_const, boost_param_impl_const, boost_param_impl) \
, __LINE__ \
) \
, BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base) \
)
/**/
#endif // include guard

View File

@@ -0,0 +1,331 @@
// Copyright Cromwell D. Enage 2018.
// 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)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_NO_SPEC_OVERLOADS_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_NO_SPEC_OVERLOADS_HPP
#include <boost/parameter/aux_/preprocessor/impl/function_name.hpp>
// Defines the no-spec implementation function header.
#define BOOST_PARAMETER_NO_SPEC_FUNCTION_IMPL_HEAD(name, is_const) \
template <typename ResultType, typename Args> \
BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(name) ResultType \
BOOST_PARAMETER_NO_SPEC_FUNCTION_IMPL_NAME( \
name, is_const \
)(ResultType(*)(), Args const& args)
/**/
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
#include <boost/parameter/aux_/preprocessor/impl/parenthesized_return_type.hpp>
// Expands to the result metafunction for the specified no-spec function.
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#define BOOST_PARAMETER_NO_SPEC_FUNCTION_HEAD(result, name, is_const) \
template <typename TaggedArg0, typename ...TaggedArgs> \
using BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME(name, is_const) \
= typename BOOST_PARAMETER_PARENTHESIZED_RETURN_TYPE(result);
/**/
#else
#define BOOST_PARAMETER_NO_SPEC_FUNCTION_HEAD(result, name, is_const) \
template <typename TaggedArg0, typename ...TaggedArgs> \
struct BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME(name, is_const) \
: BOOST_PARAMETER_PARENTHESIZED_RETURN_TYPE(result) \
{ \
};
/**/
#endif // BOOST_PARAMETER_CAN_USE_MP11
#include <boost/parameter/compose.hpp>
#include <boost/parameter/are_tagged_arguments.hpp>
#include <boost/parameter/aux_/preprocessor/impl/parenthesized_type.hpp>
#include <boost/core/enable_if.hpp>
// Exapnds to a variadic constructor that is enabled if and only if all its
// arguments are tagged arguments. The enclosing class must inherit from the
// specified base class, which in turn must implement a constructor that takes
// in the argument pack that this one passes on.
#define BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR(class_, base) \
template < \
typename TaggedArg0 \
, typename ...TaggedArgs \
, typename = typename ::boost::enable_if< \
::boost::parameter \
::are_tagged_arguments<TaggedArg0,TaggedArgs...> \
>::type \
> inline explicit \
class_(TaggedArg0 const& arg0, TaggedArgs const&... args) \
: BOOST_PARAMETER_PARENTHESIZED_TYPE(base)( \
::boost::parameter::compose(arg0, args...) \
) \
{ \
}
/**/
// Exapnds to a variadic constructor that is enabled if and only if all its
// arguments are tagged arguments. The specified function must be able to
// take in the argument pack that this constructor passes on.
#define BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR(class_, func) \
template < \
typename TaggedArg0 \
, typename ...TaggedArgs \
, typename = typename ::boost::enable_if< \
::boost::parameter \
::are_tagged_arguments<TaggedArg0,TaggedArgs...> \
>::type \
> inline explicit \
class_(TaggedArg0 const& arg0, TaggedArgs const&... args) \
{ \
func(::boost::parameter::compose(arg0, args...)); \
}
/**/
#include <boost/parameter/aux_/preprocessor/nullptr.hpp>
#include <boost/preprocessor/control/expr_if.hpp>
// Exapnds to a variadic function that is enabled if and only if
// all its arguments are tagged arguments.
#define BOOST_PARAMETER_NO_SPEC_FUNCTION_OVERLOAD(name, impl, is_m, c) \
template <typename TaggedArg0, typename ...TaggedArgs> \
BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(impl) \
inline typename ::boost::lazy_enable_if< \
::boost::parameter \
::are_tagged_arguments<TaggedArg0,TaggedArgs...> \
, BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME( \
impl, c \
)<TaggedArg0,TaggedArgs...> \
>::type BOOST_PARAMETER_MEMBER_FUNCTION_NAME(name) \
(TaggedArg0 const& arg0, TaggedArgs const&... args) \
BOOST_PP_EXPR_IF(c, const) \
{ \
return BOOST_PP_EXPR_IF(is_m, this->) \
BOOST_PARAMETER_NO_SPEC_FUNCTION_IMPL_NAME(impl, c)( \
static_cast< \
typename BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME( \
impl, c \
)<TaggedArg0,TaggedArgs...>::type(*)() \
>(BOOST_PARAMETER_AUX_PP_NULLPTR) \
, ::boost::parameter::compose(arg0, args...) \
); \
}
/**/
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
#include <boost/parameter/aux_/void.hpp>
#include <boost/parameter/aux_/preprocessor/impl/parenthesized_return_type.hpp>
#include <boost/preprocessor/facilities/intercept.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
// Expands to the result metafunction for the specified no-spec function.
#define BOOST_PARAMETER_NO_SPEC_FUNCTION_HEAD(result, name, is_const) \
template < \
BOOST_PP_ENUM_BINARY_PARAMS( \
BOOST_PARAMETER_COMPOSE_MAX_ARITY \
, typename TaggedArg \
, = ::boost::parameter::void_ BOOST_PP_INTERCEPT \
) \
> \
struct BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME(name, is_const) \
: BOOST_PARAMETER_PARENTHESIZED_RETURN_TYPE(result) \
{ \
};
/**/
#include <boost/parameter/compose.hpp>
#include <boost/parameter/aux_/preprocessor/impl/parenthesized_type.hpp>
#include <boost/preprocessor/comparison/equal.hpp>
#include <boost/preprocessor/control/expr_if.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/tuple/elem.hpp>
#if defined(BOOST_NO_SFINAE)
// Exapnds to a tagged-argument constructor overload that passes the argument
// pack to the base class delegate constructor.
#define BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR_OVERLOAD_Z(z, n, data) \
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename TaggedArg)> \
BOOST_PP_EXPR_IF(BOOST_PP_EQUAL(n, 1), explicit) inline \
BOOST_PP_TUPLE_ELEM(2, 0, data)( \
BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, TaggedArg, const& arg) \
) : BOOST_PARAMETER_PARENTHESIZED_TYPE(BOOST_PP_TUPLE_ELEM(2, 1, data))( \
::boost::parameter::compose(BOOST_PP_ENUM_PARAMS_Z(z, n, arg)) \
) \
{ \
}
/**/
// Exapnds to a tagged-argument constructor overload that passes the argument
// pack to the delegate function.
#define BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR_OVERLOAD_Z(z, n, data) \
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename TaggedArg)> \
BOOST_PP_EXPR_IF(BOOST_PP_EQUAL(n, 1), explicit) inline \
BOOST_PP_TUPLE_ELEM(2, 0, data)( \
BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, TaggedArg, const& a) \
) \
{ \
BOOST_PP_TUPLE_ELEM(2, 1, data)( \
::boost::parameter::compose(BOOST_PP_ENUM_PARAMS_Z(z, n, a)) \
); \
}
/**/
#include <boost/parameter/aux_/preprocessor/nullptr.hpp>
// Exapnds to a tagged-argument function overload.
#define BOOST_PARAMETER_NO_SPEC_FUNCTION_OVERLOAD_Z(z, n, data) \
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename TaggedArg)> \
BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(BOOST_PP_TUPLE_ELEM(4, 1, data)) \
inline typename BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, data) \
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
)<BOOST_PP_ENUM_PARAMS_Z(z, n, TaggedArg)>::type \
BOOST_PARAMETER_MEMBER_FUNCTION_NAME( \
BOOST_PP_TUPLE_ELEM(4, 0, data) \
)(BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, TaggedArg, const& arg)) \
BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 3, data), const) \
{ \
return BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 2, data), this->) \
BOOST_PARAMETER_NO_SPEC_FUNCTION_IMPL_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, data) \
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
)( \
static_cast< \
typename BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, data) \
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
)<BOOST_PP_ENUM_PARAMS_Z(z, n, TaggedArg)>::type(*)() \
>(BOOST_PARAMETER_AUX_PP_NULLPTR) \
, ::boost::parameter::compose(BOOST_PP_ENUM_PARAMS_Z(z, n, arg)) \
); \
}
/**/
#else // !defined(BOOST_NO_SFINAE)
#include <boost/parameter/are_tagged_arguments.hpp>
#include <boost/parameter/aux_/preprocessor/nullptr.hpp>
#include <boost/core/enable_if.hpp>
// Exapnds to a tagged-argument constructor overload that passes the argument
// pack to the base class delegate constructor. This constructor is enabled
// if and only if all its arguments are tagged arguments.
#define BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR_OVERLOAD_Z(z, n, data) \
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename TaggedArg)> \
BOOST_PP_EXPR_IF(BOOST_PP_EQUAL(n, 1), explicit) inline \
BOOST_PP_TUPLE_ELEM(2, 0, data)( \
BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, TaggedArg, const& arg) \
, typename ::boost::enable_if< \
::boost::parameter::are_tagged_arguments< \
BOOST_PP_ENUM_PARAMS_Z(z, n, TaggedArg) \
> \
>::type* = BOOST_PARAMETER_AUX_PP_NULLPTR \
) : BOOST_PARAMETER_PARENTHESIZED_TYPE(BOOST_PP_TUPLE_ELEM(2, 1, data))( \
::boost::parameter::compose(BOOST_PP_ENUM_PARAMS_Z(z, n, arg)) \
) \
{ \
}
/**/
// Exapnds to a tagged-argument constructor overload that passes the argument
// pack to the delegate function. This constructor is enabled if and only if
// all its arguments are tagged arguments.
#define BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR_OVERLOAD_Z(z, n, data) \
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename TaggedArg)> \
BOOST_PP_EXPR_IF(BOOST_PP_EQUAL(n, 1), explicit) inline \
BOOST_PP_TUPLE_ELEM(2, 0, data)( \
BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, TaggedArg, const& a) \
, typename ::boost::enable_if< \
::boost::parameter::are_tagged_arguments< \
BOOST_PP_ENUM_PARAMS_Z(z, n, TaggedArg) \
> \
>::type* = BOOST_PARAMETER_AUX_PP_NULLPTR \
) \
{ \
BOOST_PP_TUPLE_ELEM(2, 1, data)( \
::boost::parameter::compose(BOOST_PP_ENUM_PARAMS_Z(z, n, a)) \
); \
}
/**/
// Exapnds to a function overload that is enabled if and only if
// all its arguments are tagged arguments.
#define BOOST_PARAMETER_NO_SPEC_FUNCTION_OVERLOAD_Z(z, n, data) \
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename TaggedArg)> \
BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(BOOST_PP_TUPLE_ELEM(4, 1, data)) \
inline typename ::boost::lazy_enable_if< \
::boost::parameter \
::are_tagged_arguments<BOOST_PP_ENUM_PARAMS_Z(z, n, TaggedArg)> \
, BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, data) \
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
)<BOOST_PP_ENUM_PARAMS_Z(z, n, TaggedArg)> \
>::type BOOST_PARAMETER_MEMBER_FUNCTION_NAME( \
BOOST_PP_TUPLE_ELEM(4, 0, data) \
)(BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, TaggedArg, const& arg)) \
BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 3, data), const) \
{ \
return BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 2, data), this->) \
BOOST_PARAMETER_NO_SPEC_FUNCTION_IMPL_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, data) \
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
)( \
static_cast< \
typename BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME( \
BOOST_PP_TUPLE_ELEM(4, 1, data) \
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
)<BOOST_PP_ENUM_PARAMS_Z(z, n, TaggedArg)>::type(*)() \
>(BOOST_PARAMETER_AUX_PP_NULLPTR) \
, ::boost::parameter::compose(BOOST_PP_ENUM_PARAMS_Z(z, n, arg)) \
); \
}
/**/
#endif // BOOST_NO_SFINAE
#include <boost/preprocessor/arithmetic/inc.hpp>
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
// Emulates a variadic constructor that is enabled if and only if all its
// arguments are tagged arguments. The enclosing class must inherit from the
// specified base class, which in turn must implement a constructor that takes
// in the argument pack that this one passes on.
#define BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR(class_, base) \
BOOST_PP_REPEAT_FROM_TO( \
1 \
, BOOST_PP_INC(BOOST_PARAMETER_COMPOSE_MAX_ARITY) \
, BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR_OVERLOAD_Z \
, (class_, base) \
)
/**/
// Emulates a variadic constructor that is enabled if and only if all its
// arguments are tagged arguments. The specified function must be able to
// take in the argument pack that this constructor passes on.
#define BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR(class_, func) \
BOOST_PP_REPEAT_FROM_TO( \
1 \
, BOOST_PP_INC(BOOST_PARAMETER_COMPOSE_MAX_ARITY) \
, BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR_OVERLOAD_Z \
, (class_, func) \
)
/**/
// Emulates a variadic function that is enabled if and only if
// all its arguments are tagged arguments.
#define BOOST_PARAMETER_NO_SPEC_FUNCTION_OVERLOAD(name, impl, is_m, c) \
BOOST_PP_REPEAT_FROM_TO( \
1 \
, BOOST_PP_INC(BOOST_PARAMETER_COMPOSE_MAX_ARITY) \
, BOOST_PARAMETER_NO_SPEC_FUNCTION_OVERLOAD_Z \
, (name, impl, is_m, c) \
)
/**/
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
#endif // include guard

View File

@@ -0,0 +1,122 @@
// Copyright Cromwell D. Enage 2019.
// 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)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_PARENTHESIZED_RETURN_TYPE_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_PARENTHESIZED_RETURN_TYPE_HPP
namespace boost { namespace parameter { namespace aux {
// A metafunction that transforms void(*)(T) -> identity<T>
template <typename UnaryFunctionPointer>
struct unaryfunptr_return_type;
}}} // namespace boost::parameter::aux
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/utility.hpp>
#else
#include <boost/mpl/identity.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
template <typename Arg>
struct unaryfunptr_return_type<void(*)(Arg)>
{
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using type = ::boost::mp11::mp_identity<Arg>;
#else
typedef ::boost::mpl::identity<Arg> type;
#endif
};
template <>
struct unaryfunptr_return_type<void(*)(void)>
{
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using type = ::boost::mp11::mp_identity<void>;
#else
typedef ::boost::mpl::identity<void> type;
#endif
};
}}} // namespace boost::parameter::aux
#if !defined(BOOST_NO_SFINAE)
#include <boost/core/enable_if.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename Pred, typename Ret>
struct unaryfunptr_return_type<void(*)(::boost::enable_if<Pred,Ret>)>
{
typedef ::boost::enable_if<Pred,Ret> type;
};
template <bool b, typename Ret>
struct unaryfunptr_return_type<void(*)(::boost::enable_if_c<b,Ret>)>
{
typedef ::boost::enable_if_c<b,Ret> type;
};
template <typename Pred, typename Ret>
struct unaryfunptr_return_type<void(*)(::boost::lazy_enable_if<Pred,Ret>)>
{
typedef ::boost::lazy_enable_if<Pred,Ret> type;
};
template <bool b, typename Ret>
struct unaryfunptr_return_type<void(*)(::boost::lazy_enable_if_c<b,Ret>)>
{
typedef ::boost::lazy_enable_if_c<b,Ret> type;
};
template <typename Pred, typename Ret>
struct unaryfunptr_return_type<void(*)(::boost::disable_if<Pred,Ret>)>
{
typedef ::boost::disable_if<Pred,Ret> type;
};
template <bool b, typename Ret>
struct unaryfunptr_return_type<void(*)(::boost::disable_if_c<b,Ret>)>
{
typedef ::boost::disable_if_c<b,Ret> type;
};
template <typename B, typename Ret>
struct unaryfunptr_return_type<void(*)(::boost::lazy_disable_if<B,Ret>)>
{
typedef ::boost::lazy_disable_if<B,Ret> type;
};
template <bool b, typename Ret>
struct unaryfunptr_return_type<void(*)(::boost::lazy_disable_if_c<b,Ret>)>
{
typedef ::boost::lazy_disable_if_c<b,Ret> type;
};
}}} // namespace boost::parameter::aux
#if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
#include <type_traits>
namespace boost { namespace parameter { namespace aux {
template <bool b, typename Ret>
struct unaryfunptr_return_type<void(*)(::std::enable_if<b,Ret>)>
{
typedef ::std::enable_if<b,Ret> type;
};
}}} // namespace boost::parameter::aux
#endif // BOOST_NO_CXX11_HDR_TYPE_TRAITS
#endif // BOOST_NO_SFINAE
// A macro that takes a parenthesized C++ type name (T) and transforms it
// into an un-parenthesized type expression equivalent to identity<T>.
#define BOOST_PARAMETER_PARENTHESIZED_RETURN_TYPE(x) \
::boost::parameter::aux::unaryfunptr_return_type< void(*)x >::type
#endif // include guard

View File

@@ -0,0 +1,34 @@
// Copyright David Abrahams 2006.
// 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)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_PARENTHESIZED_TYPE_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_PARENTHESIZED_TYPE_HPP
namespace boost { namespace parameter { namespace aux {
// A metafunction that transforms void(*)(T) -> T
template <typename UnaryFunctionPointer>
struct unaryfunptr_arg_type;
template <typename Arg>
struct unaryfunptr_arg_type<void(*)(Arg)>
{
typedef Arg type;
};
template <>
struct unaryfunptr_arg_type<void(*)(void)>
{
typedef void type;
};
}}} // namespace boost::parameter::aux
// A macro that takes a parenthesized C++ type name (T) and transforms it
// into an un-parenthesized type expression equivalent to T.
#define BOOST_PARAMETER_PARENTHESIZED_TYPE(x) \
::boost::parameter::aux::unaryfunptr_arg_type< void(*)x >::type
#endif // include guard

View File

@@ -0,0 +1,109 @@
// Copyright Daniel Wallin 2006.
// 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)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_SPECIFICATION_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_SPECIFICATION_HPP
#include <boost/parameter/optional.hpp>
// Helper macros for BOOST_PARAMETER_SPECIFICATION_ELEM_R.
#define BOOST_PARAMETER_QUALIFIED_TAG_optional(tag) \
optional<tag
/**/
#include <boost/parameter/required.hpp>
#define BOOST_PARAMETER_QUALIFIED_TAG_required(tag) \
required<tag
/**/
#include <boost/parameter/deduced.hpp>
#define BOOST_PARAMETER_QUALIFIED_TAG_deduced_optional(tag) \
optional< ::boost::parameter::deduced<tag>
/**/
#define BOOST_PARAMETER_QUALIFIED_TAG_deduced_required(tag) \
required< ::boost::parameter::deduced<tag>
/**/
#include <boost/parameter/aux_/preprocessor/impl/argument_specs.hpp>
#include <boost/parameter/config.hpp>
#include <boost/preprocessor/punctuation/comma_if.hpp>
#include <boost/preprocessor/cat.hpp>
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
#include <boost/parameter/aux_/use_default.hpp>
#define BOOST_PARAMETER_SPECIFICATION_ELEM_R(r, tag_namespace, i, elem) \
BOOST_PP_COMMA_IF(i) ::boost::parameter::BOOST_PP_CAT( \
BOOST_PARAMETER_QUALIFIED_TAG_ \
, BOOST_PARAMETER_FN_ARG_QUALIFIER(elem) \
)(tag_namespace::BOOST_PARAMETER_FN_ARG_NAME(elem)) \
, ::boost::parameter::aux::use_default \
>
/**/
#else // !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
#include <boost/parameter/aux_/pp_impl/unwrap_predicate.hpp>
// Expands to each boost::parameter::parameters<> element type.
#define BOOST_PARAMETER_SPECIFICATION_ELEM_R(r, tag_namespace, i, elem) \
BOOST_PP_COMMA_IF(i) ::boost::parameter::BOOST_PP_CAT( \
BOOST_PARAMETER_QUALIFIED_TAG_ \
, BOOST_PARAMETER_FN_ARG_QUALIFIER(elem) \
)(tag_namespace::BOOST_PARAMETER_FN_ARG_NAME(elem)) \
, typename ::boost::parameter::aux::unwrap_predicate< \
void BOOST_PARAMETER_FN_ARG_PRED(elem) \
>::type \
>
/**/
#endif // Borland workarounds needed.
#include <boost/parameter/parameters.hpp>
#include <boost/parameter/aux_/preprocessor/impl/function_name.hpp>
#include <boost/preprocessor/control/if.hpp>
#include <boost/preprocessor/seq/for_each_i.hpp>
// Expands to a boost::parameter::parameters<> specialization for the
// function named base. Used by BOOST_PARAMETER_CONSTRUCTOR_AUX and
// BOOST_PARAMETER_FUNCTION_HEAD for their respective ParameterSpec models.
#define BOOST_PARAMETER_SPECIFICATION(tag_ns, base, split_args, is_const) \
template <typename BoostParameterDummy> \
struct BOOST_PP_CAT( \
BOOST_PP_CAT( \
BOOST_PP_IF( \
is_const \
, boost_param_params_const_ \
, boost_param_params_ \
) \
, __LINE__ \
) \
, BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base) \
) : ::boost::parameter::parameters< \
BOOST_PP_SEQ_FOR_EACH_I( \
BOOST_PARAMETER_SPECIFICATION_ELEM_R, tag_ns, split_args \
) \
> \
{ \
}; \
typedef BOOST_PP_CAT( \
BOOST_PP_CAT( \
BOOST_PP_IF( \
is_const \
, boost_param_params_const_ \
, boost_param_params_ \
) \
, __LINE__ \
) \
, BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base) \
)<int>
/**/
#endif // include guard

View File

@@ -0,0 +1,71 @@
// Copyright Daniel Wallin 2006.
// 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)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_SPLIT_ARGS_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_SPLIT_ARGS_HPP
#include <boost/preprocessor/tuple/elem.hpp>
// Accessor macros for the split_args tuple.
#define BOOST_PARAMETER_SPLIT_ARG_REQ_COUNT(x) BOOST_PP_TUPLE_ELEM(4, 0, x)
#define BOOST_PARAMETER_SPLIT_ARG_REQ_SEQ(x) BOOST_PP_TUPLE_ELEM(4, 1, x)
#define BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT(x) BOOST_PP_TUPLE_ELEM(4, 2, x)
#define BOOST_PARAMETER_SPLIT_ARG_OPT_SEQ(x) BOOST_PP_TUPLE_ELEM(4, 3, x)
#include <boost/preprocessor/arithmetic/inc.hpp>
#include <boost/preprocessor/seq/push_back.hpp>
// Helper macros for BOOST_PARAMETER_FUNCTION_SPLIT_ARGS.
#define BOOST_PARAMETER_FUNCTION_SPLIT_ARG_required(s_a, arg) \
( \
BOOST_PP_INC(BOOST_PARAMETER_SPLIT_ARG_REQ_COUNT(s_a)) \
, BOOST_PP_SEQ_PUSH_BACK(BOOST_PARAMETER_SPLIT_ARG_REQ_SEQ(s_a), arg) \
, BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT(s_a) \
, BOOST_PARAMETER_SPLIT_ARG_OPT_SEQ(s_a) \
)
/**/
#define BOOST_PARAMETER_FUNCTION_SPLIT_ARG_deduced_required(split_args, arg) \
BOOST_PARAMETER_FUNCTION_SPLIT_ARG_required(split_args, arg)
/**/
#define BOOST_PARAMETER_FUNCTION_SPLIT_ARG_optional(s_a, arg) \
( \
BOOST_PARAMETER_SPLIT_ARG_REQ_COUNT(s_a) \
, BOOST_PARAMETER_SPLIT_ARG_REQ_SEQ(s_a) \
, BOOST_PP_INC(BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT(s_a)) \
, BOOST_PP_SEQ_PUSH_BACK(BOOST_PARAMETER_SPLIT_ARG_OPT_SEQ(s_a), arg) \
)
/**/
#define BOOST_PARAMETER_FUNCTION_SPLIT_ARG_deduced_optional(split_args, arg) \
BOOST_PARAMETER_FUNCTION_SPLIT_ARG_optional(split_args, arg)
/**/
#include <boost/parameter/aux_/preprocessor/impl/argument_specs.hpp>
#include <boost/preprocessor/cat.hpp>
#define BOOST_PARAMETER_FUNCTION_SPLIT_ARG(s, split_args, arg) \
BOOST_PP_CAT( \
BOOST_PARAMETER_FUNCTION_SPLIT_ARG_ \
, BOOST_PARAMETER_FN_ARG_QUALIFIER(arg) \
)(split_args, arg)
/**/
#include <boost/preprocessor/seq/fold_left.hpp>
#include <boost/preprocessor/seq/seq.hpp>
// Expands from the flattened BOOST_PARAMETER_FUNCTION et. al. arg sequence to
// the tuple (required_count, required_args, optional_count, optional_args).
#define BOOST_PARAMETER_FUNCTION_SPLIT_ARGS(args) \
BOOST_PP_SEQ_FOLD_LEFT( \
BOOST_PARAMETER_FUNCTION_SPLIT_ARG \
, (0, BOOST_PP_SEQ_NIL, 0, BOOST_PP_SEQ_NIL) \
, args \
)
/**/
#endif // include guard

View File

@@ -0,0 +1,78 @@
// Copyright Cromwell D. Enage 2013.
// 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)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_INC_BINARY_SEQ_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_INC_BINARY_SEQ_HPP
#include <boost/preprocessor/seq/push_back.hpp>
// This macro keeps the rest of the sequence if carry == 0.
#define BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_0(seq, element) \
(BOOST_PP_SEQ_PUSH_BACK(seq, element), 0)
/**/
#include <boost/preprocessor/control/iif.hpp>
// This macro updates the rest of the sequence if carry == 1.
#define BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_1(seq, element) \
(BOOST_PP_SEQ_PUSH_BACK(seq, BOOST_PP_IIF(element, 0, 1)), element)
/**/
#include <boost/preprocessor/tuple/elem.hpp>
#include <boost/preprocessor/cat.hpp>
// This macro maintains a tuple (seq, carry), where seq is the intermediate
// result and carry is a flag that will unset upon finding an element == 0.
#define BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_OP(s, result_tuple, element) \
BOOST_PP_CAT( \
BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_ \
, BOOST_PP_TUPLE_ELEM(2, 1, result_tuple) \
)(BOOST_PP_TUPLE_ELEM(2, 0, result_tuple), element)
/**/
// This macro keeps the sequence at its original length if carry == 0.
#define BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_IMPL_0(seq) seq
/**/
// This macro appends a zero to seq if carry == 1.
#define BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_IMPL_1(seq) \
BOOST_PP_SEQ_PUSH_BACK(seq, 0)
/**/
// This macro takes in the tuple (seq, carry), with carry indicating whether
// or not seq originally contained all 1s. If so, then seq now contains all
// 0s, and this macro pushes an extra 0 before expanding to the new sequence.
// Otherwise, this macro expands to seq as is.
#define BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_IMPL(seq_and_carry) \
BOOST_PP_CAT( \
BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_IMPL_ \
, BOOST_PP_TUPLE_ELEM(2, 1, seq_and_carry) \
)(BOOST_PP_TUPLE_ELEM(2, 0, seq_and_carry))
/**/
#include <boost/preprocessor/seq/seq.hpp>
#include <boost/preprocessor/seq/fold_left.hpp>
// This macro treats the specified sequence of 1s and 0s like a binary number
// in reverse and expands to a sequence representing the next value up.
// However, if the input sequence contains all 1s, then the output sequence
// will contain one more element but all 0s.
//
// Examples:
// seq = (1)(0)(1)(0) --> return (0)(1)(1)(0)
// seq = (1)(1)(1)(0) --> return (0)(0)(0)(1)
// seq = (1)(1)(1)(1) --> return (0)(0)(0)(0)(0)
#define BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ(seq) \
BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_IMPL( \
BOOST_PP_SEQ_FOLD_LEFT( \
BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_OP \
, (BOOST_PP_SEQ_NIL, 1) \
, seq \
) \
)
/**/
#endif // include guard

View File

@@ -0,0 +1,31 @@
// Copyright Daniel Wallin 2006.
// 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)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IS_BINARY_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IS_BINARY_HPP
#include <boost/config.hpp>
#include <boost/config/workaround.hpp>
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
// From Paul Mensonides
#include <boost/preprocessor/punctuation/comma.hpp>
#include <boost/preprocessor/detail/split.hpp>
#define BOOST_PARAMETER_IS_BINARY(x) \
BOOST_PP_SPLIT(1, BOOST_PARAMETER_IS_BINARY_C x BOOST_PP_COMMA() 0)
/**/
#include <boost/preprocessor/punctuation/paren.hpp>
#include <boost/preprocessor/tuple/eat.hpp>
#define BOOST_PARAMETER_IS_BINARY_C(x,y) \
~, 1 BOOST_PP_RPAREN() \
BOOST_PP_TUPLE_EAT(2) BOOST_PP_LPAREN() ~
/**/
#else
#include <boost/preprocessor/detail/is_binary.hpp>
#define BOOST_PARAMETER_IS_BINARY(x) BOOST_PP_IS_BINARY(x)
#endif
#endif // include guard

View File

@@ -0,0 +1,32 @@
// Copyright Daniel Wallin 2006.
// 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)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IS_NULLARY_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IS_NULLARY_HPP
#include <boost/config.hpp>
#include <boost/config/workaround.hpp>
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
// From Paul Mensonides
#include <boost/preprocessor/punctuation/comma.hpp>
#include <boost/preprocessor/detail/split.hpp>
#define BOOST_PARAMETER_IS_NULLARY(x) \
BOOST_PP_SPLIT(1, BOOST_PARAMETER_IS_NULLARY_C x BOOST_PP_COMMA() 0)
/**/
#include <boost/preprocessor/punctuation/paren.hpp>
#include <boost/preprocessor/tuple/eat.hpp>
#define BOOST_PARAMETER_IS_NULLARY_C() \
~, 1 BOOST_PP_RPAREN() \
BOOST_PP_TUPLE_EAT(2) BOOST_PP_LPAREN() ~
/**/
#else
#include <boost/preprocessor/detail/is_nullary.hpp>
#define BOOST_PARAMETER_IS_NULLARY(x) BOOST_PP_IS_NULLARY(x)
/**/
#endif
#endif // include guard

View File

@@ -0,0 +1,165 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// Copyright Cromwell D. Enage 2017.
// 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)
// No include guard. This file is intended for multiple inclusion.
#define BOOST_PARAMETER_right_angle(z, n, _) >
/**/
#define BOOST_PARAMETER_satisfies_end(z, n, false_t) ,false_t>
/**/
#include <boost/preprocessor/seq/elem.hpp>
#include <boost/preprocessor/cat.hpp>
// Generates:
//
// make<
// parameter_spec##0, argument_type##0
// , make<
// parameter_spec##1, argument_type##1
// , ... boost::mpl::identity<boost::parameter::aux::empty_arg_list>
// ...>
// >
#define BOOST_PARAMETER_make_arg_list(z, n, names) \
BOOST_PP_SEQ_ELEM(0, names)< \
BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(1, names), n), \
BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(2, names), n),
/**/
#include <boost/parameter/aux_/void.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/preprocessor/repetition/repeat.hpp>
#define BOOST_PARAMETER_build_arg_list(n, make, param_spec, arg_type) \
BOOST_PP_REPEAT( \
n, BOOST_PARAMETER_make_arg_list, (make)(param_spec)(arg_type) \
) \
::boost::mpl::identity< ::boost::parameter::void_> \
BOOST_PP_REPEAT(n, BOOST_PARAMETER_right_angle, _)
/**/
#define BOOST_PARAMETER_make_deduced_list(z, n, names) \
BOOST_PP_SEQ_ELEM(0, names)<BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(1, names), n),
/**/
#define BOOST_PARAMETER_build_deduced_list(n, make, parameter_spec) \
BOOST_PP_REPEAT( \
n, BOOST_PARAMETER_make_deduced_list, (make)(parameter_spec) \
) \
::boost::mpl::identity< ::boost::parameter::void_> \
BOOST_PP_REPEAT(n, BOOST_PARAMETER_right_angle, _)
/**/
#define BOOST_PARAMETER_forward_typedef(z, n, names) \
typedef BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(0, names), n) \
BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(1, names), n);
/**/
#define BOOST_PARAMETER_template_args(z, n, prefix) \
typename BOOST_PP_CAT(prefix, n) = ::boost::parameter::void_
/**/
#include <boost/mpl/pair.hpp>
#if (0 < BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY)
#include <boost/parameter/aux_/pack/item.hpp>
#include <boost/preprocessor/control/iif.hpp>
#define BOOST_PARAMETER_make_arg_items_R(r, prefix, i, elem) \
::boost::parameter::aux::item<BOOST_PP_CAT(prefix, i), \
BOOST_PP_CAT(A, i) BOOST_PP_IIF(elem, &, const&),
/**/
#include <boost/parameter/aux_/pack/make_arg_list.hpp>
#include <boost/parameter/aux_/pack/tag_keyword_arg.hpp>
#include <boost/preprocessor/seq/for_each_i.hpp>
#include <boost/preprocessor/seq/size.hpp>
#define BOOST_PARAMETER_function_call_arg_list_R(r, seq) \
::boost::parameter::aux::make_arg_list< \
BOOST_PP_SEQ_FOR_EACH_I_R( \
r, BOOST_PARAMETER_make_arg_items_R, PS, seq \
) \
::boost::parameter::void_ \
BOOST_PP_REPEAT( \
BOOST_PP_SEQ_SIZE(seq), BOOST_PARAMETER_right_angle, _ \
) \
, deduced_list \
, ::boost::parameter::aux::tag_keyword_arg \
>
/**/
#include <boost/preprocessor/arithmetic/sub.hpp>
#define BOOST_PARAMETER_function_call_arg_pack_init(z, n, limit) \
BOOST_PP_CAT(a, BOOST_PP_SUB(limit, n))
/**/
#include <boost/parameter/aux_/preprocessor/binary_seq_to_args.hpp>
#include <boost/preprocessor/arithmetic/dec.hpp>
#include <boost/preprocessor/facilities/intercept.hpp>
#include <boost/preprocessor/repetition/enum.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
#include <boost/preprocessor/seq/seq.hpp>
#define BOOST_PARAMETER_function_call_op_overload_R(r, seq) \
template < \
BOOST_PP_ENUM_PARAMS( \
BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq)) \
, typename A \
) \
> \
inline typename ::boost::mpl::first< \
typename BOOST_PARAMETER_function_call_arg_list_R( \
r, BOOST_PP_SEQ_TAIL(seq) \
)::type \
>::type \
operator()( \
BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARGS( \
BOOST_PP_SEQ_TAIL(seq), (A)(a) \
) \
) const \
{ \
typedef typename BOOST_PARAMETER_function_call_arg_list_R( \
r, BOOST_PP_SEQ_TAIL(seq) \
)::type result; \
typedef typename ::boost::mpl::first<result>::type result_type; \
typedef typename ::boost::mpl::second<result>::type error; \
error(); \
return result_type( \
BOOST_PP_ENUM( \
BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq)) \
, BOOST_PARAMETER_function_call_arg_pack_init \
, BOOST_PP_DEC(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq))) \
) \
BOOST_PP_ENUM_TRAILING_PARAMS( \
BOOST_PP_SUB( \
BOOST_PARAMETER_COMPOSE_MAX_ARITY \
, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq)) \
) \
, ::boost::parameter::aux::void_reference() BOOST_PP_INTERCEPT \
) \
); \
}
/**/
#endif // exponential overloads
#include <boost/parameter/aux_/pack/satisfies.hpp>
#include <boost/mpl/eval_if.hpp>
#define BOOST_PARAMETER_satisfies_begin(z, n, prefix) \
::boost::mpl::eval_if< \
::boost::parameter::aux::satisfies_requirements_of< \
typename ::boost::mpl::first<ArgumentPackAndError>::type \
, BOOST_PP_CAT(prefix, n) \
>,
/**/

View File

@@ -0,0 +1,24 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// Copyright Cromwell D. Enage 2017.
// 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)
// No include guard. This file is intended for multiple inclusion.
#undef BOOST_PARAMETER_satisfies_begin
#if (0 < BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY)
#undef BOOST_PARAMETER_function_call_op_overload_R
#undef BOOST_PARAMETER_function_call_arg_pack_init
#undef BOOST_PARAMETER_function_call_arg_list_R
#undef BOOST_PARAMETER_make_arg_items_R
#endif
#undef BOOST_PARAMETER_template_args
#undef BOOST_PARAMETER_forward_typedef
#undef BOOST_PARAMETER_build_deduced_list
#undef BOOST_PARAMETER_make_deduced_list
#undef BOOST_PARAMETER_build_arg_list
#undef BOOST_PARAMETER_make_arg_list
#undef BOOST_PARAMETER_satisfies_end
#undef BOOST_PARAMETER_right_angle

View File

@@ -0,0 +1,18 @@
// Copyright Cromwell D. Enage 2019.
// 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)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_NULLPTR_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_NULLPTR_HPP
#include <boost/config.hpp>
#if defined(BOOST_NO_CXX11_NULLPTR)
#define BOOST_PARAMETER_AUX_PP_NULLPTR 0
#else
#define BOOST_PARAMETER_AUX_PP_NULLPTR nullptr
#endif
#endif // include guard

View File

@@ -0,0 +1,92 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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)
// This file generates overloads in this format:
//
// template <typename A0, typename A1>
// typename ::boost::mpl::apply_wrap1<
// ::boost::parameter::aux::make_arg_list<
// PS0,A0
// , ::boost::parameter::aux::make_arg_list<
// PS1,A1
// , ::boost::mpl::identity<
// ::boost::parameter::aux::empty_arg_list
// >
// >
// >
// , unnamed_list
// >::type
// operator()(A0 const& a0, A1 const& a1) const
// {
// typedef typename ::boost::mpl::apply_wrap1<
// ::boost::parameter::aux::make_arg_list<
// PS0,A0
// , ::boost::parameter::aux::make_arg_list<
// PS1,A1
// , ::boost::mpl::identity<
// ::boost::parameter::aux::empty_arg_list
// >
// >
// >
// >::type arg_tuple;
//
// return arg_tuple(
// a0
// , a1
// , ::boost::parameter::aux::void_()
// ...
// );
// }
//
#if !defined(BOOST_PP_IS_ITERATING)
# error Boost.Parameters - do not include this file!
#endif
#define N BOOST_PP_ITERATION()
#define BOOST_PARAMETER_open_list(z, n, text) \
::boost::parameter::aux::item< \
BOOST_PP_CAT(PS, n), BOOST_PP_CAT(A, n)
#define BOOST_PARAMETER_close_list(z, n, text) >
#define BOOST_PARAMETER_arg_list(n) \
::boost::parameter::aux::make_arg_list< \
BOOST_PP_ENUM(N, BOOST_PARAMETER_open_list, _) \
, ::boost::parameter::void_ \
BOOST_PP_REPEAT(N, BOOST_PARAMETER_close_list, _) \
, deduced_list \
, ::boost::parameter::aux::tag_keyword_arg \
>
#define BOOST_PARAMETER_arg_pack_init(z, n, limit) \
BOOST_PP_CAT(a, BOOST_PP_SUB(limit, n))
template <BOOST_PP_ENUM_PARAMS(N, typename A)>
typename ::boost::mpl::first<
typename BOOST_PARAMETER_arg_list(N)::type
>::type
operator()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, & a)) const
{
typedef typename BOOST_PARAMETER_arg_list(N)::type result;
typedef typename ::boost::mpl::first<result>::type result_type;
typedef typename ::boost::mpl::second<result>::type error;
error();
return result_type(
BOOST_PP_ENUM(N, BOOST_PARAMETER_arg_pack_init, BOOST_PP_DEC(N))
BOOST_PP_ENUM_TRAILING_PARAMS(
BOOST_PP_SUB(BOOST_PARAMETER_COMPOSE_MAX_ARITY, N)
, ::boost::parameter::aux::void_reference() BOOST_PP_INTERCEPT
)
);
}
#undef BOOST_PARAMETER_arg_list
#undef BOOST_PARAMETER_close_list
#undef BOOST_PARAMETER_open_list
#undef N

View File

@@ -0,0 +1,88 @@
// Copyright Daniel Wallin 2006.
// Copyright Cromwell D. Enage 2017.
// 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)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_QUALIFIER_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_QUALIFIER_HPP
#define BOOST_PARAMETER_QUALIFIER_EAT_in(x)
#define BOOST_PARAMETER_QUALIFIER_EAT_out(x)
#define BOOST_PARAMETER_QUALIFIER_EAT_in_out(x)
#define BOOST_PARAMETER_QUALIFIER_EAT_consume(x)
#define BOOST_PARAMETER_QUALIFIER_EAT_move_from(x)
#define BOOST_PARAMETER_QUALIFIER_EAT_forward(x)
#define BOOST_PARAMETER_GET_QUALIFIER_in(x) in_reference
#define BOOST_PARAMETER_GET_QUALIFIER_out(x) out_reference
#define BOOST_PARAMETER_GET_QUALIFIER_in_out(x) in_out_reference
#define BOOST_PARAMETER_GET_QUALIFIER_consume(x) consume_reference
#define BOOST_PARAMETER_GET_QUALIFIER_move_from(x) move_from_reference
#define BOOST_PARAMETER_GET_QUALIFIER_forward(x) forward_reference
#define BOOST_PARAMETER_STRIP_QUALIFIER_in(x) x
#define BOOST_PARAMETER_STRIP_QUALIFIER_out(x) x
#define BOOST_PARAMETER_STRIP_QUALIFIER_in_out(x) x
#define BOOST_PARAMETER_STRIP_QUALIFIER_consume(x) x
#define BOOST_PARAMETER_STRIP_QUALIFIER_move_from(x) x
#define BOOST_PARAMETER_STRIP_QUALIFIER_forward(x) x
#include <boost/preprocessor/cat.hpp>
#define BOOST_PARAMETER_GET_QUALIFIER_GET(x) \
BOOST_PP_CAT(BOOST_PARAMETER_GET_QUALIFIER_, x)
/**/
#define BOOST_PARAMETER_GET_UNQUALIFIED(x) \
BOOST_PP_CAT(BOOST_PARAMETER_STRIP_QUALIFIER_, x)
/**/
#include <boost/preprocessor/facilities/is_empty.hpp>
// Expands to 1 if x is either "in(k)", "out(k)", "in_out(k)", "consume(k)",
// "move_from(k)", or "forward(k)"; expands to 0 otherwise.
#define BOOST_PARAMETER_IS_QUALIFIER(x) \
BOOST_PP_IS_EMPTY(BOOST_PP_CAT(BOOST_PARAMETER_QUALIFIER_EAT_, x))
/**/
#include <boost/preprocessor/control/iif.hpp>
// Expands to the qualifier of x,
// where x is either a keyword qualifier or a keyword.
//
// k => forward_reference
// in(k) => in_reference
// out(k) => out_reference
// in_out(k) => in_out_reference
// forward(k) => forward_reference
// consume(k) => consume_reference
// move_from(k) => move_from_reference
#define BOOST_PARAMETER_GET_QUALIFIER(x) \
BOOST_PP_IIF( \
BOOST_PARAMETER_IS_QUALIFIER(x) \
, BOOST_PARAMETER_GET_QUALIFIER_GET(x) \
, forward_reference \
)
/**/
// Expands to the unqualified version of x,
// where x is either a keyword qualifier or a keyword.
//
// k => k
// in(k) => k
// out(k) => k
// in_out(k) => k
// forward(k) => k
// consume(k) => k
// move_from(k) => k
#define BOOST_PARAMETER_UNQUALIFIED(x) \
BOOST_PP_IIF( \
BOOST_PARAMETER_IS_QUALIFIER(x) \
, BOOST_PARAMETER_GET_UNQUALIFIED(x) \
, x \
)
/**/
#endif // include guard

View File

@@ -0,0 +1,26 @@
// Copyright David Abrahams 2005.
// 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)
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_SEQ_ENUM_HPP
#define BOOST_PARAMETER_AUX_PREPROCESSOR_SEQ_ENUM_HPP
#include <boost/preprocessor/seq/enum.hpp>
#include <boost/config.hpp>
#include <boost/config/workaround.hpp>
#if BOOST_WORKAROUND(__MWERKS__, <= 0x3003)
#include <boost/preprocessor/seq/size.hpp>
// Temporary version of BOOST_PP_SEQ_ENUM
// until Paul M. integrates the workaround.
#define BOOST_PARAMETER_SEQ_ENUM_I(size, seq) \
BOOST_PP_CAT(BOOST_PP_SEQ_ENUM_, size) seq
#define BOOST_PARAMETER_SEQ_ENUM(seq) \
BOOST_PARAMETER_SEQ_ENUM_I(BOOST_PP_SEQ_SIZE(seq), seq)
#else
#define BOOST_PARAMETER_SEQ_ENUM(seq) BOOST_PP_SEQ_ENUM(seq)
#endif
#endif // include guard

File diff suppressed because it is too large Load Diff

71
include/boost/parameter/aux_/result_of0.hpp Executable file → Normal file
View File

@@ -1,36 +1,53 @@
// Copyright David Abrahams 2005. 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)
// Copyright David Abrahams 2005.
// 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)
#ifndef BOOST_PARAMETER_AUX_RESULT_OF0_DWA2005511_HPP
# define BOOST_PARAMETER_AUX_RESULT_OF0_DWA2005511_HPP
#define BOOST_PARAMETER_AUX_RESULT_OF0_DWA2005511_HPP
# include <boost/utility/result_of.hpp>
// A metafunction returning the result of invoking a nullary function
// object of the given type.
#ifndef BOOST_NO_RESULT_OF
# include <boost/utility/result_of.hpp>
namespace boost { namespace parameter { namespace aux {
template <class F>
struct result_of0 : result_of<F()>
{};
}}} // namespace boost::parameter::aux_
#include <boost/parameter/aux_/use_default_tag.hpp>
#include <boost/parameter/config.hpp>
#include <boost/utility/result_of.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/utility.hpp>
#include <type_traits>
#else
#include <boost/mpl/if.hpp>
#include <boost/type_traits/is_void.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
template <class F>
struct result_of0
{
typedef typename F::result_type type;
};
namespace boost { namespace parameter { namespace aux {
}}} // namespace boost::parameter::aux_
// A metafunction returning the result of invoking
// a nullary function object of the given type.
template <typename F>
class result_of0
{
#if defined(BOOST_NO_RESULT_OF)
typedef typename F::result_type result_of_F;
#else
typedef typename ::boost::result_of<F()>::type result_of_F;
#endif
#endif
public:
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using type = ::boost::mp11::mp_if<
::std::is_void<result_of_F>
#else
typedef typename ::boost::mpl::if_<
::boost::is_void<result_of_F>
#endif
, ::boost::parameter::aux::use_default_tag
, result_of_F
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
>;
#else
>::type type;
#endif
};
}}} // namespace boost::parameter::aux
#endif // include guard
#endif // BOOST_PARAMETER_AUX_RESULT_OF0_DWA2005511_HPP

View File

@@ -0,0 +1,118 @@
// Copyright Daniel Wallin 2006.
// 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)
#ifndef BOOST_PARAMETER_SET_060912_HPP
#define BOOST_PARAMETER_SET_060912_HPP
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/list.hpp>
namespace boost { namespace parameter { namespace aux {
typedef ::boost::mp11::mp_list<> set0;
}}} // namespace boost::parameter::aux
#include <boost/mp11/algorithm.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename S, typename K>
struct insert_
{
using type = ::boost::mp11::mp_insert_c<S,0,K>;
};
}}} // namespace boost::parameter::aux
#include <boost/mp11/integral.hpp>
#include <boost/mp11/utility.hpp>
#include <type_traits>
namespace boost { namespace parameter { namespace aux {
template <typename Set, typename K>
struct has_key_
{
using type = ::boost::mp11::mp_if<
::boost::mp11::mp_empty<Set>
, ::boost::mp11::mp_false
, ::std::is_same<
::boost::mp11::mp_find<Set,K>
, ::boost::mp11::mp_size<Set>
>
>;
};
}}} // namespace boost::parameter::aux
#elif BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
#include <boost/mpl/list.hpp>
namespace boost { namespace parameter { namespace aux {
typedef ::boost::mpl::list0<> set0;
}}} // namespace boost::parameter::aux
#include <boost/mpl/push_front.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename Set, typename K>
struct insert_ : ::boost::mpl::push_front<Set,K>
{
};
}}} // namespace boost::parameter::aux
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/end.hpp>
#include <boost/mpl/find.hpp>
#include <boost/type_traits/is_same.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename Set, typename K>
struct has_key_
{
typedef typename ::boost::mpl::find<Set,K>::type iter;
typedef typename ::boost::mpl::if_<
::boost::is_same<iter,typename ::boost::mpl::end<Set>::type>
, ::boost::mpl::false_
, ::boost::mpl::true_
>::type type;
};
}}} // namespace boost::parameter::aux
#else // !BOOST_PARAMETER_CAN_USE_MP11 && Borland workarounds not needed
#include <boost/mpl/set/set0.hpp>
namespace boost { namespace parameter { namespace aux {
typedef ::boost::mpl::set0<> set0;
}}} // namespace boost::parameter::aux
#include <boost/mpl/insert.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename Set, typename K>
struct insert_ : ::boost::mpl::insert<Set,K>
{
};
}}} // namespace boost::parameter::aux
#include <boost/mpl/has_key.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename Set, typename K>
struct has_key_ : ::boost::mpl::has_key<Set,K>
{
};
}}} // namespace boost::parameter::aux
#endif // BOOST_PARAMETER_CAN_USE_MP11 || Borland workarounds needed
#endif // include guard

182
include/boost/parameter/aux_/tag.hpp Executable file → Normal file
View File

@@ -1,38 +1,160 @@
// Copyright David Abrahams 2005. 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)
#ifndef BOOST_PARAMETER_AUX_TAG_DWA2005610_HPP
# define BOOST_PARAMETER_AUX_TAG_DWA2005610_HPP
// Copyright David Abrahams 2005.
// Copyright Cromwell D. Enage 2017.
// 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/parameter/aux_/unwrap_cv_reference.hpp>
# include <boost/parameter/aux_/tagged_argument.hpp>
#ifndef BOOST_PARAMETER_AUX_TAG_DWA2005610_HPP
#define BOOST_PARAMETER_AUX_TAG_DWA2005610_HPP
#include <boost/parameter/aux_/unwrap_cv_reference.hpp>
#include <boost/parameter/aux_/tagged_argument.hpp>
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11) && \
!BOOST_WORKAROUND(BOOST_MSVC, >= 1910)
// MSVC-14.1+ assigns rvalue references to tagged_argument instances
// instead of tagged_argument_rref instances with this code.
#include <boost/mp11/integral.hpp>
#include <boost/mp11/utility.hpp>
#include <type_traits>
namespace boost { namespace parameter { namespace aux {
template <class Keyword, class ActualArg
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
, class = typename is_cv_reference_wrapper<ActualArg>::type
#endif
>
struct tag
{
typedef tagged_argument<
Keyword
, typename unwrap_cv_reference<ActualArg>::type
> type;
};
template <typename Keyword, typename Arg>
struct tag_if_lvalue_reference
{
using type = ::boost::parameter::aux::tagged_argument_list_of_1<
::boost::parameter::aux::tagged_argument<
Keyword
, typename ::boost::parameter::aux
::unwrap_cv_reference<Arg>::type
>
>;
};
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
template <class Keyword, class ActualArg>
struct tag<Keyword,ActualArg,mpl::false_>
{
typedef tagged_argument<
Keyword
, ActualArg
> type;
};
#endif
template <typename Keyword, typename Arg>
struct tag_if_scalar
{
using type = ::boost::parameter::aux::tagged_argument_list_of_1<
::boost::parameter::aux
::tagged_argument<Keyword,typename ::std::add_const<Arg>::type>
>;
};
template <typename Keyword, typename Arg>
using tag_if_otherwise = ::boost::mp11::mp_if<
::std::is_scalar<typename ::std::remove_const<Arg>::type>
, ::boost::parameter::aux::tag_if_scalar<Keyword,Arg>
, ::boost::mp11::mp_identity<
::boost::parameter::aux::tagged_argument_list_of_1<
::boost::parameter::aux::tagged_argument_rref<Keyword,Arg>
>
>
>;
template <typename Keyword, typename Arg>
using tag = ::boost::mp11::mp_if<
::boost::mp11::mp_if<
::std::is_lvalue_reference<Arg>
, ::boost::mp11::mp_true
, ::boost::parameter::aux::is_cv_reference_wrapper<Arg>
>
, ::boost::parameter::aux::tag_if_lvalue_reference<Keyword,Arg>
, ::boost::parameter::aux::tag_if_otherwise<Keyword,Arg>
>;
}}} // namespace boost::parameter::aux_
#endif // BOOST_PARAMETER_AUX_TAG_DWA2005610_HPP
#elif defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/type_traits/add_const.hpp>
#include <boost/type_traits/is_scalar.hpp>
#include <boost/type_traits/is_lvalue_reference.hpp>
#include <boost/type_traits/remove_const.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename Keyword, typename ActualArg>
struct tag
{
typedef typename ::boost::parameter::aux
::unwrap_cv_reference<ActualArg>::type Arg;
typedef typename ::boost::add_const<Arg>::type ConstArg;
typedef typename ::boost::remove_const<Arg>::type MutArg;
typedef typename ::boost::mpl::eval_if<
typename ::boost::mpl::if_<
::boost::is_lvalue_reference<ActualArg>
, ::boost::mpl::true_
, ::boost::parameter::aux::is_cv_reference_wrapper<ActualArg>
>::type
, ::boost::mpl::identity<
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
::boost::parameter::aux::tagged_argument_list_of_1<
#endif
::boost::parameter::aux::tagged_argument<Keyword,Arg>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
>
#endif
>
, ::boost::mpl::if_<
::boost::is_scalar<MutArg>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
, ::boost::parameter::aux::tagged_argument_list_of_1<
::boost::parameter::aux::tagged_argument<Keyword,ConstArg>
>
, ::boost::parameter::aux::tagged_argument_list_of_1<
::boost::parameter::aux::tagged_argument_rref<Keyword,Arg>
>
#else
, ::boost::parameter::aux::tagged_argument<Keyword,ConstArg>
, ::boost::parameter::aux::tagged_argument_rref<Keyword,Arg>
#endif
>
>::type type;
};
}}} // namespace boost::parameter::aux_
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
namespace boost { namespace parameter { namespace aux {
template <
typename Keyword
, typename Arg
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
, typename = typename ::boost::parameter::aux
::is_cv_reference_wrapper<Arg>::type
#endif
>
struct tag
{
typedef ::boost::parameter::aux::tagged_argument<
Keyword
, typename ::boost::parameter::aux::unwrap_cv_reference<Arg>::type
> type;
};
}}} // namespace boost::parameter::aux_
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
#include <boost/mpl/bool.hpp>
#include <boost/type_traits/remove_reference.hpp>
namespace boost { namespace parameter { namespace aux {
template <typename Keyword, typename Arg>
struct tag<Keyword,Arg,::boost::mpl::false_>
{
typedef ::boost::parameter::aux::tagged_argument<
Keyword
, typename ::boost::remove_reference<Arg>::type
> type;
};
}}} // namespace boost::parameter::aux_
#endif // Borland workarounds needed.
#endif // MP11 or perfect forwarding support
#endif // include guard

947
include/boost/parameter/aux_/tagged_argument.hpp Executable file → Normal file
View File

@@ -1,60 +1,903 @@
// Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
// distribution is subject to the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// Copyright Daniel Wallin, David Abrahams 2005.
// Copyright Cromwell D. Enage 2017.
// 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)
#ifndef TAGGED_ARGUMENT_050328_HPP
#define TAGGED_ARGUMENT_050328_HPP
#include <boost/parameter/aux_/void.hpp>
#include <boost/parameter/aux_/arg_list.hpp>
#include <boost/detail/is_xxx.hpp>
#ifndef BOOST_PARAMETER_TAGGED_ARGUMENT_050328_HPP
#define BOOST_PARAMETER_TAGGED_ARGUMENT_050328_HPP
namespace boost { namespace parameter { namespace aux {
// Holds a reference to an argument of type Arg associated with
// keyword Keyword
template <class Keyword, class Arg>
struct tagged_argument
{
typedef Keyword key_type;
typedef Arg value_type;
typedef Arg& reference;
tagged_argument(reference x) : value(x) {}
// Comma operator to compose argument list without using parameters<>.
// Useful for argument lists with undetermined length.
template <class Keyword2, class Arg2>
arg_list<
tagged_argument<Keyword, Arg>
, arg_list<tagged_argument<Keyword2, Arg2> >
>
operator,(tagged_argument<Keyword2, Arg2> x) const
{
return arg_list<
tagged_argument<Keyword, Arg>
, arg_list<tagged_argument<Keyword2, Arg2> >
>(
*this
, arg_list<tagged_argument<Keyword2, Arg2> >(x, empty_arg_list())
);
}
reference value;
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1310))
// warning suppression
private:
void operator=(tagged_argument const&);
#endif
};
// Defines a metafunction, is_tagged_argument, that identifies
// tagged_argument specializations.
BOOST_DETAIL_IS_XXX_DEF(tagged_argument,tagged_argument,2)
struct error_const_lvalue_bound_to_out_parameter;
struct error_lvalue_bound_to_consume_parameter;
struct error_rvalue_bound_to_out_parameter;
}}} // namespace boost::parameter::aux
#endif // TAGGED_ARGUMENT_050328_HPP
#include <boost/parameter/keyword_fwd.hpp>
#include <boost/parameter/config.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/remove_const.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/integral.hpp>
#include <boost/mp11/utility.hpp>
#include <type_traits>
#endif
namespace boost { namespace parameter { namespace aux {
template <typename Keyword, typename Arg>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using tagged_argument_type = ::boost::mp11::mp_if<
::boost::mp11::mp_if<
::std::is_scalar<Arg>
, ::boost::mp11::mp_false
, ::std::is_same<
typename Keyword::qualifier
, ::boost::parameter::consume_reference
>
>
, ::boost::parameter::aux::error_lvalue_bound_to_consume_parameter
, ::boost::mp11::mp_if<
::std::is_const<Arg>
, ::boost::mp11::mp_if<
::std::is_same<
typename Keyword::qualifier
, ::boost::parameter::out_reference
>
, ::boost::parameter::aux
::error_const_lvalue_bound_to_out_parameter
, ::std::remove_const<Arg>
>
, ::boost::mp11::mp_identity<Arg>
>
>;
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
struct tagged_argument_type
: ::boost::mpl::eval_if<
::boost::is_same<
typename Keyword::qualifier
, ::boost::parameter::out_reference
>
, ::boost::parameter::aux::error_const_lvalue_bound_to_out_parameter
, ::boost::remove_const<Arg>
>
{
};
#endif // BOOST_PARAMETER_CAN_USE_MP11
}}} // namespace boost::parameter::aux
#include <boost/parameter/aux_/tagged_argument_fwd.hpp>
#include <boost/parameter/aux_/is_tagged_argument.hpp>
#include <boost/parameter/aux_/default.hpp>
#include <boost/parameter/aux_/void.hpp>
#include <boost/parameter/aux_/arg_list.hpp>
#include <boost/parameter/aux_/result_of0.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/mpl/apply_wrap.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/is_function.hpp>
#include <boost/type_traits/is_scalar.hpp>
#include <boost/type_traits/remove_reference.hpp>
#if defined(BOOST_NO_CXX11_HDR_FUNCTIONAL)
#include <boost/function.hpp>
#else
#include <functional>
#endif
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
#include <boost/core/enable_if.hpp>
#include <utility>
namespace boost { namespace parameter { namespace aux {
// Holds an lvalue reference to an argument of type Arg associated with
// keyword Keyword
template <typename Keyword, typename Arg>
class tagged_argument
: public ::boost::parameter::aux::tagged_argument_base
{
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using arg_type = typename ::boost::parameter::aux
::tagged_argument_type<Keyword,Arg>::type;
#else
typedef typename ::boost::mpl::eval_if<
typename ::boost::mpl::eval_if<
::boost::is_scalar<Arg>
, ::boost::mpl::false_
, ::boost::is_same<
typename Keyword::qualifier
, ::boost::parameter::consume_reference
>
>::type
, ::boost::parameter::aux::error_lvalue_bound_to_consume_parameter
, ::boost::mpl::eval_if<
::boost::is_const<Arg>
, ::boost::parameter::aux::tagged_argument_type<Keyword,Arg>
, ::boost::mpl::identity<Arg>
>
>::type arg_type;
#endif // BOOST_PARAMETER_CAN_USE_MP11
public:
typedef Keyword key_type;
// Wrap plain (non-UDT) function objects in either
// a boost::function or a std::function. -- Cromwell D. Enage
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using value_type = ::boost::mp11::mp_if<
::std::is_function<arg_type>
, ::std::function<arg_type>
, Arg
>;
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
typedef typename ::boost::mpl::if_<
::boost::is_function<arg_type>
#if defined(BOOST_NO_CXX11_HDR_FUNCTIONAL)
, ::boost::function<arg_type>
#else
, ::std::function<arg_type>
#endif
, Arg
>::type value_type;
#endif // BOOST_PARAMETER_CAN_USE_MP11
// If Arg is void_, then this type will evaluate to void_&. If the
// supplied argument is a plain function, then this type will evaluate
// to a reference-to-const function wrapper type. If the supplied
// argument is an lvalue, then Arg will be deduced to the lvalue
// reference. -- Cromwell D. Enage
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using reference = ::boost::mp11::mp_if<
::std::is_function<arg_type>
, value_type const&
, Arg&
>;
#else
typedef typename ::boost::mpl::if_<
::boost::is_function<arg_type>
, value_type const&
, Arg&
>::type reference;
#endif
private:
// Store plain functions by value, everything else by reference.
// -- Cromwell D. Enage
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
::boost::mp11::mp_if<
::std::is_function<arg_type>
, value_type
, reference
> value;
#else
typename ::boost::mpl::if_<
::boost::is_function<arg_type>
, value_type
, reference
>::type value;
#endif
public:
inline explicit BOOST_CONSTEXPR tagged_argument(reference x)
: value(x)
{
}
inline BOOST_CONSTEXPR tagged_argument(tagged_argument const& copy)
: value(copy.value)
{
}
// A metafunction class that, given a keyword and a default type,
// returns the appropriate result type for a keyword lookup given
// that default.
struct binding
{
template <typename KW, typename Default, typename Reference>
struct apply
: ::boost::mpl::eval_if<
::boost::is_same<KW,key_type>
, ::boost::mpl::if_<Reference,reference,value_type>
, ::boost::mpl::identity<Default>
>
{
};
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
template <typename KW, typename Default, typename Reference>
using fn = ::boost::mp11::mp_if<
::std::is_same<KW,key_type>
, ::boost::mp11::mp_if<Reference,reference,value_type>
, Default
>;
#endif
};
#if !defined(BOOST_PARAMETER_CAN_USE_MP11)
// Comma operator to compose argument list without using parameters<>.
// Useful for argument lists with undetermined length.
template <typename Keyword2, typename Arg2>
inline BOOST_CONSTEXPR ::boost::parameter::aux::arg_list<
::boost::parameter::aux::tagged_argument<Keyword,Arg>
, ::boost::parameter::aux::arg_list<
::boost::parameter::aux::tagged_argument<Keyword2,Arg2>
>
>
operator,(
::boost::parameter::aux
::tagged_argument<Keyword2,Arg2> const& x
) const
{
return ::boost::parameter::aux::arg_list<
::boost::parameter::aux::tagged_argument<Keyword,Arg>
, ::boost::parameter::aux::arg_list<
::boost::parameter::aux::tagged_argument<Keyword2,Arg2>
>
>(
*this
, ::boost::parameter::aux::arg_list<
::boost::parameter::aux::tagged_argument<Keyword2,Arg2>
>(x, ::boost::parameter::aux::empty_arg_list())
);
}
template <typename Keyword2, typename Arg2>
inline BOOST_CONSTEXPR ::boost::parameter::aux::arg_list<
::boost::parameter::aux::tagged_argument<Keyword,Arg>
, ::boost::parameter::aux::arg_list<
::boost::parameter::aux::tagged_argument_rref<Keyword2,Arg2>
>
>
operator,(
::boost::parameter::aux
::tagged_argument_rref<Keyword2,Arg2> const& x
) const
{
return ::boost::parameter::aux::arg_list<
::boost::parameter::aux::tagged_argument<Keyword,Arg>
, boost::parameter::aux::arg_list<
boost::parameter::aux::tagged_argument_rref<Keyword2,Arg2>
>
>(
*this
, ::boost::parameter::aux::arg_list<
::boost::parameter::aux
::tagged_argument_rref<Keyword2,Arg2>
>(x, ::boost::parameter::aux::empty_arg_list())
);
}
#endif // BOOST_PARAMETER_CAN_USE_MP11
// Accessor interface.
inline BOOST_CONSTEXPR reference get_value() const
{
return this->value;
}
inline BOOST_CONSTEXPR reference
operator[](::boost::parameter::keyword<Keyword> const&) const
{
return this->get_value();
}
template <typename Default>
inline BOOST_CONSTEXPR reference
operator[](
::boost::parameter::aux::default_<key_type,Default> const&
) const
{
return this->get_value();
}
template <typename Default>
inline BOOST_CONSTEXPR reference
operator[](
::boost::parameter::aux::default_r_<key_type,Default> const&
) const
{
return this->get_value();
}
template <typename F>
inline BOOST_CONSTEXPR reference
operator[](
::boost::parameter::aux::lazy_default<key_type,F> const&
) const
{
return this->get_value();
}
template <typename KW, typename Default>
inline BOOST_CONSTEXPR Default&
operator[](
::boost::parameter::aux::default_<KW,Default> const& x
) const
{
return x.value;
}
template <typename KW, typename Default>
inline BOOST_CONSTEXPR Default&&
operator[](
::boost::parameter::aux::default_r_<KW,Default> const& x
) const
{
return ::std::forward<Default>(x.value);
}
template <typename KW, typename F>
inline BOOST_CONSTEXPR
typename ::boost::parameter::aux::result_of0<F>::type
operator[](
::boost::parameter::aux::lazy_default<KW,F> const& x
) const
{
return x.compute_default();
}
template <typename ParameterRequirements>
static BOOST_CONSTEXPR typename ParameterRequirements::has_default
satisfies(ParameterRequirements*);
template <typename HasDefault, typename Predicate>
static BOOST_CONSTEXPR
typename ::boost::mpl::apply_wrap1<Predicate,value_type>::type
satisfies(
::boost::parameter::aux::parameter_requirements<
key_type
, Predicate
, HasDefault
>*
);
// MPL sequence support
// Convenience for users
typedef ::boost::parameter::aux::tagged_argument<Keyword,Arg> type;
// For the benefit of iterators
typedef ::boost::parameter::aux::empty_arg_list tail_type;
// For dispatching to sequence intrinsics
typedef ::boost::parameter::aux::arg_list_tag tag;
};
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
template <typename Keyword>
using tagged_argument_rref_key = ::boost::mp11::mp_if<
::std::is_same<
typename Keyword::qualifier
, ::boost::parameter::out_reference
>
, ::boost::parameter::aux::error_rvalue_bound_to_out_parameter
, ::boost::mp11::mp_identity<Keyword>
>;
#endif
// Holds an rvalue reference to an argument of type Arg associated with
// keyword Keyword
template <typename Keyword, typename Arg>
struct tagged_argument_rref
: ::boost::parameter::aux::tagged_argument_base
{
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using key_type = typename ::boost::parameter::aux
::tagged_argument_rref_key<Keyword>::type;
#else
typedef typename ::boost::mpl::eval_if<
::boost::is_same<
typename Keyword::qualifier
, ::boost::parameter::out_reference
>
, ::boost::parameter::aux::error_rvalue_bound_to_out_parameter
, ::boost::mpl::identity<Keyword>
>::type key_type;
#endif
typedef Arg value_type;
typedef Arg&& reference;
private:
reference value;
public:
inline explicit BOOST_CONSTEXPR tagged_argument_rref(reference x)
: value(::std::forward<Arg>(x))
{
}
inline BOOST_CONSTEXPR tagged_argument_rref(
tagged_argument_rref const& copy
) : value(::std::forward<Arg>(copy.value))
{
}
// A metafunction class that, given a keyword and a default type,
// returns the appropriate result type for a keyword lookup given
// that default.
struct binding
{
template <typename KW, typename Default, typename Reference>
struct apply
{
typedef typename ::boost::mpl::eval_if<
::boost::is_same<KW,key_type>
, ::boost::mpl::if_<Reference,reference,value_type>
, ::boost::mpl::identity<Default>
>::type type;
};
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
template <typename KW, typename Default, typename Reference>
using fn = ::boost::mp11::mp_if<
::std::is_same<KW,key_type>
, ::boost::mp11::mp_if<Reference,reference,value_type>
, Default
>;
#endif
};
#if !defined(BOOST_PARAMETER_CAN_USE_MP11)
// Comma operator to compose argument list without using parameters<>.
// Useful for argument lists with undetermined length.
template <typename Keyword2, typename Arg2>
inline BOOST_CONSTEXPR ::boost::parameter::aux::arg_list<
::boost::parameter::aux::tagged_argument_rref<Keyword,Arg>
, ::boost::parameter::aux::arg_list<
::boost::parameter::aux::tagged_argument<Keyword2,Arg2>
>
>
operator,(
::boost::parameter::aux
::tagged_argument<Keyword2,Arg2> const& x
) const
{
return boost::parameter::aux::arg_list<
::boost::parameter::aux::tagged_argument_rref<Keyword,Arg>
, ::boost::parameter::aux::arg_list<
::boost::parameter::aux::tagged_argument<Keyword2,Arg2>
>
>(
*this
, ::boost::parameter::aux::arg_list<
::boost::parameter::aux::tagged_argument<Keyword2,Arg2>
>(x, ::boost::parameter::aux::empty_arg_list())
);
}
template <typename Keyword2, typename Arg2>
inline BOOST_CONSTEXPR ::boost::parameter::aux::arg_list<
::boost::parameter::aux::tagged_argument_rref<Keyword,Arg>
, ::boost::parameter::aux::arg_list<
::boost::parameter::aux::tagged_argument_rref<Keyword2,Arg2>
>
>
operator,(
::boost::parameter::aux
::tagged_argument_rref<Keyword2,Arg2> const& x
) const
{
return ::boost::parameter::aux::arg_list<
::boost::parameter::aux::tagged_argument_rref<Keyword,Arg>
, ::boost::parameter::aux::arg_list<
::boost::parameter::aux
::tagged_argument_rref<Keyword2,Arg2>
>
>(
*this
, ::boost::parameter::aux::arg_list<
::boost::parameter::aux::tagged_argument_rref<
Keyword2
, Arg2
>
>(x, ::boost::parameter::aux::empty_arg_list())
);
}
#endif // BOOST_PARAMETER_CAN_USE_MP11
// Accessor interface.
inline BOOST_CONSTEXPR reference get_value() const
{
return ::std::forward<Arg>(this->value);
}
inline BOOST_CONSTEXPR reference
operator[](::boost::parameter::keyword<Keyword> const&) const
{
return this->get_value();
}
template <typename Default>
inline BOOST_CONSTEXPR reference
operator[](
::boost::parameter::aux::default_<key_type,Default> const&
) const
{
return this->get_value();
}
template <typename Default>
inline BOOST_CONSTEXPR reference
operator[](
::boost::parameter::aux::default_r_<key_type,Default> const&
) const
{
return this->get_value();
}
template <typename F>
inline BOOST_CONSTEXPR reference
operator[](
::boost::parameter::aux::lazy_default<key_type,F> const&
) const
{
return this->get_value();
}
template <typename KW, typename Default>
inline BOOST_CONSTEXPR Default&
operator[](
::boost::parameter::aux::default_<KW,Default> const& x
) const
{
return x.value;
}
template <typename KW, typename Default>
inline BOOST_CONSTEXPR Default&&
operator[](
::boost::parameter::aux::default_r_<KW,Default> const& x
) const
{
return ::std::forward<Default>(x.value);
}
template <typename KW, typename F>
inline BOOST_CONSTEXPR
typename ::boost::parameter::aux::result_of0<F>::type
operator[](
::boost::parameter::aux::lazy_default<KW,F> const& x
) const
{
return x.compute_default();
}
template <typename ParameterRequirements>
static BOOST_CONSTEXPR typename ParameterRequirements::has_default
satisfies(ParameterRequirements*);
template <typename HasDefault, typename Predicate>
static BOOST_CONSTEXPR
typename ::boost::mpl::apply_wrap1<Predicate,value_type>::type
satisfies(
::boost::parameter::aux::parameter_requirements<
key_type
, Predicate
, HasDefault
>*
);
// MPL sequence support
// Convenience for users
typedef ::boost::parameter::aux
::tagged_argument_rref<Keyword,Arg> type;
// For the benefit of iterators
typedef ::boost::parameter::aux::empty_arg_list tail_type;
// For dispatching to sequence intrinsics
typedef ::boost::parameter::aux::arg_list_tag tag;
};
}}} // namespace boost::parameter::aux
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
namespace boost { namespace parameter { namespace aux {
// Holds an lvalue reference to an argument of type Arg associated with
// keyword Keyword
template <typename Keyword, typename Arg>
class tagged_argument
: public ::boost::parameter::aux::tagged_argument_base
{
typedef typename ::boost::remove_const<Arg>::type arg_type;
public:
typedef Keyword key_type;
// Wrap plain (non-UDT) function objects in either
// a boost::function or a std::function. -- Cromwell D. Enage
typedef typename ::boost::mpl::if_<
::boost::is_function<arg_type>
#if defined(BOOST_NO_CXX11_HDR_FUNCTIONAL)
, ::boost::function<arg_type>
#else
, ::std::function<arg_type>
#endif
, Arg
>::type value_type;
// If Arg is void_, then this type will evaluate to void_&. If the
// supplied argument is a plain function, then this type will evaluate
// to a reference-to-const function wrapper type. If the supplied
// argument is an lvalue, then Arg will be deduced to the lvalue
// reference. -- Cromwell D. Enage
typedef typename ::boost::mpl::if_<
::boost::is_function<arg_type>
, value_type const&
, Arg&
>::type reference;
private:
// Store plain functions by value, everything else by reference.
// -- Cromwell D. Enage
typename ::boost::mpl::if_<
::boost::is_function<arg_type>
, value_type
, reference
>::type value;
public:
inline explicit BOOST_CONSTEXPR tagged_argument(reference x)
: value(x)
{
}
inline BOOST_CONSTEXPR tagged_argument(tagged_argument const& copy)
: value(copy.value)
{
}
// A metafunction class that, given a keyword and a default type,
// returns the appropriate result type for a keyword lookup given
// that default.
struct binding
{
template <typename KW, typename Default, typename Reference>
struct apply
{
typedef typename ::boost::mpl::eval_if<
::boost::is_same<KW,key_type>
, ::boost::mpl::if_<Reference,reference,value_type>
, ::boost::mpl::identity<Default>
>::type type;
};
};
// Comma operator to compose argument list without using parameters<>.
// Useful for argument lists with undetermined length.
template <typename Keyword2, typename Arg2>
inline ::boost::parameter::aux::arg_list<
::boost::parameter::aux::tagged_argument<Keyword,Arg>
, ::boost::parameter::aux::arg_list<
::boost::parameter::aux::tagged_argument<Keyword2,Arg2>
>
>
operator,(
::boost::parameter::aux
::tagged_argument<Keyword2,Arg2> const& x
) const
{
return ::boost::parameter::aux::arg_list<
::boost::parameter::aux::tagged_argument<Keyword,Arg>
, ::boost::parameter::aux::arg_list<
::boost::parameter::aux::tagged_argument<Keyword2,Arg2>
>
>(
*this
, ::boost::parameter::aux::arg_list<
::boost::parameter::aux::tagged_argument<Keyword2,Arg2>
>(x, ::boost::parameter::aux::empty_arg_list())
);
}
// Accessor interface.
inline BOOST_CONSTEXPR reference get_value() const
{
return this->value;
}
inline BOOST_CONSTEXPR reference
operator[](::boost::parameter::keyword<Keyword> const&) const
{
return this->get_value();
}
#if defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) || \
BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
template <typename KW, typename Default>
inline BOOST_CONSTEXPR Default&
get_with_default(
::boost::parameter::aux::default_<KW,Default> const& x
, int
) const
{
return x.value;
}
template <typename Default>
inline BOOST_CONSTEXPR reference
get_with_default(
::boost::parameter::aux::default_<key_type,Default> const&
, long
) const
{
return this->get_value();
}
template <typename KW, typename Default>
inline BOOST_CONSTEXPR typename ::boost::mpl::apply_wrap3<
binding
, KW
, Default&
, ::boost::mpl::true_
>::type
operator[](
::boost::parameter::aux::default_<KW,Default> const& x
) const
{
return this->get_with_default(x, 0L);
}
template <typename KW, typename F>
inline BOOST_CONSTEXPR
typename ::boost::parameter::aux::result_of0<F>::type
get_with_lazy_default(
::boost::parameter::aux::lazy_default<KW,F> const& x
, int
) const
{
return x.compute_default();
}
template <typename F>
inline BOOST_CONSTEXPR reference
get_with_lazy_default(
::boost::parameter::aux::lazy_default<key_type,F> const&
, long
) const
{
return this->get_value();
}
template <typename KW, typename F>
inline BOOST_CONSTEXPR typename ::boost::mpl::apply_wrap3<
binding
, KW
, typename ::boost::parameter::aux::result_of0<F>::type
, ::boost::mpl::true_
>::type
operator[](
::boost::parameter::aux::lazy_default<KW,F> const& x
) const
{
return this->get_with_lazy_default(x, 0L);
}
#else // No function template ordering or Borland workarounds needed.
template <typename Default>
inline BOOST_CONSTEXPR reference
operator[](
::boost::parameter::aux::default_<key_type,Default> const&
) const
{
return this->get_value();
}
template <typename F>
inline BOOST_CONSTEXPR reference
operator[](
::boost::parameter::aux::lazy_default<key_type,F> const&
) const
{
return this->get_value();
}
template <typename KW, typename Default>
inline BOOST_CONSTEXPR Default&
operator[](
::boost::parameter::aux::default_<KW,Default> const& x
) const
{
return x.value;
}
template <typename KW, typename F>
inline BOOST_CONSTEXPR
typename ::boost::parameter::aux::result_of0<F>::type
operator[](
::boost::parameter::aux::lazy_default<KW,F> const& x
) const
{
return x.compute_default();
}
template <typename ParameterRequirements>
static BOOST_CONSTEXPR typename ParameterRequirements::has_default
satisfies(ParameterRequirements*);
template <typename HasDefault, typename Predicate>
static BOOST_CONSTEXPR
typename ::boost::mpl::apply_wrap1<Predicate,value_type>::type
satisfies(
::boost::parameter::aux::parameter_requirements<
key_type
, Predicate
, HasDefault
>*
);
#endif // Function template ordering, Borland workarounds needed.
// MPL sequence support
// Convenience for users
typedef ::boost::parameter::aux::tagged_argument<Keyword,Arg> type;
// For the benefit of iterators
typedef ::boost::parameter::aux::empty_arg_list tail_type;
// For dispatching to sequence intrinsics
typedef ::boost::parameter::aux::arg_list_tag tag;
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1310))
// warning suppression
private:
void operator=(type const&);
#endif
};
}}} // namespace boost::parameter::aux
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
namespace boost { namespace parameter { namespace aux {
template <typename TaggedArg>
struct tagged_argument_list_of_1 : public TaggedArg
{
using base_type = TaggedArg;
inline explicit BOOST_CONSTEXPR tagged_argument_list_of_1(
typename base_type::reference x
) : base_type(static_cast<typename base_type::reference>(x))
{
}
inline BOOST_CONSTEXPR tagged_argument_list_of_1(
tagged_argument_list_of_1 const& copy
) : base_type(static_cast<base_type const&>(copy))
{
}
using base_type::operator[];
using base_type::satisfies;
template <typename TA2>
inline BOOST_CONSTEXPR ::boost::parameter::aux::flat_like_arg_list<
::boost::parameter::aux
::flat_like_arg_tuple<typename TaggedArg::key_type,TaggedArg>
, ::boost::parameter::aux::flat_like_arg_tuple<
typename TA2::base_type::key_type
, typename TA2::base_type
>
>
operator,(TA2 const& x) const
{
return boost::parameter::aux::flat_like_arg_list<
::boost::parameter::aux
::flat_like_arg_tuple<typename TaggedArg::key_type,TaggedArg>
, ::boost::parameter::aux::flat_like_arg_tuple<
typename TA2::base_type::key_type
, typename TA2::base_type
>
>(
static_cast<base_type const&>(*this)
, ::boost::parameter::aux::arg_list<typename TA2::base_type>(
static_cast<typename TA2::base_type const&>(x)
, ::boost::parameter::aux::empty_arg_list()
)
);
}
};
}}} // namespace boost::parameter::aux
#endif // BOOST_PARAMETER_CAN_USE_MP11
#endif // include guard

View File

@@ -0,0 +1,38 @@
// Copyright Daniel Wallin, David Abrahams 2005.
// Copyright Cromwell D. Enage 2017.
// 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)
#ifndef BOOST_PARAMETER_TAGGED_ARGUMENT_FWD_HPP
#define BOOST_PARAMETER_TAGGED_ARGUMENT_FWD_HPP
namespace boost { namespace parameter { namespace aux {
template <typename Keyword, typename Arg>
class tagged_argument;
}}} // namespace boost::parameter::aux
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
namespace boost { namespace parameter { namespace aux {
template <typename Keyword, typename Arg>
struct tagged_argument_rref;
}}} // namespace boost::parameter::aux
#endif
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
namespace boost { namespace parameter { namespace aux {
template <typename TaggedArg>
struct tagged_argument_list_of_1;
}}} // namespace boost::parameter::aux
#endif
#endif // include guard

View File

@@ -0,0 +1,89 @@
// Copyright Daniel Wallin 2006.
// Copyright Cromwell D. Enage 2017.
// 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)
#ifndef BOOST_PARAMETER_TEMPLATE_KEYWORD_060203_HPP
#define BOOST_PARAMETER_TEMPLATE_KEYWORD_060203_HPP
namespace boost { namespace parameter { namespace aux {
struct template_keyword_base
{
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <type_traits>
namespace boost { namespace parameter { namespace aux {
template <typename T>
using is_template_keyword = ::std::is_base_of<
::boost::parameter::aux::template_keyword_base
, typename ::std::remove_const<
typename ::std::remove_reference<T>::type
>::type
>;
}}} // namespace boost::parameter::aux
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#include <boost/type_traits/remove_const.hpp>
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
#include <boost/type_traits/is_base_of.hpp>
#include <boost/type_traits/remove_reference.hpp>
#else
#include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/is_lvalue_reference.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
#if !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
template <typename T>
struct is_template_keyword_aux
: ::boost::mpl::if_<
::boost::is_convertible<
T*
, ::boost::parameter::aux::template_keyword_base const*
>
, ::boost::mpl::true_
, ::boost::mpl::false_
>::type
{
};
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
template <typename T>
struct is_template_keyword
: ::boost::mpl::if_<
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
// Cannot use is_convertible<> to check if T is derived from
// template_keyword_base. -- Cromwell D. Enage
::boost::is_base_of<
::boost::parameter::aux::template_keyword_base
, typename ::boost::remove_const<
typename ::boost::remove_reference<T>::type
>::type
>
, ::boost::mpl::true_
, ::boost::mpl::false_
#else
::boost::is_lvalue_reference<T>
, ::boost::mpl::false_
, ::boost::parameter::aux::is_template_keyword_aux<T>
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
>::type
{
};
}}} // namespace boost::parameter::aux
#endif // BOOST_PARAMETER_CAN_USE_MP11
#endif // include guard

247
include/boost/parameter/aux_/unwrap_cv_reference.hpp Executable file → Normal file
View File

@@ -1,97 +1,174 @@
// Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
// distribution is subject to the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// Copyright Daniel Wallin, David Abrahams 2005.
// Copyright Cromwell D. Enage 2017.
// 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)
#ifndef UNWRAP_CV_REFERENCE_050328_HPP
#define UNWRAP_CV_REFERENCE_050328_HPP
#ifndef BOOST_PARAMETER_AUX_UNWRAP_CV_REFERENCE_HPP
#define BOOST_PARAMETER_AUX_UNWRAP_CV_REFERENCE_HPP
namespace boost {
template <typename T>
class reference_wrapper;
} // namespace boost
#include <boost/parameter/aux_/yesno.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/mpl/eval_if.hpp>
namespace boost { template<class T> class reference_wrapper; }
namespace boost { namespace parameter { namespace aux {
//
// reference_wrapper support -- because of the forwarding problem,
// when passing arguments positionally by non-const reference, we
// ask users of named parameter interfaces to use ref(x) to wrap
// them.
//
//
// reference_wrapper support -- if perfect forwarding is unsupported,
// then when passing arguments positionally by non-const reference,
// we ask users of named parameter interfaces to use ref(x) to wrap them.
//
// is_cv_reference_wrapper returns mpl::true_ if T is of type
// reference_wrapper<U> cv
template <class U>
yes_tag is_cv_reference_wrapper_check(reference_wrapper<U> const volatile*);
no_tag is_cv_reference_wrapper_check(...);
template <class T>
struct is_cv_reference_wrapper
{
BOOST_STATIC_CONSTANT(
bool, value = (
sizeof(is_cv_reference_wrapper_check((T*)0)) == sizeof(yes_tag)
)
);
typedef mpl::bool_<
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
is_cv_reference_wrapper::
#endif
value> type;
};
#if BOOST_WORKAROUND(MSVC, == 1200)
template <>
struct is_cv_reference_wrapper<int>
: mpl::false_ {};
#endif
// Needed for unwrap_cv_reference below. T might be const, so
// eval_if might fail because of deriving from T const on EDG.
template <class T>
struct get_type
{
typedef typename T::type type;
};
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
template <class T, class is_reference_wrapper = typename is_cv_reference_wrapper<T>::type>
struct unwrap_cv_reference
{
typedef T type;
};
template <class T>
struct unwrap_cv_reference<T const, mpl::false_>
{
typedef T const type;
};
template <class T>
struct unwrap_cv_reference<T, mpl::true_>
: T
{};
#else
// Produces the unwrapped type to hold a reference to in named<>
// Can't use boost::unwrap_reference<> here because it
// doesn't handle the case where T = reference_wrapper<U> cv
template <class T>
struct unwrap_cv_reference
{
typedef typename mpl::eval_if<
is_cv_reference_wrapper<T>
, get_type<T>
, mpl::identity<T>
>::type type;
};
#endif
template <typename U>
::boost::parameter::aux::yes_tag
is_cv_reference_wrapper_check(
::boost::reference_wrapper<U> const volatile*
);
::boost::parameter::aux::no_tag is_cv_reference_wrapper_check(...);
}}} // namespace boost::parameter::aux
#endif // UNWRAP_CV_REFERENCE_050328_HPP
#include <boost/parameter/config.hpp>
#if !defined(BOOST_NO_CXX11_HDR_FUNCTIONAL)
#include <functional>
namespace boost { namespace parameter { namespace aux {
// Support for std::ref(x) -- Cromwell D. Enage
template <typename U>
::boost::parameter::aux::yes_tag
is_cv_reference_wrapper_check(
::std::reference_wrapper<U> const volatile*
);
}}} // namespace boost::parameter::aux
#endif
#include <boost/parameter/aux_/preprocessor/nullptr.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11) && !( \
BOOST_WORKAROUND(BOOST_MSVC, >= 1900) && \
BOOST_WORKAROUND(BOOST_MSVC, < 1910) \
)
#include <boost/mp11/integral.hpp>
#include <boost/mp11/utility.hpp>
#include <type_traits>
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11) || MSVC-14.0
#include <boost/mpl/bool.hpp>
#include <boost/type_traits/remove_reference.hpp>
#if !BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564)) && \
!BOOST_WORKAROUND(BOOST_GCC, < 40000)
#include <boost/mpl/eval_if.hpp>
#endif
#endif // BOOST_PARAMETER_CAN_USE_MP11 && not MSVC-14.0
namespace boost { namespace parameter { namespace aux {
#if defined(BOOST_PARAMETER_CAN_USE_MP11) && !( \
BOOST_WORKAROUND(BOOST_MSVC, >= 1900) && \
BOOST_WORKAROUND(BOOST_MSVC, < 1910) \
)
// This metafunction returns mp11::mp_true if T is of type
// reference_wrapper<U> cv.
template <typename T>
using is_cv_reference_wrapper = ::boost::mp11::mp_bool<
sizeof(
::boost::parameter::aux::is_cv_reference_wrapper_check(
static_cast<
typename ::std::remove_reference<T>::type*
>(BOOST_PARAMETER_AUX_PP_NULLPTR)
)
) == sizeof(::boost::parameter::aux::yes_tag)
>;
// Needed for unwrap_cv_reference below. T might be const, so
// mp_eval_if<> might fail because of deriving from T const on EDG.
template <typename T>
using unwrap_cv_reference_impl = typename ::std::remove_reference<T>::type;
// Produces the unwrapped type to hold a reference to in
// tagged_argument<>. Can't use boost::unwrap_reference<> here
// because it doesn't handle the case where T = reference_wrapper<U> cv.
template <typename T>
using unwrap_cv_reference = ::boost::mp11::mp_eval_if<
::boost::parameter::aux::is_cv_reference_wrapper<T>
, ::boost::parameter::aux::unwrap_cv_reference_impl<T>
, ::std::remove_reference
, T
>;
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11) || MSVC-14.0
// This metafunction returns mpl::true_ if T is of type
// reference_wrapper<U> cv.
template <typename T>
struct is_cv_reference_wrapper
{
BOOST_STATIC_CONSTANT(
bool, value = (
sizeof(
::boost::parameter::aux::is_cv_reference_wrapper_check(
static_cast<
typename ::boost::remove_reference<T>::type*
>(BOOST_PARAMETER_AUX_PP_NULLPTR)
)
) == sizeof(::boost::parameter::aux::yes_tag)
)
);
typedef boost::mpl::bool_<
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
is_cv_reference_wrapper::
#endif
value> type;
};
#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564)) || \
BOOST_WORKAROUND(BOOST_GCC, < 40000)
template <
typename T
, typename = typename ::boost::parameter::aux
::is_cv_reference_wrapper<T>::type
>
struct unwrap_cv_reference : ::boost::remove_reference<T>
{
};
template <typename T>
struct unwrap_cv_reference<T const,::boost::mpl::false_>
{
typedef T const type;
};
template <typename T>
struct unwrap_cv_reference<T,::boost::mpl::true_> : T
{
};
#else // no Borland or GCC 3- workarounds needed
// Needed for unwrap_cv_reference below. T might be const, so
// eval_if<> might fail because of deriving from T const on EDG.
template <typename T>
struct unwrap_cv_reference_impl : ::boost::remove_reference<T>::type
{
};
// Produces the unwrapped type to hold a reference to in
// tagged_argument<>. Can't use boost::unwrap_reference<> here
// because it doesn't handle the case where T = reference_wrapper<U> cv.
template <typename T>
struct unwrap_cv_reference
: ::boost::mpl::eval_if<
::boost::parameter::aux::is_cv_reference_wrapper<T>
, ::boost::parameter::aux::unwrap_cv_reference_impl<T>
, ::boost::remove_reference<T>
>
{
};
#endif // Borland or GCC 3- workarounds needed
#endif // BOOST_PARAMETER_CAN_USE_MP11 && not MSVC-14.0
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,17 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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)
#ifndef BOOST_PARAMETER_AUX_USE_DEFAULT_HPP
#define BOOST_PARAMETER_AUX_USE_DEFAULT_HPP
namespace boost { namespace parameter { namespace aux {
struct use_default
{
};
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,29 @@
// Copyright Daniel Wallin 2006.
// 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)
#ifndef BOOST_PARAMETER_USE_DEFAULT_TAG_HPP
#define BOOST_PARAMETER_USE_DEFAULT_TAG_HPP
#include <boost/config.hpp>
namespace boost { namespace parameter { namespace aux {
struct use_default_tag
{
inline BOOST_CONSTEXPR BOOST_DEFAULTED_FUNCTION(use_default_tag(), {})
inline BOOST_CONSTEXPR BOOST_DEFAULTED_FUNCTION(
use_default_tag(use_default_tag const&), {}
)
inline BOOST_CONSTEXPR use_default_tag operator()() const
{
return *this;
}
};
}}} // namespace boost::parameter::aux
#endif // include guard

40
include/boost/parameter/aux_/void.hpp Executable file → Normal file
View File

@@ -1,18 +1,38 @@
// Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
// distribution is subject to the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// Copyright Daniel Wallin, David Abrahams 2005.
// 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)
#ifndef VOID_050329_HPP
#define VOID_050329_HPP
#ifndef BOOST_PARAMETER_VOID_050329_HPP
#define BOOST_PARAMETER_VOID_050329_HPP
namespace boost { namespace parameter {
// A placemarker for "no argument passed."
// MAINTAINER NOTE: Do not make this into a metafunction
struct void_
{
};
}} // namespace boost::parameter
namespace boost { namespace parameter { namespace aux {
// A placemarker for "no argument passed."
// MAINTAINER NOTE: Do not make this into a metafunction
struct void_ {};
inline ::boost::parameter::void_& void_reference()
{
static ::boost::parameter::void_ instance;
return instance;
}
}}} // namespace boost::parameter::aux
#endif // VOID_050329_HPP
#include <boost/config/workaround.hpp>
#if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580))
namespace boost { namespace parameter { namespace aux {
typedef void* voidstar;
}}} // namespace boost::parameter::aux
#endif
#endif // include guard

48
include/boost/parameter/aux_/yesno.hpp Executable file → Normal file
View File

@@ -1,26 +1,42 @@
// Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
// distribution is subject to the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// Copyright Daniel Wallin, David Abrahams 2005.
// 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)
#ifndef YESNO_050328_HPP
#define YESNO_050328_HPP
#ifndef BOOST_PARAMETER_AUX_YESNO_HPP
#define BOOST_PARAMETER_AUX_YESNO_HPP
namespace boost { namespace parameter { namespace aux {
// types used with the "sizeof trick" to capture the results of
// overload resolution at compile-time.
typedef char yes_tag;
typedef char (&no_tag)[2];
}}} // namespace boost::parameter::aux
#include <boost/mpl/bool.hpp>
namespace boost { namespace parameter { namespace aux {
// types used with the "sizeof trick" to capture the results of
// overload resolution at compile-time.
typedef char yes_tag;
typedef char (&no_tag)[2];
// mpl::true_ and mpl::false_ are not distinguishable by sizeof(),
// so we pass them through these functions to get a type that is.
yes_tag to_yesno(mpl::true_);
no_tag to_yesno(mpl::false_);
// mpl::true_ and mpl::false_ are not distinguishable by sizeof(),
// so we pass them through these functions to get a type that is.
::boost::parameter::aux::yes_tag to_yesno(::boost::mpl::true_);
::boost::parameter::aux::no_tag to_yesno(::boost::mpl::false_);
}}} // namespace boost::parameter::aux
#endif // YESNO_050328_HPP
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/integral.hpp>
namespace boost { namespace parameter { namespace aux {
// mp11::mp_true and mp11::mp_false are not distinguishable by sizeof(),
// so we pass them through these functions to get a type that is.
::boost::parameter::aux::yes_tag to_yesno(::boost::mp11::mp_true);
::boost::parameter::aux::no_tag to_yesno(::boost::mp11::mp_false);
}}} // namespace boost::parameter::aux
#endif // BOOST_PARAMETER_CAN_USE_MP11
#endif // include guard

199
include/boost/parameter/binding.hpp Executable file → Normal file
View File

@@ -1,57 +1,164 @@
// Copyright David Abrahams 2005. 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)
// Copyright David Abrahams 2005.
// 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)
#ifndef BOOST_PARAMETER_BINDING_DWA200558_HPP
# define BOOST_PARAMETER_BINDING_DWA200558_HPP
#define BOOST_PARAMETER_BINDING_DWA200558_HPP
# include <boost/mpl/apply.hpp>
# include <boost/parameter/aux_/result_of0.hpp>
#include <boost/parameter/aux_/void.hpp>
#include <boost/parameter/config.hpp>
# include <boost/parameter/aux_/void.hpp>
# if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
# include <boost/parameter/aux_/void.hpp>
# include <boost/type_traits/is_same.hpp>
# endif
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/integral.hpp>
#include <boost/mp11/list.hpp>
#include <boost/mp11/utility.hpp>
#include <type_traits>
#else
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/mpl/apply_wrap.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/type_traits/is_same.hpp>
#endif
namespace boost { namespace parameter {
// A metafunction that, given an argument pack, returns the type of
// the parameter identified by the given keyword. If no such
// parameter has been specified, returns Default
# if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
template <class Parameters, class Keyword, class Default = void>
struct binding
: mpl::apply_wrap2<
typename Parameters::binding,Keyword,Default
>
{};
# else
template <class Parameters, class Keyword, class Default = aux::void_>
struct binding
{
typedef typename mpl::apply_wrap2<
typename Parameters::binding,Keyword,
typename mpl::if_<is_same<Default,aux::void_>,void,Default>::type
>::type type;
};
# endif
// A metafunction that, given an argument pack, returns the reference type
// of the parameter identified by the given keyword. If no such parameter
// has been specified, returns Default
// A metafunction that, given an argument pack, returns the type of
// the parameter identified by the given keyword. If no such
// parameter has been specified, returns the type returned by invoking
// DefaultFn
template <class Parameters, class Keyword, class DefaultFn>
struct lazy_binding
{
typedef typename mpl::apply_wrap2<
typename Parameters::binding
, Keyword
, typename aux::result_of0<DefaultFn>::type
>::type type;
};
template <typename Parameters, typename Keyword, typename Default>
struct binding0
{
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using type = ::boost::mp11::mp_apply_q<
typename Parameters::binding
, ::boost::mp11::mp_list<Keyword,Default,::boost::mp11::mp_true>
>;
static_assert(
::boost::mp11::mp_if<
::std::is_same<Default,::boost::parameter::void_>
, ::boost::mp11::mp_if<
::std::is_same<type,::boost::parameter::void_>
, ::boost::mp11::mp_false
, ::boost::mp11::mp_true
>
, ::boost::mp11::mp_true
>::value
, "required parameters must not result in void_ type"
);
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
typedef typename ::boost::mpl::apply_wrap3<
typename Parameters::binding
, Keyword
, Default
, ::boost::mpl::true_
>::type type;
BOOST_MPL_ASSERT((
typename ::boost::mpl::eval_if<
::boost::is_same<Default,::boost::parameter::void_>
, ::boost::mpl::if_<
::boost::is_same<type,::boost::parameter::void_>
, ::boost::mpl::false_
, ::boost::mpl::true_
>
, ::boost::mpl::true_
>::type
));
#endif // BOOST_PARAMETER_CAN_USE_MP11
};
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
template <typename Placeholder, typename Keyword, typename Default>
struct binding1
{
using type = ::boost::mp11::mp_apply_q<
Placeholder
, ::boost::mp11::mp_list<Keyword,Default,::boost::mp11::mp_true>
>;
static_assert(
::boost::mp11::mp_if<
::std::is_same<Default,::boost::parameter::void_>
, ::boost::mp11::mp_if<
::std::is_same<type,::boost::parameter::void_>
, ::boost::mp11::mp_false
, ::boost::mp11::mp_true
>
, ::boost::mp11::mp_true
>::value
, "required parameters must not result in void_ type"
);
};
#endif // BOOST_PARAMETER_CAN_USE_MP11
}} // namespace boost::parameter
#endif // BOOST_PARAMETER_BINDING_DWA200558_HPP
#include <boost/parameter/aux_/is_placeholder.hpp>
namespace boost { namespace parameter {
template <
typename Parameters
, typename Keyword
, typename Default = ::boost::parameter::void_
>
struct binding
#if !defined(BOOST_PARAMETER_CAN_USE_MP11)
: ::boost::mpl::eval_if<
::boost::parameter::aux::is_mpl_placeholder<Parameters>
, ::boost::mpl::identity<int>
, ::boost::parameter::binding0<Parameters,Keyword,Default>
>
#endif
{
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using type = typename ::boost::mp11::mp_if<
::boost::parameter::aux::is_mpl_placeholder<Parameters>
, ::boost::mp11::mp_identity<int>
, ::boost::mp11::mp_if<
::boost::parameter::aux::is_mp11_placeholder<Parameters>
, ::boost::parameter::binding1<Parameters,Keyword,Default>
, ::boost::parameter::binding0<Parameters,Keyword,Default>
>
>::type;
#endif
};
}} // namespace boost::parameter
#include <boost/parameter/aux_/result_of0.hpp>
namespace boost { namespace parameter {
// A metafunction that, given an argument pack, returns the reference type
// of the parameter identified by the given keyword. If no such parameter
// has been specified, returns the type returned by invoking DefaultFn
template <typename Parameters, typename Keyword, typename DefaultFn>
struct lazy_binding
{
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using type = ::boost::mp11::mp_apply_q<
typename Parameters::binding
, ::boost::mp11::mp_list<
Keyword
, typename ::boost::parameter::aux::result_of0<DefaultFn>::type
, ::boost::mp11::mp_true
>
>;
#else
typedef typename ::boost::mpl::apply_wrap3<
typename Parameters::binding
, Keyword
, typename ::boost::parameter::aux::result_of0<DefaultFn>::type
, ::boost::mpl::true_
>::type type;
#endif // BOOST_PARAMETER_CAN_USE_MP11
};
}} // namespace boost::parameter
#endif // include guard

View File

@@ -0,0 +1,210 @@
// Copyright Cromwell D. Enage 2019.
// 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)
#ifndef BOOST_PARAMETER_COMPOSE_HPP
#define BOOST_PARAMETER_COMPOSE_HPP
#include <boost/parameter/aux_/arg_list.hpp>
namespace boost { namespace parameter {
inline BOOST_CONSTEXPR ::boost::parameter::aux::empty_arg_list compose()
{
return ::boost::parameter::aux::empty_arg_list();
}
}} // namespace boost::parameter
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
namespace boost { namespace parameter { namespace aux {
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
template <typename ...TaggedArgs>
struct compose_arg_list
{
using type = ::boost::parameter::aux::flat_like_arg_list<
::boost::parameter::aux::flat_like_arg_tuple<
typename TaggedArgs::base_type::key_type
, typename TaggedArgs::base_type
>...
>;
};
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
template <typename TaggedArg0, typename ...TaggedArgs>
struct compose_arg_list;
template <typename TaggedArg0>
struct compose_arg_list<TaggedArg0>
{
typedef ::boost::parameter::aux::arg_list<TaggedArg0> type;
};
template <typename TaggedArg0, typename ...TaggedArgs>
struct compose_arg_list
{
typedef ::boost::parameter::aux::arg_list<
TaggedArg0
, typename ::boost::parameter::aux
::compose_arg_list<TaggedArgs...>::type
> type;
};
#endif // BOOST_PARAMETER_CAN_USE_MP11
}}} // namespace boost::parameter::aux
#include <boost/parameter/are_tagged_arguments.hpp>
#include <boost/core/enable_if.hpp>
namespace boost { namespace parameter { namespace result_of {
template <typename ...TaggedArgs>
struct compose
: ::boost::lazy_enable_if<
::boost::parameter::are_tagged_arguments<TaggedArgs...>
, ::boost::parameter::aux::compose_arg_list<TaggedArgs...>
>
{
};
template <>
struct compose<>
{
typedef ::boost::parameter::aux::empty_arg_list type;
};
}}} // namespace boost::parameter::result_of
namespace boost { namespace parameter {
template <typename TaggedArg0, typename ...TaggedArgs>
inline BOOST_CONSTEXPR typename ::boost::parameter::result_of
::compose<TaggedArg0,TaggedArgs...>::type
compose(TaggedArg0 const& arg0, TaggedArgs const&... args)
{
return typename ::boost::parameter::aux
::compose_arg_list<TaggedArg0,TaggedArgs...>::type(
::boost::parameter::aux::value_type_is_not_void()
, arg0
, args...
);
}
}} // namespace boost::parameter
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
#define BOOST_PARAMETER_compose_arg_list_type_suffix(z, n, suffix) suffix
#include <boost/preprocessor/cat.hpp>
#define BOOST_PARAMETER_compose_arg_list_type_prefix(z, n, prefix) \
::boost::parameter::aux::arg_list<BOOST_PP_CAT(prefix, n)
/**/
#include <boost/preprocessor/facilities/intercept.hpp>
#include <boost/preprocessor/repetition/enum.hpp>
#include <boost/preprocessor/repetition/repeat.hpp>
#define BOOST_PARAMETER_compose_arg_list_type(z, n, prefix) \
BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
n, BOOST_PARAMETER_compose_arg_list_type_prefix, prefix \
) BOOST_PP_CAT(BOOST_PP_REPEAT_, z)( \
n, BOOST_PARAMETER_compose_arg_list_type_suffix, > \
)
/**/
#include <boost/parameter/aux_/void.hpp>
#include <boost/preprocessor/arithmetic/inc.hpp>
#include <boost/preprocessor/arithmetic/sub.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
#if defined(BOOST_NO_SFINAE)
#define BOOST_PARAMETER_compose_arg_list_function_overload(z, n, prefix) \
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename prefix)> \
inline BOOST_CONSTEXPR \
BOOST_PARAMETER_compose_arg_list_type(z, n, prefix) \
compose(BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, prefix, const& a)) \
{ \
return BOOST_PARAMETER_compose_arg_list_type(z, n, prefix)( \
BOOST_PP_ENUM_PARAMS_Z(z, n, a) \
BOOST_PP_ENUM_TRAILING_PARAMS_Z( \
z \
, BOOST_PP_SUB(BOOST_PARAMETER_COMPOSE_MAX_ARITY, n) \
, ::boost::parameter::aux::void_reference() BOOST_PP_INTERCEPT \
) \
); \
}
/**/
#else // !defined(BOOST_NO_SFINAE)
#include <boost/parameter/are_tagged_arguments.hpp>
#include <boost/core/enable_if.hpp>
namespace boost { namespace parameter { namespace result_of {
template <
BOOST_PP_ENUM_BINARY_PARAMS(
BOOST_PP_INC(BOOST_PARAMETER_COMPOSE_MAX_ARITY)
, typename TaggedArg
, = void BOOST_PP_INTERCEPT
)
>
struct compose;
template <>
struct compose<>
{
typedef ::boost::parameter::aux::empty_arg_list type;
};
}}} // namespace boost::parameter::result_of
#define BOOST_PARAMETER_compose_arg_list_function_overload(z, n, prefix) \
namespace boost { namespace parameter { namespace result_of { \
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename prefix)> \
struct compose<BOOST_PP_ENUM_PARAMS_Z(z, n, prefix)> \
: ::boost::enable_if< \
::boost::parameter \
::are_tagged_arguments<BOOST_PP_ENUM_PARAMS_Z(z, n, prefix)> \
, BOOST_PARAMETER_compose_arg_list_type(z, n, prefix) \
> \
{ \
}; \
}}} \
namespace boost { namespace parameter { \
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename prefix)> \
inline BOOST_CONSTEXPR typename ::boost::parameter::result_of \
::compose<BOOST_PP_ENUM_PARAMS_Z(z, n, prefix)>::type \
compose(BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, prefix, const& a)) \
{ \
return BOOST_PARAMETER_compose_arg_list_type(z, n, prefix)( \
BOOST_PP_ENUM_PARAMS_Z(z, n, a) \
BOOST_PP_ENUM_TRAILING_PARAMS_Z( \
z \
, BOOST_PP_SUB(BOOST_PARAMETER_COMPOSE_MAX_ARITY, n) \
, ::boost::parameter::aux::void_reference() BOOST_PP_INTERCEPT \
) \
); \
} \
}}
/**/
#endif // BOOST_NO_SFINAE
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
BOOST_PP_REPEAT_FROM_TO(
1
, BOOST_PP_INC(BOOST_PARAMETER_COMPOSE_MAX_ARITY)
, BOOST_PARAMETER_compose_arg_list_function_overload
, TaggedArg
)
#undef BOOST_PARAMETER_compose_arg_list_function_overload
#undef BOOST_PARAMETER_compose_arg_list_type
#undef BOOST_PARAMETER_compose_arg_list_type_prefix
#undef BOOST_PARAMETER_compose_arg_list_type_suffix
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
#endif // include guard

81
include/boost/parameter/config.hpp Executable file → Normal file
View File

@@ -1,14 +1,83 @@
// Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
// distribution is subject to the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// Copyright Daniel Wallin, David Abrahams 2005.
// Copyright Cromwell D. Enage 2017.
// 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)
#ifndef BOOST_PARAMETER_CONFIG_050403_HPP
#define BOOST_PARAMETER_CONFIG_050403_HPP
#ifndef BOOST_PARAMETER_MAX_ARITY
# define BOOST_PARAMETER_MAX_ARITY 5
#include <boost/config.hpp>
#include <boost/config/workaround.hpp>
// Allow projects to #define BOOST_PARAMETER_DISABLE_PERFECT_FORWARDING to
// turn off perfect forwarding as necessary. Otherwise, also require correct
// SFINAE support, needed explicitly by tagged_argument & keyword & cast;
// correct function template ordering, needed by the code generation macros;
// rvalue references, needed throughout; variadic templates, needed by
// parameters; function template default arguments, needed by the code
// generation macros; and the ability to handle multiple parameter packs,
// needed by parameters. Older versions of GCC either don't have the latter
// ability or cannot disambiguate between keyword's overloaded
// operators. Older versions of Clang either fail to compile due to
// differences in length between parameter packs 'Args' and 'args' or fail at
// runtime due to segmentation faults.
// -- Cromwell D. Enage
#if !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING) && \
!defined(BOOST_PARAMETER_DISABLE_PERFECT_FORWARDING) && \
!defined(BOOST_NO_SFINAE) && \
!defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) && \
!defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \
!defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && \
!defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS) && \
!BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564)) && !( \
defined(BOOST_CLANG) && (1 == BOOST_CLANG) && ( \
(__clang_major__ < 3) || ( \
(3 == __clang_major__) && (__clang_minor__ < 2) \
) \
) \
) && !BOOST_WORKAROUND(BOOST_GCC, < 40900)
#define BOOST_PARAMETER_HAS_PERFECT_FORWARDING
#endif
#endif // BOOST_PARAMETER_CONFIG_050403_HPP
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
#if !defined(BOOST_PARAMETER_CAN_USE_MP11) && \
!defined(BOOST_PARAMETER_DISABLE_MP11_USAGE) && \
!defined(BOOST_NO_CXX11_CONSTEXPR) && \
!defined(BOOST_NO_CXX11_DECLTYPE_N3276) && \
!defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) && \
!defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) && \
!defined(BOOST_NO_CXX11_STATIC_ASSERT) && \
!defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) && \
!defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) && \
!defined(BOOST_NO_CXX11_HDR_TUPLE)
// Boost.MP11 requires C++11. -- Cromwell D. Enage
#define BOOST_PARAMETER_CAN_USE_MP11
#endif
#if !defined(BOOST_PARAMETER_MAX_ARITY)
// Unlike the variadic MPL sequences provided by Boost.Fusion,
// boost::mpl::vector has a size limit. -- Cromwell D. Enage
#include <boost/mpl/limits/vector.hpp>
#define BOOST_PARAMETER_MAX_ARITY BOOST_MPL_LIMIT_VECTOR_SIZE
#endif
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
#if !defined(BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY)
#define BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY 0
#endif
#if !defined(BOOST_PARAMETER_COMPOSE_MAX_ARITY)
#if BOOST_WORKAROUND(BOOST_MSVC, < 1800) || \
BOOST_WORKAROUND(BOOST_GCC, < 60000)
// Some tests cause MSVC-11.0 and earlier to run out of heap space,
// while some other tests cause GCC 5 and earlier to do the same,
// if the value is set any higher. -- Cromwell D. Enage
#define BOOST_PARAMETER_COMPOSE_MAX_ARITY 20
#else
#define BOOST_PARAMETER_COMPOSE_MAX_ARITY 64
#endif
#endif // BOOST_PARAMETER_COMPOSE_MAX_ARITY
#if !defined(BOOST_PARAMETER_MAX_ARITY)
#define BOOST_PARAMETER_MAX_ARITY 8
#endif
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
#endif // include guard

View File

@@ -0,0 +1,132 @@
// Copyright David Abrahams, Daniel Wallin 2003.
// 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)
#ifndef BOOST_PARAMETER_DEDUCED_HPP
#define BOOST_PARAMETER_DEDUCED_HPP
#include <boost/parameter/aux_/use_default.hpp>
namespace boost { namespace parameter {
// This metafunction can be used to describe the treatment of particular
// named parameters for the purposes of overload elimination with SFINAE,
// by placing specializations in the parameters<...> list.
//
// If a keyword k is specified with deduced<...>, that keyword
// will be automatically deduced from the argument list.
template <typename Tag>
struct deduced
{
typedef Tag key_type;
};
}}
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/integral.hpp>
#else
#include <boost/mpl/bool.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
template <typename T>
struct is_deduced_aux
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
: ::boost::mp11::mp_false
#else
: ::boost::mpl::false_
#endif
{
};
template <typename Tag>
struct is_deduced_aux< ::boost::parameter::deduced<Tag> >
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
: ::boost::mp11::mp_true
#else
: ::boost::mpl::true_
#endif
{
};
template <typename T>
struct is_deduced0
: ::boost::parameter::aux::is_deduced_aux<typename T::key_type>::type
{
};
}}} // namespace boost::parameter::aux
#include <boost/parameter/required.hpp>
#include <boost/parameter/optional.hpp>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/utility.hpp>
#else
#include <boost/mpl/if.hpp>
#endif
namespace boost { namespace parameter { namespace aux {
//
// tag_type, has_default, and predicate --
//
// These metafunctions accept a ParameterSpec and extract the
// keyword tag, whether or not a default is supplied for the
// parameter, and the predicate that the corresponding actual
// argument type is required match.
//
// a ParameterSpec is a specialization of either keyword<...>,
// required<...>, optional<...>
//
template <typename T>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using has_default = ::boost::mp11::mp_if<
::boost::parameter::aux::is_required<T>
, ::boost::mp11::mp_false
, ::boost::mp11::mp_true
>;
#else
struct has_default
: ::boost::mpl::if_<
::boost::parameter::aux::is_required<T>
, ::boost::mpl::false_
, ::boost::mpl::true_
>::type
{
};
#endif
template <typename T>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
using is_deduced = ::boost::mp11::mp_if<
::boost::mp11::mp_if<
::boost::parameter::aux::is_optional<T>
, ::boost::mp11::mp_true
, ::boost::parameter::aux::is_required<T>
>
, ::boost::parameter::aux::is_deduced0<T>
, ::boost::mp11::mp_false
>;
#else
struct is_deduced
: ::boost::mpl::if_<
typename ::boost::mpl::if_<
::boost::parameter::aux::is_optional<T>
, ::boost::mpl::true_
, ::boost::parameter::aux::is_required<T>
>::type
, ::boost::parameter::aux::is_deduced0<T>
, ::boost::mpl::false_
>::type
{
};
#endif // BOOST_PARAMETER_CAN_USE_MP11
}}} // namespace boost::parameter::aux
#endif // include guard

View File

@@ -0,0 +1,29 @@
// Copyright Cromwell D. Enage 2018.
// 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)
#ifndef BOOST_PARAMETER_IS_ARGUMENT_PACK_HPP
#define BOOST_PARAMETER_IS_ARGUMENT_PACK_HPP
#include <boost/parameter/aux_/is_tagged_argument.hpp>
#include <boost/parameter/aux_/arg_list.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#include <boost/type_traits/is_base_of.hpp>
namespace boost { namespace parameter {
template <typename T>
struct is_argument_pack
: ::boost::mpl::if_<
::boost::is_base_of< ::boost::parameter::aux::empty_arg_list,T>
, ::boost::mpl::true_
, ::boost::parameter::aux::is_tagged_argument<T>
>::type
{
};
}}
#endif // include guard

828
include/boost/parameter/keyword.hpp Executable file → Normal file
View File

@@ -1,134 +1,744 @@
// Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
// distribution is subject to the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// Copyright Daniel Wallin, David Abrahams 2005.
// Copyright Cromwell D. Enage 2017.
// 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)
#ifndef KEYWORD_050328_HPP
#define KEYWORD_050328_HPP
#ifndef BOOST_PARAMETER_KEYWORD_HPP
#define BOOST_PARAMETER_KEYWORD_HPP
#include <boost/parameter/aux_/unwrap_cv_reference.hpp>
#include <boost/parameter/aux_/tag.hpp>
#include <boost/parameter/aux_/default.hpp>
#include <boost/noncopyable.hpp>
#include <boost/parameter/keyword_fwd.hpp>
#include <boost/parameter/config.hpp>
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
#include <boost/core/enable_if.hpp>
#include <utility>
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#include <boost/mp11/integral.hpp>
#include <boost/mp11/utility.hpp>
#include <type_traits>
#else
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/is_scalar.hpp>
#include <boost/type_traits/is_const.hpp>
#endif
namespace boost { namespace parameter {
// Instances of unique specializations of keyword<...> serve to
// associate arguments with parameter names. For example:
//
// struct rate_; // parameter names
// struct skew_;
// namespace
// {
// keyword<rate_> rate; // keywords
// keyword<skew_> skew;
// }
//
// ...
//
// f(rate = 1, skew = 2.4);
//
template <class Tag>
struct keyword : noncopyable
{
template <class T>
typename aux::tag<Tag, T>::type
operator=(T& x) const
// Instances of unique specializations of keyword<...> serve to
// associate arguments with parameter names. For example:
//
// struct rate_; // parameter names
// struct skew_;
//
// namespace
// {
// keyword<rate_> rate; // keywords
// keyword<skew_> skew;
// }
//
// ...
//
// f(rate = 1, skew = 2.4);
template <typename Tag>
struct keyword
{
typedef typename aux::tag<Tag, T>::type result;
return result(x);
}
typedef Tag tag;
template <class Default>
aux::default_<Tag, Default>
operator|(Default& default_) const
{
return aux::default_<Tag, Default>(default_);
}
inline BOOST_CONSTEXPR keyword()
{
}
template <class Default>
aux::lazy_default<Tag, Default>
operator||(Default& default_) const
{
return aux::lazy_default<Tag, Default>(default_);
}
template <typename T>
inline BOOST_CONSTEXPR typename ::boost::lazy_enable_if<
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
::boost::mp11::mp_if<
::std::is_scalar<T>
, ::boost::mp11::mp_true
, ::boost::mp11::mp_if<
::std::is_same<
typename Tag::qualifier
, ::boost::parameter::in_reference
>
, ::boost::mp11::mp_true
, ::std::is_same<
typename Tag::qualifier
, ::boost::parameter::forward_reference
>
>
>
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
typename ::boost::mpl::eval_if<
::boost::is_scalar<T>
, ::boost::mpl::true_
, ::boost::mpl::eval_if<
::boost::is_same<
typename Tag::qualifier
, ::boost::parameter::in_reference
>
, ::boost::mpl::true_
, ::boost::mpl::if_<
::boost::is_same<
typename Tag::qualifier
, ::boost::parameter::forward_reference
>
, ::boost::mpl::true_
, ::boost::mpl::false_
>
>
>::type
#endif // BOOST_PARAMETER_CAN_USE_MP11
, ::boost::parameter::aux::tag<Tag,T const&>
>::type
operator=(T const& x) const
{
typedef typename ::boost::parameter::aux
::tag<Tag,T const&>::type result;
return result(x);
}
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) // avoid partial ordering bugs
template <class T>
typename aux::tag<Tag, T const>::type
operator=(T const& x) const
{
typedef typename aux::tag<Tag, T const>::type result;
return result(x);
}
#endif
template <typename Default>
inline BOOST_CONSTEXPR typename ::boost::enable_if<
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
::boost::mp11::mp_if<
::std::is_scalar<Default>
, ::boost::mp11::mp_true
, ::boost::mp11::mp_if<
::std::is_same<
typename Tag::qualifier
, ::boost::parameter::in_reference
>
, ::boost::mp11::mp_true
, ::std::is_same<
typename Tag::qualifier
, ::boost::parameter::forward_reference
>
>
>
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
typename ::boost::mpl::eval_if<
::boost::is_scalar<Default>
, ::boost::mpl::true_
, ::boost::mpl::eval_if<
::boost::is_same<
typename Tag::qualifier
, ::boost::parameter::in_reference
>
, ::boost::mpl::true_
, ::boost::mpl::if_<
::boost::is_same<
typename Tag::qualifier
, ::boost::parameter::forward_reference
>
, ::boost::mpl::true_
, ::boost::mpl::false_
>
>
>::type
#endif // BOOST_PARAMETER_CAN_USE_MP11
, ::boost::parameter::aux::default_<Tag,Default const>
>::type
operator|(Default const& d) const
{
return ::boost::parameter::aux::default_<Tag,Default const>(d);
}
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) // avoid partial ordering bugs
template <class Default>
aux::default_<Tag, const Default>
operator|(const Default& default_) const
#if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
volatile
#endif
{
return aux::default_<Tag, const Default>(default_);
}
template <typename T>
inline BOOST_CONSTEXPR typename ::boost::lazy_enable_if<
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
::boost::mp11::mp_if<
::boost::mp11::mp_if<
::std::is_same<
typename Tag::qualifier
, ::boost::parameter::out_reference
>
, ::boost::mp11::mp_true
, ::std::is_same<
typename Tag::qualifier
, ::boost::parameter::forward_reference
>
>
, ::boost::mp11::mp_if<
::std::is_const<T>
, ::boost::mp11::mp_false
, ::boost::mp11::mp_true
>
, ::boost::mp11::mp_false
>
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
typename ::boost::mpl::eval_if<
typename ::boost::mpl::if_<
::boost::is_same<
typename Tag::qualifier
, ::boost::parameter::out_reference
>
, ::boost::mpl::true_
, ::boost::is_same<
typename Tag::qualifier
, ::boost::parameter::forward_reference
>
>::type
, ::boost::mpl::if_<
::boost::is_const<T>
, ::boost::mpl::false_
, ::boost::mpl::true_
>
, ::boost::mpl::false_
>::type
#endif // BOOST_PARAMETER_CAN_USE_MP11
, ::boost::parameter::aux::tag<Tag,T&>
>::type
operator=(T& x) const
{
typedef typename ::boost::parameter::aux
::tag<Tag,T&>::type result;
return result(x);
}
template <class Default>
aux::lazy_default<Tag, Default>
operator||(Default const& default_) const
#if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
volatile
#endif
{
return aux::lazy_default<Tag, Default>(default_);
}
#endif
template <typename Default>
inline BOOST_CONSTEXPR typename ::boost::enable_if<
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
::boost::mp11::mp_if<
::boost::mp11::mp_if<
::std::is_same<
typename Tag::qualifier
, ::boost::parameter::out_reference
>
, ::boost::mp11::mp_true
, ::std::is_same<
typename Tag::qualifier
, ::boost::parameter::forward_reference
>
>
, ::boost::mp11::mp_if<
::std::is_const<Default>
, ::boost::mp11::mp_false
, ::boost::mp11::mp_true
>
, ::boost::mp11::mp_false
>
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
typename ::boost::mpl::eval_if<
typename ::boost::mpl::if_<
::boost::is_same<
typename Tag::qualifier
, ::boost::parameter::out_reference
>
, ::boost::mpl::true_
, ::boost::is_same<
typename Tag::qualifier
, ::boost::parameter::forward_reference
>
>::type
, ::boost::mpl::if_<
::boost::is_const<Default>
, ::boost::mpl::false_
, ::boost::mpl::true_
>
, ::boost::mpl::false_
>::type
#endif // BOOST_PARAMETER_CAN_USE_MP11
, ::boost::parameter::aux::default_<Tag,Default>
>::type
operator|(Default& d) const
{
return ::boost::parameter::aux::default_<Tag,Default>(d);
}
public: // Insurance against ODR violations
// People will need to define these keywords in header files. To
// prevent ODR violations, it's important that the keyword used in
// every instantiation of a function template is the same object.
// We provide a reference to a common instance of each keyword
// object and prevent construction by users.
static keyword<Tag>& get()
{
static keyword<Tag> result;
return result;
}
private:
keyword() {}
};
template <typename Default>
inline BOOST_CONSTEXPR
::boost::parameter::aux::lazy_default<Tag,Default const>
operator||(Default const& d) const
{
return ::boost::parameter::aux
::lazy_default<Tag,Default const>(d);
}
// Reduces boilerplate required to declare and initialize keywords
// without violating ODR. Declares a keyword tag type with the given
// name in namespace tag_namespace, and declares and initializes a
// reference in an anonymous namespace to a singleton instance of that
// type.
template <typename Default>
inline BOOST_CONSTEXPR
::boost::parameter::aux::lazy_default<Tag,Default>
operator||(Default& d) const
{
return ::boost::parameter::aux::lazy_default<Tag,Default>(d);
}
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
template <typename T>
inline BOOST_CONSTEXPR typename ::boost::lazy_enable_if<
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
::boost::mp11::mp_if<
::std::is_scalar<T>
, ::boost::mp11::mp_false
, ::boost::mp11::mp_if<
::std::is_same<
typename Tag::qualifier
, ::boost::parameter::in_reference
>
, ::boost::mp11::mp_true
, ::std::is_same<
typename Tag::qualifier
, ::boost::parameter::forward_reference
>
>
>
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
typename ::boost::mpl::eval_if<
::boost::is_scalar<T>
, ::boost::mpl::false_
, ::boost::mpl::eval_if<
::boost::is_same<
typename Tag::qualifier
, ::boost::parameter::in_reference
>
, ::boost::mpl::true_
, ::boost::mpl::if_<
::boost::is_same<
typename Tag::qualifier
, ::boost::parameter::forward_reference
>
, ::boost::mpl::true_
, ::boost::mpl::false_
>
>
>::type
#endif // BOOST_PARAMETER_CAN_USE_MP11
, ::boost::parameter::aux::tag<Tag,T const>
>::type
operator=(T const&& x) const
{
typedef typename ::boost::parameter::aux
::tag<Tag,T const>::type result;
return result(::std::forward<T const>(x));
}
# define BOOST_PARAMETER_KEYWORD(tag_namespace,name) \
namespace tag_namespace { struct name; } \
static ::boost::parameter::keyword<tag_namespace::name>& name \
= ::boost::parameter::keyword<tag_namespace::name>::get();
template <typename T>
inline BOOST_CONSTEXPR typename ::boost::lazy_enable_if<
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
::boost::mp11::mp_if<
::std::is_scalar<T>
, ::boost::mp11::mp_false
, ::boost::mp11::mp_if<
::std::is_same<
typename Tag::qualifier
, ::boost::parameter::consume_reference
>
, ::boost::mp11::mp_true
, ::std::is_same<
typename Tag::qualifier
, ::boost::parameter::forward_reference
>
>
>
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
typename ::boost::mpl::eval_if<
::boost::is_scalar<T>
, ::boost::mpl::false_
, ::boost::mpl::eval_if<
::boost::is_same<
typename Tag::qualifier
, ::boost::parameter::consume_reference
>
, ::boost::mpl::true_
, ::boost::mpl::if_<
::boost::is_same<
typename Tag::qualifier
, ::boost::parameter::forward_reference
>
, ::boost::mpl::true_
, ::boost::mpl::false_
>
>
>::type
#endif // BOOST_PARAMETER_CAN_USE_MP11
, ::boost::parameter::aux::tag<Tag,T>
>::type
operator=(T&& x) const
{
typedef typename ::boost::parameter::aux::tag<Tag,T>::type result;
return result(::std::forward<T>(x));
}
#else
template <typename Default>
inline BOOST_CONSTEXPR typename ::boost::enable_if<
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
::boost::mp11::mp_if<
::std::is_scalar<Default>
, ::boost::mp11::mp_false
, ::boost::mp11::mp_if<
::std::is_same<
typename Tag::qualifier
, ::boost::parameter::in_reference
>
, ::boost::mp11::mp_true
, ::std::is_same<
typename Tag::qualifier
, ::boost::parameter::forward_reference
>
>
>
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
typename ::boost::mpl::eval_if<
::boost::is_scalar<Default>
, ::boost::mpl::false_
, ::boost::mpl::eval_if<
::boost::is_same<
typename Tag::qualifier
, ::boost::parameter::in_reference
>
, ::boost::mpl::true_
, ::boost::mpl::if_<
::boost::is_same<
typename Tag::qualifier
, ::boost::parameter::forward_reference
>
, ::boost::mpl::true_
, ::boost::mpl::false_
>
>
>::type
#endif // BOOST_PARAMETER_CAN_USE_MP11
, ::boost::parameter::aux::default_r_<Tag,Default const>
>::type
operator|(Default const&& d) const
{
return ::boost::parameter::aux::default_r_<Tag,Default const>(
::std::forward<Default const>(d)
);
}
#define BOOST_PARAMETER_KEYWORD(tag_namespace,name) \
namespace tag_namespace { struct name; } \
namespace \
{ \
::boost::parameter::keyword<tag_namespace::name>& name \
= ::boost::parameter::keyword<tag_namespace::name>::get(); \
}
template <typename Default>
inline BOOST_CONSTEXPR typename ::boost::enable_if<
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
::boost::mp11::mp_if<
::std::is_scalar<Default>
, ::boost::mp11::mp_false
, ::boost::mp11::mp_if<
::std::is_same<
typename Tag::qualifier
, ::boost::parameter::consume_reference
>
, ::boost::mp11::mp_true
, ::std::is_same<
typename Tag::qualifier
, ::boost::parameter::forward_reference
>
>
>
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
typename ::boost::mpl::eval_if<
::boost::is_scalar<Default>
, ::boost::mpl::false_
, ::boost::mpl::eval_if<
::boost::is_same<
typename Tag::qualifier
, ::boost::parameter::consume_reference
>
, ::boost::mpl::true_
, ::boost::mpl::if_<
::boost::is_same<
typename Tag::qualifier
, ::boost::parameter::forward_reference
>
, ::boost::mpl::true_
, ::boost::mpl::false_
>
>
>::type
#endif // BOOST_PARAMETER_CAN_USE_MP11
, ::boost::parameter::aux::default_r_<Tag,Default>
>::type
operator|(Default&& d) const
{
return ::boost::parameter::aux
::default_r_<Tag,Default>(::std::forward<Default>(d));
}
#endif
public: // Insurance against ODR violations
// Users will need to define their keywords in header files. To
// prevent ODR violations, it's important that the keyword used in
// every instantiation of a function template is the same object.
// We provide a reference to a common instance of each keyword
// object and prevent construction by users.
static ::boost::parameter::keyword<Tag> const instance;
// This interface is deprecated.
static ::boost::parameter::keyword<Tag>& get()
{
return const_cast< ::boost::parameter::keyword<Tag>&>(instance);
}
};
template <typename Tag>
::boost::parameter::keyword<Tag> const ::boost::parameter
::keyword<Tag>::instance = ::boost::parameter::keyword<Tag>();
}} // namespace boost::parameter
#endif // KEYWORD_050328_HPP
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
#if !defined(BOOST_NO_SFINAE)
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/core/enable_if.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/is_scalar.hpp>
#include <boost/type_traits/is_const.hpp>
#endif // BOOST_NO_SFINAE
namespace boost { namespace parameter {
// Instances of unique specializations of keyword<...> serve to
// associate arguments with parameter names. For example:
//
// struct rate_; // parameter names
// struct skew_;
//
// namespace
// {
// keyword<rate_> rate; // keywords
// keyword<skew_> skew;
// }
//
// ...
//
// f(rate = 1, skew = 2.4);
template <typename Tag>
struct keyword
{
typedef Tag tag;
inline BOOST_CONSTEXPR keyword()
{
}
template <typename T>
#if defined(BOOST_NO_SFINAE)
inline typename ::boost::parameter::aux::tag<Tag,T const&>::type
#else
inline BOOST_CONSTEXPR typename ::boost::lazy_enable_if<
typename ::boost::mpl::eval_if<
::boost::is_scalar<T>
, ::boost::mpl::true_
, ::boost::mpl::eval_if<
::boost::is_same<
typename Tag::qualifier
, ::boost::parameter::in_reference
>
, ::boost::mpl::true_
, ::boost::mpl::if_<
::boost::is_same<
typename Tag::qualifier
, ::boost::parameter::forward_reference
>
, ::boost::mpl::true_
, ::boost::mpl::false_
>
>
>::type
, ::boost::parameter::aux::tag<Tag,T const&>
>::type
#endif // BOOST_NO_SFINAE
operator=(T const& x) const
{
typedef typename ::boost::parameter::aux
::tag<Tag,T const&>::type result;
return result(x);
}
template <typename Default>
#if defined(BOOST_NO_SFINAE)
inline ::boost::parameter::aux::default_<Tag,Default const>
#else
inline BOOST_CONSTEXPR typename ::boost::enable_if<
typename ::boost::mpl::eval_if<
::boost::is_scalar<Default>
, ::boost::mpl::true_
, ::boost::mpl::eval_if<
::boost::is_same<
typename Tag::qualifier
, ::boost::parameter::in_reference
>
, ::boost::mpl::true_
, ::boost::mpl::if_<
::boost::is_same<
typename Tag::qualifier
, ::boost::parameter::forward_reference
>
, ::boost::mpl::true_
, ::boost::mpl::false_
>
>
>::type
, ::boost::parameter::aux::default_<Tag,Default const>
>::type
#endif // BOOST_NO_SFINAE
operator|(Default const& d) const
{
return ::boost::parameter::aux::default_<Tag,Default const>(d);
}
template <typename T>
#if defined(BOOST_NO_SFINAE)
inline typename ::boost::parameter::aux::tag<Tag,T&>::type
#else
inline BOOST_CONSTEXPR typename ::boost::lazy_enable_if<
typename ::boost::mpl::eval_if<
typename ::boost::mpl::if_<
::boost::is_same<
typename Tag::qualifier
, ::boost::parameter::out_reference
>
, ::boost::mpl::true_
, ::boost::is_same<
typename Tag::qualifier
, ::boost::parameter::forward_reference
>
>::type
, ::boost::mpl::if_<
::boost::is_const<T>
, ::boost::mpl::false_
, ::boost::mpl::true_
>
, ::boost::mpl::false_
>::type
, ::boost::parameter::aux::tag<Tag,T&>
>::type
#endif // BOOST_NO_SFINAE
operator=(T& x) const
{
typedef typename ::boost::parameter::aux
::tag<Tag,T&>::type result;
return result(x);
}
template <typename Default>
#if defined(BOOST_NO_SFINAE)
inline ::boost::parameter::aux::default_<Tag,Default>
#else
inline BOOST_CONSTEXPR typename ::boost::enable_if<
typename ::boost::mpl::eval_if<
typename ::boost::mpl::if_<
::boost::is_same<
typename Tag::qualifier
, ::boost::parameter::out_reference
>
, ::boost::mpl::true_
, ::boost::is_same<
typename Tag::qualifier
, ::boost::parameter::forward_reference
>
>::type
, ::boost::mpl::if_<
::boost::is_const<Default>
, ::boost::mpl::false_
, ::boost::mpl::true_
>
, ::boost::mpl::false_
>::type
, ::boost::parameter::aux::default_<Tag,Default>
>::type
#endif // BOOST_NO_SFINAE
operator|(Default& d) const
{
return ::boost::parameter::aux::default_<Tag,Default>(d);
}
template <typename Default>
inline BOOST_CONSTEXPR
::boost::parameter::aux::lazy_default<Tag,Default const>
operator||(Default const& d) const
{
return ::boost::parameter::aux
::lazy_default<Tag,Default const>(d);
}
template <typename Default>
inline BOOST_CONSTEXPR
::boost::parameter::aux::lazy_default<Tag,Default>
operator||(Default& d) const
{
return ::boost::parameter::aux::lazy_default<Tag,Default>(d);
}
public: // Insurance against ODR violations
// Users will need to define their keywords in header files. To
// prevent ODR violations, it's important that the keyword used in
// every instantiation of a function template is the same object.
// We provide a reference to a common instance of each keyword
// object and prevent construction by users.
static ::boost::parameter::keyword<Tag> const instance;
// This interface is deprecated.
static ::boost::parameter::keyword<Tag>& get()
{
return const_cast< ::boost::parameter::keyword<Tag>&>(instance);
}
};
template <typename Tag>
::boost::parameter::keyword<Tag> const ::boost::parameter
::keyword<Tag>::instance = ::boost::parameter::keyword<Tag>();
}} // namespace boost::parameter
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
#include <boost/parameter/aux_/name.hpp>
#include <boost/preprocessor/stringize.hpp>
// Reduces boilerplate required to declare and initialize keywords without
// violating ODR. Declares a keyword tag type with the given name in
// namespace tag_namespace, and declares and initializes a reference in an
// anonymous namespace to a singleton instance of that type.
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
#define BOOST_PARAMETER_KEYWORD(tag_namespace, name) \
namespace tag_namespace \
{ \
struct name \
{ \
static BOOST_CONSTEXPR char const* keyword_name() \
{ \
return BOOST_PP_STRINGIZE(name); \
} \
using _ = BOOST_PARAMETER_TAG_PLACEHOLDER_TYPE(name); \
using _1 = _; \
BOOST_PARAMETER_TAG_MP11_PLACEHOLDER_BINDING(binding_fn, name); \
BOOST_PARAMETER_TAG_MP11_PLACEHOLDER_VALUE(fn, name); \
using qualifier = ::boost::parameter::forward_reference; \
}; \
} \
namespace \
{ \
::boost::parameter::keyword<tag_namespace::name> const& name \
= ::boost::parameter::keyword<tag_namespace::name>::instance; \
}
/**/
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
#define BOOST_PARAMETER_KEYWORD(tag_namespace, name) \
namespace tag_namespace \
{ \
struct name \
{ \
static BOOST_CONSTEXPR char const* keyword_name() \
{ \
return BOOST_PP_STRINGIZE(name); \
} \
typedef BOOST_PARAMETER_TAG_PLACEHOLDER_TYPE(name) _; \
typedef BOOST_PARAMETER_TAG_PLACEHOLDER_TYPE(name) _1; \
typedef ::boost::parameter::forward_reference qualifier; \
}; \
} \
namespace \
{ \
::boost::parameter::keyword<tag_namespace::name> const& name \
= ::boost::parameter::keyword<tag_namespace::name>::instance; \
}
/**/
#endif // BOOST_PARAMETER_CAN_USE_MP11
#endif // include guard

Some files were not shown because too many files have changed in this diff Show More