Poniższy program wypisuje tylko "aaa". Z czego to wynika?
#include <string>
#include <iostream>
using namespace std;
class A
{
const string& str;
public:
A(const string& s) : str(s) {}
void print() {cout << str << endl;}
};
int main()
{
A("aaa").print();
A b("bbb");
b.print();
return 0;
}