I want to create an interface for classes that return a message.
My problem is that sometimes it will be better to return a string and sometimes a const string&.
What would be the best way to give inheriting classes the possibility of choosing the return type?
struct Verbose{
// my message is a class member
virtual const string& getMsg()const=0;
// my message is created in the function
virtual string getMsg()const=0;
};