K
ketan
Hi,
While reading the Boost::shared_ptr implementation, I came across this
method
template<class T> class shared_ptr
{
.....
template<class Y>
shared_ptr(shared_ptr<Y> const & r, boost::detail::const_cast_tag):
px(const_cast<element_type *>(r.px)), pn(r.pn)
{
}
....
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
private:
template<class Y> friend class shared_ptr;
template<class Y> friend class weak_ptr;
#endif
T * px; // contained pointer
boost::detail::shared_count pn; // reference counter
};
Does it mean that px and pn are public members ? As it seems from its
usage in dynamic casting.
My understanding is correct or am I missing anything?
-ketan
While reading the Boost::shared_ptr implementation, I came across this
method
template<class T> class shared_ptr
{
.....
template<class Y>
shared_ptr(shared_ptr<Y> const & r, boost::detail::const_cast_tag):
px(const_cast<element_type *>(r.px)), pn(r.pn)
{
}
....
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
private:
template<class Y> friend class shared_ptr;
template<class Y> friend class weak_ptr;
#endif
T * px; // contained pointer
boost::detail::shared_count pn; // reference counter
};
Does it mean that px and pn are public members ? As it seems from its
usage in dynamic casting.
My understanding is correct or am I missing anything?
-ketan