假设您需要引用返回类型;
class foo {
public:
foo& MakeA(float a) {
// MakeA code logic here...
return *this;
}
foo& MakeB(float b) {
// MakeA code logic here...
return *this;
}
}
Run Code Online (Sandbox Code Playgroud)
否则,您只需返回一份副本(foo而不是foo&).