https://github.com/dacap/format
Experimental C++11 type-safe sprintf like functionality
https://github.com/dacap/format
Last synced: 16 days ago
JSON representation
Experimental C++11 type-safe sprintf like functionality
- Host: GitHub
- URL: https://github.com/dacap/format
- Owner: dacap
- License: mit
- Created: 2016-06-02T22:17:42.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-06-06T15:26:55.000Z (about 10 years ago)
- Last Synced: 2025-02-28T16:19:11.395Z (over 1 year ago)
- Language: C++
- Homepage:
- Size: 22.5 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Format Library
*Copyright (C) 2016 David Capello*
[](https://travis-ci.org/dacap/format)
[](LICENSE.txt)
Example:
#include
#include "format.h"
int main() {
std::cout << format::string("{1}*{1} {0} {2}", "is", 4, 16) << "\n";
}
Prints:
4*4 is 16
## Format one value
Example:
#include
#include "format.h"
int main() {
std::string out;
format::append_value(out, 32);
std::cout << out << "+" << out << " = "
<< format::value(64) << "\n";
}
Prints:
32*32 = 64
## Tested Compilers
* Visual Studio 2015
* Xcode 7.3.1 (`-std=c++11`)
* GCC 4.8.4 (`-std=c++11`)