I have the following code
class A
{
private:
string s1;
string s2;
string s3;
string s4;
// Need a function f1 which returns one of the 4 strings based on
public:
A()
{
// initialize s1, s2, s3, s4
}
void f2()
{
// will use s1, s2, s3 based on the value returned by f1
// will not modify the string
}
};
What should be the signature of f1?
do any of the following look like the right thing to use
string & f1() ;
const string & f1();