I was wondering if there is something I can do to improve VS handling of shared pointer errors. Consider this code:
std::shared_ptr<Point> blah;
std::shared_ptr<Triangle> blah2;
blah = blah2;
The problem is obvious, but the compiler takes you to memory.h with a very unclear error message. It's hard to trace it back to the code causing the problem. Can anything be done to improve this?
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\memory(579): error C2440: '<function-style-cast>': cannot convert from 'const std::shared_ptr<Triangle>' to 'std::shared_ptr<Point>' 1> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\memory(579): note: No constructor could take the source type, or constructor overload resolution was ambiguous 1> C:\Junk\Src\Thing.cpp(155): note: see reference to function template instantiation 'std::shared_ptr<Point> &std::shared_ptr<Point>::operator =<Triangle>(const std::shared_ptr<Triangle> &) noexcept' being compiled 1> C:\Junk\Src\Thing.cpp(155): note: see reference to function template instantiation 'std::shared_ptr<Point> &std::shared_ptr<Point>::operator =<Triangle>(const std::shared_ptr<Triangle> &) noexcept' being compiled 1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\memory(579): error C2228: left of '.swap' must have class/struct/union