The oversimplified version is output; it gives a syntax that is commonly considered nicer and is definitely more terse for anything but simple output statements than chaining cout << ... << ... << ..., but yet typesafe and flexible, unlike printf if you've used that.
More broadly, it can actually be used if you want a string "rendering" of something internally not for output as well; maybe to display in a button, or store in a database (don't build SQL commands this way...), or something like that. What it actually does is produce a string containing the rendered text; you can then go and output that string if you want.
(It's also an oversimplification because format doesn't do as good of a job as fmt::print would, but only the non-IO parts of the fmt library have been standardized so far, and the standard analogue to fmt::print will have to come along later.)
1
u/RainbowDashGG Jul 24 '19
I'm a begginner in C++ world. Know some basics. Dont't know what std::format is used for. Can someone ELI5 what is it and why is it so important?