
From: "David B. Held" <dheld@codelogicconsulting.com>
"Rob Stewart" <stewart@sig.com> wrote in message
[...] 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 *.
And the problem with that is?
The original query was why the second arg wasn't T const *. My point is that comparing with a T * would work because T * can be converted to T const * implicitly. The other point is that if you have an instrusive_ptr<int const>, for example, you cannot compare it with an int *, because the function template expects the second argument to be of type int const *. (Actually, it will just complain about not being able to infer T since neither int nor int const will work.) -- Rob Stewart stewart@sig.com Software Engineer http://www.sig.com Susquehanna International Group, LLP using std::disclaimer;