Namespaces
Variants
Views
Actions

Talk:cpp/language/noexcept

From cppreference.com

I tend to believe that the U(U&&) case in the example is a GCC bug. It shall be noexcept also.

why? user-defined destructor prevents the move ctor, and copy ctor generation (which is deprecated in this case) produces noexcept(false) because it has to call vector's copy ctor. If you default U(U&&), you get a "true" there. --Cubbi (talk) 11:09, 20 April 2014 (PDT)
User defined dtor does not prevent move ctor generation in the case of T. good spot about the defaulting U(U&&) 84.52.101.196 11:31, 20 April 2014 (PDT)
Ah ok. I got it. The copy constructor is nothrow in the case of T. Thanks! 84.52.101.196 11:33, 20 April 2014 (PDT)