8.11 Function overload resolution and ambiguous matches

주홍영·2022년 3월 13일
0

Learncpp.com

목록 보기
87/199

https://www.learncpp.com/cpp-tutorial/function-overload-resolution-and-ambiguous-matches/

만약 type이 exactly하게 일치하지 않은 경우
어떻게 컴파일러가 해결하는지에 대한 내용
예를들어
파라미터 타입이 int 혹은 double인 경우
넘겨준 argument가 char인 경우 모호성이 발생했는데 어떻게 처리할까?
이런 경우 type promotion으로 int로 변환해서 int 호출
만약 float 이면 double 함수 호출

이러한 내용으로 구체적으로 알고 싶으면 링크 참조

단어장

attributes : 속성
we discussed which attributes of a function are used to differentiate overloaded functions

profile
청룡동거주민

0개의 댓글