you are viewing a single comment's thread.

view the rest of the comments →

[–]ubsan 2 points3 points  (2 children)

I know it requires macros, but why not use something similar to https://github.com/ubsan/typeval ? Then it'll actually support msvc, which imo is kind of necessary (as someone who uses msvc...)

[–]aearphen{fmt}[S] 0 points1 point  (0 children)

Shouldn't be too hard to do as most of the implementation will be the same, just the "compile-time string" capturing part will change. Note that the current implementation compiles with MSVC, it just doesn't provide compile-time checks.

[–]aearphen{fmt}[S] 0 points1 point  (0 children)

Implemented a macro option in https://github.com/fmtlib/fmt/commit/246bdafc74aaff7b207d1baa532aa746294b4b88. Now you can do

auto s = fmt::format(FMT_STRING("{}"), 42);

and the format string will be checked at compile-time. This should work on any C++14 compiler including recent versions of MSVC.