Boost logo

Boost :

From: Corrado Zoccolo (czoccolo_at_[hidden])
Date: 2008-04-11 03:47:00

On Fri, Apr 11, 2008 at 9:38 AM, Sebastian Redl <
sebastian.redl_at_[hidden]> wrote:

> If this variant of swap() is really more efficient, perhaps
> metaprogramming could be used to support it *if* the type has a default
> constructor. But I don't know how to detect this. TypeTraits doesn't
> contain a has_default_constructor trait. It may be that this will only
> work with 09 concepts - DefaultConstructible.

We can use has_nothrow_default_constructor .
This will also exclude the specialization when the default constructor
performs some allocation, and could result in lower performance.


> Sebastian
> _______________________________________________
> Unsubscribe & other changes:

Boost list run by bdawes at, gregod at, cpdaniel at, john at