In a class with a series of ctors (most of which have exactly one argument), I want all one-argument ctors to also be mirrored by a corresponding assignment operator. The ctors include, but are not limited to a copy-ctor and a move-ctor. So this, should satisfy the rule-of-five.
template <typename T>
object& operator=(T&& from) {
// ...
return *this;
}
Here is a minimal example: https://ideone.com/OKprcr (thanks to @Daniel H for pointing out constness).
The error I get is
error: object of type 'object' cannot be assigned because its copy assignment operator is implicitly deleted
...
note: copy assignment operator is implicitly deleted because 'object' has a user-declared move constructor
Why doesn't the function template implement the copy-assignment operator?