-
Notifications
You must be signed in to change notification settings - Fork 9
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
emplace_back instead of push_back #57
Comments
Since
that would construct a temporary
This SO answer confirms my reasoning. P.S.: I might take a couple days before I get the chance to go through your PR. Thanks for the contribution! |
With array.emplace_back(); which would create the |
Ah, yes. That makes sense. Even if If you end up making another commit in your PR, you may go ahead and change it. This change is too trivial to warrant a separate PR. |
On second thought, shouldn't this just be array.emplace_back(std::get<N>(std::move(tuple)));
assignFromTuple<N+1, Ts...>(array, std::move(tuple)); I see the tests cover the |
Yes, you're absolutely right. I had not looked at the "bigger picture" when you first raised the issue. Thanks for catching this. Can you slip that in your PR? |
This is horribly trivial, but is there a particular reason not to use
emplace_back
instead ofpush_back
here?cppwamp/cppwamp/include/cppwamp/internal/varianttuple.ipp
Line 46 in 8486792
I just happened to notice it while looking at #55.
The text was updated successfully, but these errors were encountered: