
11 Apr
2008
11 Apr
'08
7:47 a.m.
On Fri, Apr 11, 2008 at 9:38 AM, Sebastian Redl < sebastian.redl@getdesigned.at> 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. Corrado
Sebastian _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost