Now I'm rewriting a part of my code to use C++11 standard. In some places I found the following code:
boost::shared_array<uint8_t> array;
Does it make to replace it with:
std::shared_ptr<std::vector<uint8_t>> array;
I'm trying to replace all boost's functionality that already presented in C++11 in my code.
I need to clarify a bit. Actually I need a raw array (but with refcount, so it can be automatically deleted), no need for all those vector features. So boost::shared_array solves the problem I want without any additional cost. But I'm trying to make my code uses new standard as much as possible (though many libraries from boost still not covered by the new standard).
Thanks.
Given the current state of affairs in C++11 support in compilers and the laziness of people maintaing builds, I would leave that as-is now. Boost has the nice property of working virtually everywhere, including old compilers, and the change you want to make will hardly improve the code.
This code also isn't exactly the same.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With