-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace Boost PP_Iterate by C++11 variadic templates #110
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Less preprocessor is always good 😁
28fcea2
to
167caa2
Compare
ab8f70b
to
1b7bcfc
Compare
This allows support for any number of arguments and makes setting MOCK_MAX_ARGS unnecessary. It also allows for easier debugging due to being able to step into actual code instead of preprocessor generated stuff
MSVC has issues with a tuple of references of incomplete classes and `virtual ~value() = default;` Some compilers warn for constant expressions in the for-loop-condition
Shortens the call sites a lot: `typename ref_arg<Ts>::type` -> `ref_arg_t<Ts>` MSVC 2017 seems to have issues with std::conditional_t so use the C++11 variant here.
No longer required.
This removes the need for those preprocessor macros and the MOCK_MAX_SEQUENCES define.
Chaining is done via the wrapper class not the expectation class
c4d6ee2
to
c8c6af2
Compare
Rebased after #112, now only 7 commits with changed line stats of "+440 −3,924" :D Ok, most of the removed lines are in the benchmark files which are no longer required, but still: Less code ;-)
|
@mat007 After this is merged, I'd prepare a release 2.0.0. The last release is from 19 June 2020, so it's about time... ;-) I'd probably include fixes for the (small) issues #94, #81 and check #69 (comment) (might also be a small breaking change, not sure) Support for method qualifiers (noexcept, rvalue, lvalue, ...) and override will need to wait for the next version or so. I'd also like to rename the
Details don't really matter. Basically: These macros are no longer required and (now) undocumented similar to the TPL-macros, so I'd remove them while we're at it, so we can reuse the name later on for maybe something really different. |
This is basically the continuation of #88
It allows support for (almost) any number of arguments and makes setting MOCK_MAX_ARGS and MOCK_MAX_SEQUENCES unnecessary. The only remaining limitation is imposed by Boost.Preprocessor in
BOOST_PP_REPEAT
which has a large limit (e.g. 256 in 1.69)It also allows for easier debugging due to being able to step into actual code instead of preprocessor generated stuff
Not sure how well git recognizes this but I basically removed the suffix from the
*_template.hpp
files and replaced theBOOST_PP_REPEAT/BOOST_PP_ENUM
macros by variadic templates and parameter pack expansions.It also cuts down on the use of macros which should make the code a bit cleaner and easier to follow. Especially in regard to r-value-references and move-only types (
unique_ptr
...) I suspect a few issues. I'll also include a few cleanups with template aliases I noticed while doing this, e.g.typename arg_type<...>::type