[C++ korea] effective modern c++ study item 6 use the explicitly typed initializer idiom when auto...
-
Upload
giyeon-bang -
Category
Software
-
view
99 -
download
1
Transcript of [C++ korea] effective modern c++ study item 6 use the explicitly typed initializer idiom when auto...
![Page 1: [C++ korea] effective modern c++ study item 6 use the explicitly typed initializer idiom when auto deduces undesired types +방기연](https://reader034.fdocuments.net/reader034/viewer/2022042607/55a930ac1a28ab732a8b459c/html5/thumbnails/1.jpg)
Effective Modern C++ StudyC++ Korea
![Page 2: [C++ korea] effective modern c++ study item 6 use the explicitly typed initializer idiom when auto deduces undesired types +방기연](https://reader034.fdocuments.net/reader034/viewer/2022042607/55a930ac1a28ab732a8b459c/html5/thumbnails/2.jpg)
![Page 3: [C++ korea] effective modern c++ study item 6 use the explicitly typed initializer idiom when auto deduces undesired types +방기연](https://reader034.fdocuments.net/reader034/viewer/2022042607/55a930ac1a28ab732a8b459c/html5/thumbnails/3.jpg)
Effective Modern C++ StudyC++ Korea3
![Page 4: [C++ korea] effective modern c++ study item 6 use the explicitly typed initializer idiom when auto deduces undesired types +방기연](https://reader034.fdocuments.net/reader034/viewer/2022042607/55a930ac1a28ab732a8b459c/html5/thumbnails/4.jpg)
Effective Modern C++ StudyC++ Korea4
![Page 5: [C++ korea] effective modern c++ study item 6 use the explicitly typed initializer idiom when auto deduces undesired types +방기연](https://reader034.fdocuments.net/reader034/viewer/2022042607/55a930ac1a28ab732a8b459c/html5/thumbnails/5.jpg)
![Page 6: [C++ korea] effective modern c++ study item 6 use the explicitly typed initializer idiom when auto deduces undesired types +방기연](https://reader034.fdocuments.net/reader034/viewer/2022042607/55a930ac1a28ab732a8b459c/html5/thumbnails/6.jpg)
Effective Modern C++ StudyC++ Korea
std::vector<T>의 operator[]는 T&를 반환하지만 C++에서bit에 대한 참조는 불가능하다.
highPriorty를 초기화 하기위해 bool (bool &가아니다.)로암시적형변환이일어나게된다. (내부에 bool캐스팅연산자있음)
6
![Page 7: [C++ korea] effective modern c++ study item 6 use the explicitly typed initializer idiom when auto deduces undesired types +방기연](https://reader034.fdocuments.net/reader034/viewer/2022042607/55a930ac1a28ab732a8b459c/html5/thumbnails/7.jpg)
Effective Modern C++ StudyC++ Korea7
![Page 8: [C++ korea] effective modern c++ study item 6 use the explicitly typed initializer idiom when auto deduces undesired types +방기연](https://reader034.fdocuments.net/reader034/viewer/2022042607/55a930ac1a28ab732a8b459c/html5/thumbnails/8.jpg)
Effective Modern C++ StudyC++ Korea8
![Page 9: [C++ korea] effective modern c++ study item 6 use the explicitly typed initializer idiom when auto deduces undesired types +방기연](https://reader034.fdocuments.net/reader034/viewer/2022042607/55a930ac1a28ab732a8b459c/html5/thumbnails/9.jpg)
Effective Modern C++ StudyC++ Korea9
![Page 10: [C++ korea] effective modern c++ study item 6 use the explicitly typed initializer idiom when auto deduces undesired types +방기연](https://reader034.fdocuments.net/reader034/viewer/2022042607/55a930ac1a28ab732a8b459c/html5/thumbnails/10.jpg)
Click to Project.
![Page 11: [C++ korea] effective modern c++ study item 6 use the explicitly typed initializer idiom when auto deduces undesired types +방기연](https://reader034.fdocuments.net/reader034/viewer/2022042607/55a930ac1a28ab732a8b459c/html5/thumbnails/11.jpg)
![Page 12: [C++ korea] effective modern c++ study item 6 use the explicitly typed initializer idiom when auto deduces undesired types +방기연](https://reader034.fdocuments.net/reader034/viewer/2022042607/55a930ac1a28ab732a8b459c/html5/thumbnails/12.jpg)
Effective Modern C++ StudyC++ Korea12
![Page 13: [C++ korea] effective modern c++ study item 6 use the explicitly typed initializer idiom when auto deduces undesired types +방기연](https://reader034.fdocuments.net/reader034/viewer/2022042607/55a930ac1a28ab732a8b459c/html5/thumbnails/13.jpg)
Effective Modern C++ StudyC++ Korea13
![Page 14: [C++ korea] effective modern c++ study item 6 use the explicitly typed initializer idiom when auto deduces undesired types +방기연](https://reader034.fdocuments.net/reader034/viewer/2022042607/55a930ac1a28ab732a8b459c/html5/thumbnails/14.jpg)
Effective Modern C++ StudyC++ Korea14
![Page 15: [C++ korea] effective modern c++ study item 6 use the explicitly typed initializer idiom when auto deduces undesired types +방기연](https://reader034.fdocuments.net/reader034/viewer/2022042607/55a930ac1a28ab732a8b459c/html5/thumbnails/15.jpg)
Effective Modern C++ StudyC++ Korea15
![Page 16: [C++ korea] effective modern c++ study item 6 use the explicitly typed initializer idiom when auto deduces undesired types +방기연](https://reader034.fdocuments.net/reader034/viewer/2022042607/55a930ac1a28ab732a8b459c/html5/thumbnails/16.jpg)
Effective Modern C++ StudyC++ Korea16
![Page 17: [C++ korea] effective modern c++ study item 6 use the explicitly typed initializer idiom when auto deduces undesired types +방기연](https://reader034.fdocuments.net/reader034/viewer/2022042607/55a930ac1a28ab732a8b459c/html5/thumbnails/17.jpg)
‘Invisible’ proxy타입은 auto의 타입을 추론하는 초기화 식에서 “잘못된” 타입으로 추론될 수 있다.
명시적인 타입 초기화자 조언은 auto가 원하는 타입으로 추론되도록 강제할 수 있다.