Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Type traits in VS2013

int main()
{
  struct C {
    C(const C&) = delete;
    C& operator= (const C&) = delete;

    C(C&&) {}
    C& operator=(C&&) { return *this; }
  };
  static_assert(std::is_copy_constructible<C>::value &&
                    std::is_copy_constructible<C>::value,
                "");
}

Why above code can be successfully compiled in VS2013?

like image 688
QingYun Avatar asked Mar 22 '26 13:03

QingYun


1 Answers

This seems to be a known bug.

Link1: http://connect.microsoft.com/VisualStudio/feedback/details/800328/std-is-copy-constructible-is-broken

Link2: http://connect.microsoft.com/VisualStudio/feedback/details/802032/std-is-copy-constructible-doesnt-work-correctly

like image 183
Csq Avatar answered Mar 25 '26 02:03

Csq



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!