cpptoml
cpptoml copied to clipboard
Explicitly std::move to avoid copying on older compilers.
Discovered when compiling with clang++-8:
cpptoml.h:1725:12: error: prior to the resolution of a defect report against ISO
C++11, local variable 'result' would have been copied despite being returned by name, due to its not
matching the function return type ('shared_ptr<cpptoml::base>' vs 'shared_ptr<cpptoml::array>')
[-Werror,-Wreturn-std-move-in-c++11]
return result;
^~~~~~
cpptoml.h:1725:12: note: call 'std::move' explicitly to avoid copying on older
compilers
return result;
^~~~~~
std::move(result)