[cfe-dev] noexcept and local variables

Howard Hinnant hhinnant at apple.com
Sat May 28 07:37:51 PDT 2011


On May 28, 2011, at 5:16 AM, Marc Glisse wrote:

> 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?

Yes.

> 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.

You are completely correct.

> 
> What am I missing?

Not a thing, thanks!

I'll be checking in a fix shortly (mixed in with noexcept for <memory>).

Howard




More information about the cfe-dev mailing list