News for hackers. Stuff that matters.
Re:Writing a custom iterator in modern C++ by DoofusOfDeath on Sunday December 20, 2020 @11:16PM (#25492084)
Honest question: what does it mean for something to be "deprecated" in (specifically) the c++ language spec?
Re:Writing a custom iterator in modern C++ by millstone on Sunday December 20, 2020 @11:40PM (#25492184)
The spec itself defines it as:

Normative for the current edition of the Standard, but having been identified as a candidate for removal from future revisions

This is a very blunt tool. In practice, a feature may be deprecated if it is:

1. Legacy inherited from C that serves no modern purpose. The register keyword.

2. Features hardly anybody implemented. Exported templates is the only example I am aware of. Like falling off the edge of the map.

3. Features that proved to be a bad idea, like incrementing a bool.

4. Features that proved to be wholly inadequate, like codecvt for dealing with Unicode.

5. Features that are reasonably new in C++ but obviated by new stuff. You don't need std::bind if you have lambdas.

This is my outsider's perspective; please chime in if you have standards committee insight.

Re:Writing a custom iterator in modern C++ by ncmncm on Monday December 21, 2020 @02:05PM (#25498210)
strstream was adopted into C++98 with conflicting implementations, so was deprecated at the outset. You are warned not to use the conflicting parts in code meant to be portable.

strstream has not been removed, yet, because spanstream is not in yet. Until that is in, there are certain things only strstream can do: specifically, attach to an existing buffer you need to parse things out of, or to format things into.

Re:Writing a custom iterator in modern C++ by DoofusOfDeath on Monday December 21, 2020 @12:26PM (#25497090)
Thanks for the explanation. Given my impression that the standards committee places very strong emphasis on backwards compatibility, I didn't expect there to be a policy to allow for breaking changes.