Skip to content

ResourceAndRole: explicitly handle weak_ptr to shared_ptr casts

Ben Boeckel requested to merge ben.boeckel/smtk:centos-compile-failures into master

The C++ standard's std::shared_ptr only provides an explicit constructor from std::weak_ptr that throws if the std::weak_ptr doesn't have any strong references left. GCC 7 refuses to compile the previous code since there is no eligible constructor between the two. Instead, explicitly loop and only add resources which successfully lock.


Cc: @john.tourtellott

Merge request reports