19 Mar
2014
19 Mar
'14
7:26 a.m.
2014-03-19 15:13 GMT+08:00 Antony Polukhin
2014-03-14 10:22 GMT+04:00 feverzsj
: <...> why not supply a interface like:
Val& v = var.assign(val);
for simplity, and the unnecessary "get" is also elimited.
Such interface is not common for C++. Most programmers are used to the following:
class_name& class_name::operator=(const class_name&); or class_name& class_name::operator=(const class_internal&);
While you propose to implement `class_internal& class_name::operator=(const class_internal&);`
I don't think he's proposing that for operator=, but a not-yet-exist assign method. Seems reasonable to me, sometimes we do want to do some immediate operations after the assignment.