Commit Graph

223 Commits

Author SHA1 Message Date
CromwellEnage
2d7414f095 Remove unnecessary BOOST_CONSTEXPR occurrences
Fix Issue #86.
2019-06-28 05:55:16 -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
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
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
CromwellEnage
3bf8242fe4 Eliminate warnings regarding undefined inline functions 2019-01-22 03:19:38 -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
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
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
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
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
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
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
7a430fdfd0
Merge pull request #47 from CromwellEnage/feature_mp11
Introduce support for Boost.MP11
2019-01-14 12:43:30 -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
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
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
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
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
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
Edward Diener
d5cd72d2fd Remove executable permissions. 2018-11-16 21:42:25 -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
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
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
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
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
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
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
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
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
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
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
42c2996cda Revert "Move preprocessor conditional expressions from main() in test/compose.cpp to tagged_argument.hpp" 2018-10-19 13:05:55 -04:00