Template Function show_referrers

Function Documentation

template<typename T>
inline ::detail::ref_shower<T> show_referrers(const std::tr1::shared_ptr<T> &ptr, bool self = true, bool weak = false)

Print a list (one per line) of shared_ptr which refer to the same object

Parameters
  • ptr – Use the object pointed to by this shared_ptr

  • self – include or omit a line for this shared_ptr

  • weak – include a line for each weak_ptr (not implemented)

    shared_ptr<int> x;
    std::cout << show_referrers(x);