[C++] "no matching function for call to 'function_name'" 해결


[C++]

이 글에서는 C++에서 흔히 발생하는 "no matching function for call to 'function_name'" 에러를 해결하는 방법에 대해 설명합니다. 문제 상황과 원인 분석, 그리고 두 가지 해결 방법을 자세히 살펴봅니다. 문제상황 아래는 실무에서 사용될 수 있는 코드의 예시입니다. 이 코드에서는 사용자 정의 클래스 CustomVector와 이 클래스의 인스턴스를 정렬하는 함수 sort_custom_vectors를 사용하고 있습니다. #include #include #include class CustomVector { public: int x, y; CustomVector(int x, int y) : x(x), y(y) {} }; bool compare_custom_vectors(co..


원문링크 : [C++] "no matching function for call to 'function_name'" 해결