|
Boost : |
Subject: Re: [boost] [Smart Ptr] make_shared slower than shared_ptr(new) on VC++9 (and 10) with fix
From: Nathan Ridge (zeratul976_at_[hidden])
Date: 2012-04-30 16:47:41
> > The downside of having it be a base class is that classes can now be
> > marked final, which means they can't be used as base classes. This
> > approach was used by libc++ for implementing the same optimization
> > that STL mentions VC's STL implements, but I think they end up falling
> > back to storing it if it's empty and final.
> >
> > I suppose what we really want is static if. :)
>
> Everything you could do with static if you can already do without, just
> with more verbose syntax.
>
> In this particular case, however, I don't see how any if-like technique
> would help. I cannot think of a method to tell whether a type is empty
> without inheriting from it.
But even if there was a way to tell, how would you use an object like
that without aggregating it (and thus having it take up space) or
inheriting from it (which is not allowed)?
Regards,
Nate
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk