>775
なるほどありがとうございます

ということは、追加で質問なのですが

class cA {
public:
  const std::string& GetSTR() { return str; }
private:
  std::string str;
}

int main() {
  cA a;
  std::string b;
  b = a.GetSTR();
  b.append("test");
  return 0;
}

というのは安全なコードでしょうか?