
22 Apr
2011
22 Apr
'11
6:17 a.m.
On 4/21/2011 10:53 PM, GMan wrote:
I haven't looked too deeply into it, but this syntax seems scary:
shifted_ptr<int> v = new shifted<int>(11);
Is there a way to hide that detail? Perhaps construct with values which internally store shifted<T> from that value? Just seems error prone and unintuitive.
You are referring to intrusive members and this is the approach taken by intrusive_ptr<>. Intrusive members become a problem when multiple inheritance is used and/or virtual inheritance because the intrusive member might or might not be duplicated in the object. Perhaps an abbreviation can be used but for now this is the price to pay to use Shifted Pointer. Thanks, -Phil