I ran into a code that looks like this:
class Person { ... };
class PersonBuilder{
Person p;
protected:
Person& person;
...
operator Person(){
return std::move(person);
}
};
What does "operator Person()" trying to do? I see that it returns person, but if that was the whole intent, wouldn't the return type be "Person&" instead of operator? Why do we use "operator" here?
Beg your pardon for a naive question, if it is.