[Error] invalid initialization of non-const reference of type 'std::ostream
[b][b]
定义了一个Time类,重载cout输出time类时报错
ostream & operator <<(ostream& os,Time& _t)
{
os<<_t.hour<<':'<<_t.minute<<':'<<_t.second<<endl; return& os;
}
//报错是下面这样的:
[Error] invalid initialization of non-const reference of type 'std::ostream& {aka std::basic_ostream<char>&}' from an rvalue of type 'std::ostream* {aka std::basic_ostream<char>*}
大佬们求解啊