[c++ korea] effective modern c++ study item 6 use the explicitly typed initializer idiom when auto...
TRANSCRIPT
Effective Modern C++ StudyC++ Korea
Effective Modern C++ StudyC++ Korea3
Effective Modern C++ StudyC++ Korea4
Effective Modern C++ StudyC++ Korea
std::vector<T>의 operator[]는 T&를 반환하지만 C++에서bit에 대한 참조는 불가능하다.
highPriorty를 초기화 하기위해 bool (bool &가아니다.)로암시적형변환이일어나게된다. (내부에 bool캐스팅연산자있음)
6
Effective Modern C++ StudyC++ Korea7
Effective Modern C++ StudyC++ Korea8
Effective Modern C++ StudyC++ Korea9
Click to Project.
Effective Modern C++ StudyC++ Korea12
Effective Modern C++ StudyC++ Korea13
Effective Modern C++ StudyC++ Korea14
Effective Modern C++ StudyC++ Korea15
Effective Modern C++ StudyC++ Korea16
‘Invisible’ proxy타입은 auto의 타입을 추론하는 초기화 식에서 “잘못된” 타입으로 추론될 수 있다.
명시적인 타입 초기화자 조언은 auto가 원하는 타입으로 추론되도록 강제할 수 있다.