On Tuesday 2014-12-23 13:14 -0800, Eric Rescorla wrote: > Just to be clear, is your problem the implicit conversion itself > or the reference count increment/decrement?
The latter -- the problem is that there's an implicit conversion that has surprising side-effects. (It sounds from this discussion like you've written a bunch of code that you wrote the way you did to avoid excess reference-counting, yet there may have been a bunch of excess reference-counting that you didn't know about.) > On the specific topic of what users expect, what you expect may not > be what I expect, but I would observe that both C++11 shared_ptr > and Boost intrusive_ptr (the analog to our RefPtrs> automatically > convert from SmartPtr<Derived> to SmartPtr<Base> and appear to > increment the reference count in the same way that RefPtr does; > this seems to suggest that at least some people do expect it to > behave this way. Ugh. Then again, this wouldn't be the first thing in the standard library that didn't make sense for users who care about performance. -David -- 𝄞 L. David Baron http://dbaron.org/ 𝄂 𝄢 Mozilla https://www.mozilla.org/ 𝄂 Before I built a wall I'd ask to know What I was walling in or walling out, And to whom I was like to give offense. - Robert Frost, Mending Wall (1914)
signature.asc
Description: Digital signature
_______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform