为什么下面的代码能编译进去C++11
而不能编译进去C++03
?(gcc
和cl
)
#include <string>
#include <iostream>
#include <fstream>
int main(int argc, char* argv[]) {
const std::string t("Hello");
std::ofstream out(t);
}
为什么C++03
流不接受std::string
作为构造函数参数?这个决定是基于某事还是偶然发生的?