Consider the example below:
template <typename T>
class SomeClass {
// rest of the definition ...
SomeClass<T>& function1() {
// ...
return *this;
}
SomeClass& function2() {
// ...
return *this;
}
}
Is there a difference between return values of the two functions above? If not, which one should be preferred?