If I have my inner class, which is my own version of vector<char> (I control the source), and for example I cannot change it as std::string , is there any way to steal memory from std::string , like std::string move constructor.
So something like this:
std::string str{"abcdefghijklmnopqrstu"}; MyVectorCharClass mvc(std::move(str));
I think I heard about some future suggestions to add .release() to std::string or std::vector , but I'm talking about the present.
source share