0

The quotation below is seen at cppreference:

std::strstreambuf

Defined in header <strstream>
class strstreambuf : public std::basic_streambuf (deprecated in C++98)

What does the (deprecated in C++98) indicate?

Does it mean that the above constructor of std::strstreambuf is deprecated to be used in C++98 and afterwards?

If that's is true, it seems that std::strstreambuf also should not be used since there is only one constructor for std::strstreambuf and you have no other choice.

As far as I can see, it has nothing to do with the C++ attribute: deprecated.

John
  • 2,963
  • 11
  • 33
  • 3
    It's said very clearly in the notes: `strstream has been deprecated since C++98, std::stringstream and boost::iostreams::array are the recommended replacements.` – shawn Jun 24 '22 at 04:44
  • @shawn Any reference? Where did you see this statement? – John Jun 24 '22 at 04:46
  • The full story is: strstream was deprecated in C++98: https://en.cppreference.com/w/cpp/io/strstream It says: * It essentially wraps a raw array I/O device implementation (std::strstreambuf) * Notes: strstream has been deprecated since C++98, std::stringstream and boost::iostreams::array are the recommended replacements. – shawn Jun 24 '22 at 04:48
  • The term "deprecated" in the C++ standard essentially means "slated for removal from a future version of the C++ standard". Deprecation is about encouraging, not forcing, use of alternatives and the time from deprecation to removal can be short or long (and compiler/library vendors may elect to support removed features anyway). By using a deprecated feature you run the risk of your code ceasing to build or to not work as intended when your compiler/library is updated after a feature is removed from the standard. – Peter Jun 24 '22 at 06:22
  • @Peter -- "deprecated" is weaker than "slated for removal". All it means is that it **might** be removed in the future. **If** you use it and it gets removed later you've got no basis to complain, because you were warned. – Pete Becker Jun 24 '22 at 13:56

0 Answers0