There is a ThirdParty
class that has member variable std::vector<T> vec
. Unfortunately it provides only readonly access to it: const std::vector<T>& getVec() const;
I have a temporary object of this class and want to extract this vector. Can I somehow cast away the constness and move the vector instead of copying it? Is it safe?
I have a source code of the ThirdParty
class and can check for implementation details if needed.