compile-time-printer
compile-time-printer copied to clipboard
Prints values and types during compilation!
Closes #11
See https://docs.python.org/3/library/functions.html#print
Request is out: https://github.com/compiler-explorer/compiler-explorer/issues/2392
```cpp constexpr auto test = ctp::printf( "┌{0:─^{2}}┐\n" "│{1: ^{2}}│\n" "└{0:─^{2}}┘\n", "", "Hello, world!", 20); ``` Should print: ``` ┌────────────────────┐ │ Hello, world! │ └────────────────────┘ ```
`ctp::print(ctp::file_descriptor("log.txt"), "Hello World", 42);`
See https://github.com/Viatorus/compile-time-printer/blob/d1dacb32942e4de6d6025e5b7cf7b665f9c584b5/tests/test_main.py#L137-L140
```cpp auto dur = ctp::bench(1 /* id */, []{ // code... }); ctp::print(dur); // 1s 12 ms ```
I think I briefly saw somewhere use of this project as a way to include limited C++ snippets that are "run" at text generation time without the need for some...