boostorg / iostreams

Boost.org iostreams module
http://boost.org/libs/iostreams
Boost Software License 1.0
42 stars 119 forks source link

Remove redundant copy constructor. #160

Open ecatmur opened 1 year ago

ecatmur commented 1 year ago

Since C++11, a user-declared copy constructor deprecates the copy assignment operator.

This change allows clean compilation with the -Wdeprecated-copy/-Wdeprecated-copy-with-user-provided-ctor flag.

mclow commented 1 year ago

is this redundant? In C++03? An alternative approach would be to define the copy-assignment operator.

ecatmur commented 1 year ago

Yes, this is Note 113 in C++03:

113) Because a template constructor is never a copy constructor, the presence of such a template does not suppress the implicit declaration of a copy constructor. Template constructors participate in overload resolution with other constructors, including copy constructors, and a template constructor may be used to copy an object if it provides a better match than other constructors.

I can add the copy assignment operator if you'd prefer.