Unverified Commit 8bbb0b48 authored by Victor Zverovich's avatar Victor Zverovich Committed by GitHub

Update README.rst

parent 5c0101ab
...@@ -429,6 +429,29 @@ or the bloat test:: ...@@ -429,6 +429,29 @@ or the bloat test::
$ make bloat-test $ make bloat-test
FAQ
---
Q: how can I capture formatting arguments and format them later?
A: use ``std::tuple``:
.. code:: c++
template <typename... Args>
auto capture(const Args&... args) {
return std::make_tuple(args...);
}
auto print_message = [](const auto&... args) {
fmt::print(args...);
};
// Capture and store arguments:
auto args = capture("{} {}", 42, "foo");
// Do formatting:
std::apply(print_message, args);
License License
------- -------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment