Why does the following code compile in C++11
and does not in C++03
? (both gcc
and cl
)
#include <string>
#include <iostream>
#include <fstream>
int main(int argc, char* argv[]) {
const std::string t("Hello");
std::ofstream out(t);
}
Why don't the C++03
streams accept std::string
as the constructor parameter? Was this decision based on something or did it happen accidentally?