これって安全です?
関数呼び出しのカッコ内で生成されるオブジェクトの生存期間がよくわかんなくなり・・・

std::string helloFunc() {
  return std::string("hello1");
}
struct HelloStruct {
  std::string text;
  HelloStruct() { text = "hello2"; }
  operator const char*() { return text.c_str(); }
};
printf("test1:%s\n", helloFunc().c_str());
printf("test2:%s\n", (const char*)HelloStruct());

VC++でデバッガで追うとstd::stringのデストラクタは安全なタイミングで呼ばれてるんですが
他のコンパイラに持っていっても問題ないのかなと