T
thinktwice
//case 1, works fine
function(..)
{
std:fstream out;
out.open(file);
out << "error info" <<endl;
out.close();
}
//case 2, declare it in a class
class Logger
{
public:
Logger(std::wstring file, std::ios_base:penmode mode /*undefined
too, why?*/){}
private:
std:fstream out; //error c2079, uses undefined class
'std::basic_ofstream<_Elem, _Traits>'
}
btw, how to use ios_basepenmode? is it declared in std namespace?
function(..)
{
std:fstream out;
out.open(file);
out << "error info" <<endl;
out.close();
}
//case 2, declare it in a class
class Logger
{
public:
Logger(std::wstring file, std::ios_base:penmode mode /*undefined
too, why?*/){}
private:
std:fstream out; //error c2079, uses undefined class
'std::basic_ofstream<_Elem, _Traits>'
}
btw, how to use ios_basepenmode? is it declared in std namespace?