std::string
is different from std::vector
because the former have an well-established output format while the latter doesn't. There are some facilities to format containers in fmt/ranges.h
though.
{:.30s}
will always trim the tail. adding the alignment operator just aligns the field after it's been trimmed {:>.30s}
fmt::print
writes the whole message atomically (using one call to the underlying system function), which prevents mixing parts of messages within the process, but I'm not sure if it helps with multiple processes.
Hello, people. How is your day?
Can I get an aid with my problem? I want compile-time checks of parameters correctness (number of param mismatch etc.) with syntax like fmt::format("The answer is {:d}", "forty-two");
. Is that possible? From website I only see alternative format(fmt
kind of syntax that switches to compile time checks instead of throwing exceptions.
I tried DCMAKE_FMT_PEDANTIC=ON
didn't seem to help on both gcc and clang, probably it's doing not what I thought it would.
Reason to do this is to have compile-time checks for another library that uses fmt
(named spdlog
) while not changing anything on spdlog side...
I promise I did research myself prior to asking here, sorry for any trouble. I hope someone else had solution for this, spdlog seems to be quite popular and is mentioned in readme as a fellow library.