2차원 vector를 이용해서 matrix를 구현하고 operator *를 만들어서 행렬의 곱을 표현하려했는데
계속 temp*temp*a 부분에서 컴파일 오류가 뜹니다 ㅠ temp*temp 의 *연산이 끝나면 matrix 객체를 반환하고 그 객체와
a를 * 연산하는게 어떤 문제가 있는건지 잘 모르겠습니다 .. 도와주세요 !
다음은 백준의 c++ 컴파일러 기준 컴파일 오류 내용입니다.
error: no match for ‘operator*’ (operand types are ‘matrix’ {aka ‘std::vector<std::vector<long long int> >’} and ‘matrix’ {aka ‘std::vector<std::vector<long long int> >’})
!error: cannot bind non-const lvalue reference of type ‘matrix&’ {aka ‘std::vector<std::vector<long long int> >&’} to an rvalue of type ‘matrix’ {aka ‘std::vector<std::vector<long long int> >’}
chhc0505 2년 전
안녕하세요 코드 31 번 줄에 계속 컴파일 오류가 떠서 질문드립니다.
2차원 vector를 이용해서 matrix를 구현하고 operator *를 만들어서 행렬의 곱을 표현하려했는데
계속 temp*temp*a 부분에서 컴파일 오류가 뜹니다 ㅠ temp*temp 의 *연산이 끝나면 matrix 객체를 반환하고 그 객체와
a를 * 연산하는게 어떤 문제가 있는건지 잘 모르겠습니다 .. 도와주세요 !
다음은 백준의 c++ 컴파일러 기준 컴파일 오류 내용입니다.
error: no match for ‘operator*’ (operand types are ‘matrix’ {aka ‘std::vector<std::vector<long long int> >’} and ‘matrix’ {aka ‘std::vector<std::vector<long long int> >’})
!error: cannot bind non-const lvalue reference of type ‘matrix&’ {aka ‘std::vector<std::vector<long long int> >&’} to an rvalue of type ‘matrix’ {aka ‘std::vector<std::vector<long long int> >’}
긴 글 읽어주셔서 감사합니다