-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Don't explicitly delete copy ctor of dynamic_format_arg_store #2664
Conversation
Explicitly deleting the copy ctor causes the move constructor to not be implicitly generated. This behaviour is different than what was in v8.0.1 and causes code that relied on the move ctor of dynamic_format_arg_store to break.
Thanks for the PR. Could you elaborate why you need a move ctor? |
Yes, of course. I want to use Quill, which is a low-latency asynchronous logging library that uses fmtlib. The following class has a member of type dynamic_format_arg_store, and needs to support move operations: |
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.
Makes sense but please add a unit test for the move ctor in https://github.com/fmtlib/fmt/blob/master/test/args-test.cc.
Added test for move ctor. Did you also want a test for move assignment? |
test/args-test.cc
Outdated
const char* const test_c_string = "foo"; | ||
|
||
auto store_uptr = | ||
std::make_unique<fmt::dynamic_format_arg_store<fmt::format_context>>(); |
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.
std::make_unique
- C++14+
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.
fixed
Thank you |
Explicitly deleting the copy ctor causes the move constructor to not be
implicitly generated. This behaviour is different than what was in
v8.0.1 and causes code that relied on the move ctor of
dynamic_format_arg_store to break.