5 ms·
A leaner <iostream> in libstdc++ for GCC 13
- i-use-nixos-btw 4y agoWait, people still include <iostream>? In 2023?
- i-use-nixos-btw 4y ago(This is a little tongue in cheek, but seriously, fmtlib and libscn surpass iostreams in every conceivable way)
- 3836293648 4y agoSure, but old code still exists and gets rebuilt
- KRAKRISMOTT 4y agoThe two you mentioned don't support streams. Streams make typing string concatenation code much more convenient than having to deal with nested parens.
- Night_Thastus 4y agoNot everyone has the option of using whatever popular library happens to be around. Some of us are stuck with whatever the standard gives us, and not always the most recent one either.
- pjmlp 4y agoYes, it is available everywhere, doesn't require an additional dependency on older compilers and not everyone hates iostreams, some of us are happy users since 1993 (my first C++ program).
- simplotek 4y ago> Wait, people still include <iostream>? In 2023? Yes, extensively. You need a very good reason not to. Do you have one?
- z_open 4y agoIt's hideous, verbose, and uses global formatting settings.
- pjmlp 4y agoBeauty is in the eyes of the beholder.
- i-use-nixos-btw 4y agoYou do not need a very good reason not to. This ain’t the 90s, so whether something is in the standard or whether it is from a third party is broadly irrelevant. It’s just a question of picking the best tool for the job. And thus far, that best tool is fmt. The syntax is cleaner, it’s more configurable without horrible side effects, the resulting operations are more efficient, and as a project it is still being actively improved over time. As far as I’m concerned, iostreams are deprecated.
- xigoi 4y ago> whether something is in the standard or whether it is from a third party is broadly irrelevant. In context where I have to use C++ (programming contests, school), I'm not allowed to use external libraries. In contexts where I'm allowed to choose the programming language, I wouldn't use C++ in the first place.
- simplotek 4y ago> You do not need a very good reason not to. Actually you do. One is a component specified by international standards, which is ideal, while the other is yet another third party component. Unless you only work on hobby projects, adding dependencies is a maintenance liability. You need very good and compelling reasons to add a dependency, and it doesn't seem you have any. > And thus far, that best tool is fmt. You gave zero reasons to support your personal assertion. It's fine if you just hack stuff together in hobby projects, but pros doing pro work have to meet professional standards, which you failed to address.
- 3836293648 4y agoI'm surprised that it doesn't just compile down to a puts call. If they can do it with a printf that doesn't have any formatting, why not cout? Probably some dumb detail in the standard preventing it