29template <
typename HeldType>
inline HeldType *
get_pointer(
const std::weak_ptr<HeldType> &dataItem) {
30 if (std::shared_ptr<HeldType> lockedItem = dataItem.lock()) {
31 return lockedItem.get();
33 throw std::runtime_error(
"Variable invalidated, data has been deleted.");
HeldType * get_pointer(const std::weak_ptr< HeldType > &dataItem)
Boost.Python doesn't understand weak_ptrs out of the box.