News for hackers. Stuff that matters.
Re:Modern C++ for C Programmers: part 5 by datamart on Wednesday July 25, 2018 @11:11AM (#17609863)
The implicitly-declared copy constructor is deleted if there is a user-defined move constructor. See: https://en.cppreference.com/w/cpp/language/copy_constructor#...

So if you define a move constructor and still want your class to have a copy constructor, you'll have to explicitly define the copy constructor, too.

Re:Modern C++ for C Programmers: part 5 by microtherion on Wednesday July 25, 2018 @12:28PM (#17610481)
Luckily, in modern C++, defining the copy constructor in this case (where you just want to make the default available) is as simple as:

    A::A(const A &other) = default;
Re:Modern C++ for C Programmers: part 5 by mikec3010 on Wednesday July 25, 2018 @11:14AM (#17609884)
That makes sense, and hence the "rule of 5" (if you don't want it implicitly deleted). Thanks.