fastformat

Is there a 'catch' with FastFormat?

Deadly 提交于 2020-01-12 02:57:13
问题 I just read about the FastFormat C++ i/o formatting library, and it seems too good to be true: Faster even than printf, typesafe, and with what I consider a pleasing interface: // prints: "This formats the remaining arguments based on their order - in this case we put 1 before zero, followed by 1 again" fastformat::fmt(std::cout, "This formats the remaining arguments based on their order - in this case we put {1} before {0}, followed by {1} again", "zero", 1); // prints: "This writes each

FastFormat on OS X

十年热恋 提交于 2019-12-24 10:17:44
问题 After reading a little about FastFormat, I decided to download and install it on my Macbook Pro, running OS X 10.8. I successfully got FastFormat to build, and ran the performance tests. Then I wrote a small test to check whether it works: #include <cstdlib> #include <fastformat/fastformat.hpp> #include <fastformat/sinks/ostream.hpp> int main() { return EXIT_SUCCESS; } Upon compiling it with g++-4.7 (and making sure that all the include paths were correct), I got compile-time errors, such as

Do C++ formatting libraries generally fall back to *sprintf for numeric formatting?

核能气质少年 提交于 2019-12-07 22:07:07
问题 I am wondering whether "all" C++ formatting libraries eventually fall back to a *sprintf function to format numbers. I am asking this because: Looking at the iostreams library that comes with Visual C++, I can see that numbers input into a stream will eventuall be formatted with sprintf_s . Boost.Format just uses the available iostreams library as far as I can tell. FastFormat eventually uses vsprintf to format a number. So, are there iostreams implementations that do not use *sprintf and do

Do C++ formatting libraries generally fall back to *sprintf for numeric formatting?

*爱你&永不变心* 提交于 2019-12-06 07:01:29
I am wondering whether "all" C++ formatting libraries eventually fall back to a *sprintf function to format numbers. I am asking this because: Looking at the iostreams library that comes with Visual C++, I can see that numbers input into a stream will eventuall be formatted with sprintf_s . Boost.Format just uses the available iostreams library as far as I can tell. FastFormat eventually uses vsprintf to format a number. So, are there iostreams implementations that do not use *sprintf and do the formatting themselves? Are there other formatting libraries that do not forward formatting of