I appreciate that the C ++ 11 standard dictates:
If the class definition does not explicitly declare a copy constructor, one is declared implicitly. If a class definition declares a move constructor or a move carry operator, an implicitly declared copy constructor is defined as deleted ; otherwise, it is defined as default.
(actually copied from here )
The following code:
#include <iostream> struct C { int x = 1; C() { } C(C&&) { } }; int main() { const C c; C c2(c); std::cout << cx << " " << c2.x << std::endl; return 0; }
does not compile on gcc 4.9.0 , but compiles only fine on Visual Studio 2013 ( Compiler Version 18.00.21005.1 for x86 ). Is this another violation of the Visual Studio standard, or am I doing something wrong this time? If this is a violation of the standard, is there a tracking error or any source where this behavior is documented?
c ++ c ++ 11 visual-studio visual-studio-2013
gd1
source share