libyoga:C++ 的现代输出库-源码

上传者: 42178688 | 上传时间: 2021-06-07 20:03:34 | 文件大小: 24KB | 文件类型: ZIP
C++
libyoga - C++ 的现代输出 动机 如果 C++ 程序员想要在命令行中打印一些东西,基本上可以在来自 cstdio 的旧 C 函数或稍微较新的 C++ 流之间进行选择。 这两个接口都有很大的问题: printf-family 是极其危险和愚蠢的: 使用稍微错误的格式字符串会导致未定义的行为。 函数无法推断其参数的类型,它们必须通过格式字符串传递。 使用 typedefed 整数类型编写可移植代码是很可笑的。 正确的解决方案是包含 inttypes.h,它为正确的类型提供宏。 这会导致这样的调用: printf("foo%" PRI64 "bar, uint64_t{0}); 虽然流解决了这些问题,但它们自己也创造了几个问题: 使用流格式化输出非常冗长。 要以十六进制打印具有 16 个字符(前导零)的 uint64_t,必须这样写: stream << std::set

文件下载

资源详情

[{"title":"( 14 个子文件 24KB ) libyoga:C++ 的现代输出库-源码","children":[{"title":"libyoga-master","children":[{"title":"test","children":[{"title":"test.cpp <span style='color:#111;'> 1.76KB </span>","children":null,"spread":false},{"title":"dummy.cpp <span style='color:#111;'> 31B </span>","children":null,"spread":false}],"spread":true},{"title":".ycm_extra_conf.py <span style='color:#111;'> 6.07KB </span>","children":null,"spread":false},{"title":"LICENSE <span style='color:#111;'> 34.32KB </span>","children":null,"spread":false},{"title":"src","children":[{"title":"include","children":[{"title":"yoga.hpp <span style='color:#111;'> 138B </span>","children":null,"spread":false},{"title":"util.hpp <span style='color:#111;'> 682B </span>","children":null,"spread":false},{"title":"print.hpp <span style='color:#111;'> 2.89KB </span>","children":null,"spread":false},{"title":"format.hpp <span style='color:#111;'> 9.00KB </span>","children":null,"spread":false},{"title":"macros.hpp <span style='color:#111;'> 4.40KB </span>","children":null,"spread":false}],"spread":true},{"title":"lib","children":[{"title":"print.cpp <span style='color:#111;'> 4.09KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"makefile <span style='color:#111;'> 681B </span>","children":null,"spread":false},{"title":".gitignore <span style='color:#111;'> 20B </span>","children":null,"spread":false},{"title":"README.md <span style='color:#111;'> 2.74KB </span>","children":null,"spread":false},{"title":"mfc.conf <span style='color:#111;'> 58B </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明