tanzislam / cryptopals

:closed_lock_with_key: My answers to challenges in https://cryptopals.com
GNU General Public License v3.0
8 stars 5 forks source link

Migrate away from std::(i|o)strstream to boost::iostreams replacements #1

Closed tanzislam closed 6 years ago

tanzislam commented 7 years ago

The std::istrstream and std::ostrstream classes are long-deprecated and will be removed in C++17. They have been used as an efficient mechanism to read/write a user-provided character array as a stream, without ownership semantics (i.e. don't assume a particular allocation method and leave deallocation to the user).

The recommended replacements for this use case are boost::iostreams::array_source and boost::iostreams::array_sink.

tanzislam commented 6 years ago

As it turns out, they need to be supplied as an argument to the boost::iostreams::stream<> template.