diff --git a/README.md b/README.md index 0c94b40..da5b7f6 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,16 @@ Include soi and you're ready to go! -## dbg(...) +## Features -You can debug any expressions using the macro dbg(). +- includes all headers (a `bits/stdc++.h` that works on all platforms) +- has a powerful `dbg()` macro +- disables output buffering +- checks whether all input has been read +- removes evil functions from the standard library such as new and printf. +- defines int to 64 bit + +The header requires at least C++11. ## Configuration @@ -21,7 +28,7 @@ this check using `SOI_EOFCHECK=1`. ## Template Using this header is as simple as: -``` +```c++ #include signed main() { @@ -29,4 +36,24 @@ signed main() { } ``` -It requires at least c++11 to function. +## Example +See example.cpp for a larger example. + +```c++ +#include +signed main() { + dbg("hi"); + vector pi{3,1,4,1,5,9,2,6}; + dbg(pi); + int x=4; + dbg(x+3); +} +``` + +prints: + +``` +[test.cpp:3 (main)] hi +[test.cpp:5 (main)] pi = [3, 1, 4, 1, 5, 9, 2, 6] (vector) +[test.cpp:7 (main)] x+3 = 7 (long int) +```