
From: "David B. Held" <dheld@codelogicconsulting.com>
"Joe Gottman" <jgottman@carolina.rr.com> wrote in message
template<class T> bool operator==(intrusive_ptr<T> const & a, T * b);
I'm curious why the pointer parameters are of type T* and not T const *.
Because that would not allow comparisons between types that are not T const*. Take T == int. With T*, you can compare int*. With T == int const, you get int const*. If you use T const* instead, you won't ever be able to compare int*.
int * p1(0); int const * p2(p1); // OK Notice also that T for instrusive_ptr<T> and for T * is one and the same, so you can't compare intrusive_ptr<T> with T const *. You could only compare intrusive_ptr<T const> with T const *. -- Rob Stewart stewart@sig.com Software Engineer http://www.sig.com Susquehanna International Group, LLP using std::disclaimer;