We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
fmt::detail
Writing a function that can take a regular format string as an argument is pretty straightforward: https://github.com/SwooshyCueb/irods/blob/5ceb3b6b99b19478ebb9f1681d3432f1e037472d/server/core/include/irods/notify_service_manager.hpp#L46-L70
However, I can't figure out how to declare an overload that can take a compiled format string without dipping into fmt::detail: https://github.com/SwooshyCueb/irods/blob/5ceb3b6b99b19478ebb9f1681d3432f1e037472d/server/core/include/irods/notify_service_manager.hpp#L72-L99
There doesn't seem to be any documentation on how this might be done. Is this the proper solution?
The text was updated successfully, but these errors were encountered:
I don't know if this is exactly the best way, but this is how I do it. For a variadic function that takes a format string plus arguments:
template <typename... Args> void fmt(fmt::format_string<Args...> fmt, Args&&... args) { vfmt(fmt, fmt::make_format_args(args...)); }
then to define the vfmt() method that accepts an already-compiled set of stuff it's just:
void vfmt(fmt::string_view fmt, fmt::format_args args) { auto msg = fmt::vformat(fmt, args); }
Is that helpful?
Sorry, something went wrong.
That doesn't seem to work: https://godbolt.org/z/cze1sv1qf
You are right that this relies on the internal APIs at the moment. A PR to move is_compiled_string to the public API would be welcome.
is_compiled_string
Successfully merging a pull request may close this issue.
Writing a function that can take a regular format string as an argument is pretty straightforward:
https://github.com/SwooshyCueb/irods/blob/5ceb3b6b99b19478ebb9f1681d3432f1e037472d/server/core/include/irods/notify_service_manager.hpp#L46-L70
However, I can't figure out how to declare an overload that can take a compiled format string without dipping into
fmt::detail
:https://github.com/SwooshyCueb/irods/blob/5ceb3b6b99b19478ebb9f1681d3432f1e037472d/server/core/include/irods/notify_service_manager.hpp#L72-L99
There doesn't seem to be any documentation on how this might be done. Is this the proper solution?
The text was updated successfully, but these errors were encountered: