안녕하세요 everonye도이 질문에 대한 답을 많이 찾았습니다. 가는 것은 모든 것을 시도하는 그것을 고칠 수 없었다.오류 : 'std :: ostream {aka std :: basic_ostream <char>}'lvalue to 'std :: basic_ostream <char> &&'
그래서 제 질문은 내가 내가
여기error: cannot bind ‘std::ostream {aka std::basic_ostream<char>}’ lvalue to ‘std::basic_ostream<char>&&’
내 방법의 구현 클래스의 모습입니다 오류를 다음 얻을 인라인 방법으로 운영자 < <을 구현하려고 할 때 매트릭스라는 클래스를 가지고있다
ostream& operator<<(ostream& out)
{
for (int i = 0; i < this->getHeight(); ++i) {
for (int j = 0; j < this->getWidth(); ++j) {
out << this->(i, j) << "\t";
}
out<< "\n";
}
return out;
}
나는이
template <typename U>
ostream& operator<<(ostream& out, const Matrix<U>& c)
{
for (int i = 0; i < c.getHeight(); ++i) {
for (int j = 0; j < c.getWidth(); ++j) {
out << c(i, j) << "\t";
}
out << "\n";
}
return out;
}
같은 기능으로 구현
그것은 작동 :( 사람이 내가 잘못 여기
'this -> (i, j)'가 실제로 컴파일됩니까 ?? – Quentin