使用对象的引用作为别名总是安全的吗?例如,一个字符串:
std::string test;
std::string &reftest( test );
std::cout << "test before: " << test << "\n";
std::cout << "reftest before: " << reftest << "\n";
reftest = "abc";
std::cout << "test after: " << test << "\n";
std::cout << "reftest after: " << reftest << "\n";
是否保证 reftest 和 test 将始终具有相同的字符串?