[C++] Item 1: Understand template type deduction
By 기술 노트 | 2017년 9월 17일 |
Item 1: Understand template type deduction---------------------------------------------------------- auto는 template에 대한 type deduction (형식 연역)에 근간을 둠단, auto는 template에 비해 덜 직관적 임auto를 잘 활용하려면 template type deduction의 모습을 잘 이해 해야함 template의 형태 template<typename T>void f(ParamType param); f(expr); 의 형태로 호출 T에 대한 형식과 ParamType에 대해 연역(추론)하게 됨ParamType은 const와 같은 adornments (꾸밈)을 추가하는 경우가