[cfe-dev] noexcept and local variables

Marc Glisse marc.glisse at inria.fr
Sat May 28 02:16:07 PDT 2011


On Fri, 27 May 2011, Howard Hinnant wrote:

> I've created __is_swappable<T> and __is_nothrow_swappable<T> to put into the noexcepts everywhere I need to.

Note that I am entirely in favor of these, which deserved imho to be in 
the standard. If I may ask: how does your __is_swappable work?

You provide a default low-priority swap overload (shouldn't it be hidden 
by the way? Leaving it in namespace std looks like it prevents users from 
reusing the same technique in their code), but there is no SFINAE on the 
main swap function preventing it from being chosen so it looks like even 
__is_swappable<__nat>::value is true.

What am I missing?

-- 
Marc Glisse



More information about the cfe-dev mailing list