An open API service indexing awesome lists of open source software.

https://github.com/miroox/type-safe-printf

a type safe printf in c++14
https://github.com/miroox/type-safe-printf

cpp14 printf type-safe

Last synced: about 1 year ago
JSON representation

a type safe printf in c++14

Awesome Lists containing this project

README

          

# 一个类型安全的printf

目前只支持诸如`"%d"`,`"%s"`这样的基本格式

```cpp
int a = 4;
tsprintf("a=%d in %s\n",a); //build failed, missing argument
tsprintf("a=%d in %s\n",__FILE__,a); //build failed, mismatch type
tsprintf("a=%d in %s\n",a++,__FILE__); //ok, and 'a' will be 5
tsprintf("abc%%\n"); //ok
```