-
Notifications
You must be signed in to change notification settings - Fork 7
client: use universal reference in data decoder #115
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
Conversation
7163e57
to
b1022fb
Compare
Ignoring clang-format suggestion: diff --git a/src/Client/ResponseReader.hpp b/src/Client/ResponseReader.hpp
index 3cac8dc..1d5c82a 100644
--- a/src/Client/ResponseReader.hpp
+++ b/src/Client/ResponseReader.hpp
@@ -101,8 +101,7 @@ struct Data {
std::pair<it_t, it_t> iters;
/** Unpacks tuples to passed container. */
- template<class T>
- bool decode(T&& tuples)
+ template <class T> bool decode(T &&tuples)
{
it_t itr = iters.first;
bool ok = mpp::decode(itr, std::forward<T>(tuples)); |
GitHub Actions has deprecated `ubuntu-20.04`, its jobs are getting canceled often and it is going to be completely removed in a few weeks, so let's replace it with the newer `ubuntu-24.04` version.
Lately, CMake 4.0 was released, and some GitHub Actions runners started to use it. CMake 4.0 does not support versions older than 3.5 anymore, and we fetch MsgPuck library for the tests that requires 2.8 minimum version. Let's override minimum required version with CMake option in order to generate build files of MsgPuck successfully.
978acac
to
f27d653
Compare
The new warning forbids to move an objects to itself - in our case, it's the purpose of the case, so let's ignore the warning there. The problem failed build on `ubuntu-24.04` GitHub Actions runner.
Some compilers produce a warning when variable-length arrays are used, so using them in buffer test failed CI on `ubuntu-24.04` GitHub Actions runner. We don't use VLAs across the connector, so let's simply get rid of them in the buffer test - mark variables used for their sizes as `constexpr`.
Our MsgPack decoder allows to pass rvalue reference - it is needed to use tags like `mpp::as_raw` or handy `std::forward_as_tuple` helper. However, we accept only lvalues in the data decoder, hence, client cannot use those features of MsgPack decoder. Let's accept universal reference instead to accept both lvalues and rvalues in client data decoder - do not forget to use `std::forward` for perfect passing. Closes tarantool#106
f27d653
to
b50f17a
Compare
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.
LGTM, but please address my questions.
@drewdzzz I don't like that we keep ignoring linter suggestions. Let's try to figure out how to make it useful. I guess we need to:
I would do 1 for a while (e.g., in this case, we need to tweak the |
Yep, there is even issue #92 dedicated to our annoying linter. Are you OK with merging this PR without fixing linter? |
See commits for details.
The PR fixes CI along the way.
Closes #106