我正在尝试使用以下C ++类来使用流运算符<<记录this answer的内容:
Log( "/tmp/my.log" ) << 1 << std::endl;
这适用于许多情况。但是,在尝试流/usr/include/c++/7/string_view:558:5: note: template argument deduction/substitution failed:
My.cpp:375:36: note: 'Log' is not derived from 'std::basic_ostream<_CharT, _Traits>'
Log( "/tmp/my.log" ) << 1 << std::endl;
^~~~
时,它无法编译,
std:endl
,发出如下错误:
{{1}}
如何使其与{{1}}一起使用?