Since copying a std::string object might be expensive changing the ret_b() method to



const std::string& Sam::ret_b() const
{
return b;
}