我刚刚读到 FastFormat C++ i/o formatting library ,而且看起来好得令人难以置信:甚至比 printf 更快,类型安全,并且具有我认为令人愉悦的界面:
// 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 argument in the order, so first zero followed by 1"
fastformat::write(std::cout, "This writes each argument in the order, so first ", "zero", " followed by ", 1);
这看起来好得令人难以置信。有问题吗?你有过好的、坏的或无所谓的经历吗?
最佳答案
Is there a 'catch' with FastFormat?
上次我检查时,有一个烦人的问题:
你只能使用 either 这个库的窄字符串版本或 这个库的宽字符串版本。 (wchar_t
和 char
的功能是一样的——使用哪种类型是编译时的开关。)
对于 iostreams、stdio 或 Boost.Format,您可以同时使用这两种方法。
关于c++ - FastFormat 有 'catch' 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/446276/