-
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
Add copy constructor for dynamic_format_arg_store #2432
Add copy constructor for dynamic_format_arg_store #2432
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.
Thanks for the PR. A few small comments inline.
Also please add a test case to https://github.com/fmtlib/fmt/blob/master/test/args-test.cc. |
afdc42c
to
8fa46fe
Compare
64d8f75
to
940496a
Compare
940496a
to
55d3c48
Compare
@DanielaE, do you know why msvc complains about |
The good news: Spiros' changes are fine, everything builds and all tests pass with msvc 16.10, 16.11-pre3 and 17.0-pre2. 🎉 The bad news: CI has a new windows-2019 image with CMake 3.21 instead of 3.20. The compiler is still the same (16.10.2) I will probably not find enough time today though to switch my local build environment to CMake 3.21 and look into differences in |
Everything builds locally with CMake 3.21! 😱 |
I accidentally closed this PR, so I reopened it. Is there any progress as far as the Cmake issues? @DanielaE |
I just found out that the CMake generators "Visual Studio 16 2019" and "Visual Studio 17 2022" are 'improved' in CMake 3.21 in the sense that they are broken: they swallow the compiler option
Whatever I've tried to hide these compiler options from being processed by the generators fell flat. |
In that case I suggest temporarily setting Line 89 in 5618346
|
Thank you! |
Thanks, @DanielaE, for looking into it! |
@vitaut I saw in the newest version of fmt this copy-constructor was deleted. Would it be possible to explain why? |
IIRC it was broken, you can look up the commit history for more details. |
I looked it up, there was not a PR for the commit that did that (be51ee1) or further explanation apart from broken. I am asking because https://github.com/Kitware/ParaView relies on that. Edit: I just saw #2653. so i am gonna follow up there, |
@spyridon97 do you know if the CMake issue was addressed which ran afoul with IFC generation? |
Issue: https://gitlab.kitware.com/cmake/cmake/-/issues/22477 has been merged |
The goal of the PR is to develop a copy constructor (and default constructor) for the
dynamic_format_arg_store
.The reason behind the need for a copy-constructor as stated in #2431 is that I would like to be able to instantiate a dynamic_format_arg_store object using another one to emulate a scope of arguments based on the class hierarchy of my code.
For the implementation of the copy-constructor, the members:
data_
andnamed_info_
have been copied, whiledynamic_args_
remained untouched because it also did not have a copy constructor or an iterator to implement a copy constructor.Using the implementation included in this PR i was able to successfully do something like below:
Because of the new copy constructor,
dArgs
includes the first 3 variables, anddArgs2
includes the first 3 variables plus the 4th one.