【发布时间】:2012-02-27 22:18:11
【问题描述】:
为什么下面的代码在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 作为构造函数参数? 这个决定是基于某事还是偶然发生的?
【问题讨论】:
标签: c++ c++11 fstream c++03 library-design