일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 언리얼
- 영화
- c++
- 영화 리뷰
- resource management class
- 티스토리챌린지
- exception
- lua
- Effective c++
- 상속
- 참조자
- 예외
- 비교 함수 객체
- 반복자
- UE4
- more effective c++
- operator new
- 암시적 변환
- 오블완
- 게임
- effective modern c++
- Smart Pointer
- 다형성
- reference
- effective stl
- implicit conversion
- 함수 객체
- virtual function
- 스마트 포인터
- 메타테이블
Archives
- Today
- Total
목록2025/02/12 (1)
스토리텔링 개발자
[Effective Modern C++] 6. auto의 타입 추론 실패
항목 6. auto가 원치 않은 타입으로 추론될 때에는 명시적 타입의 초기치를 사용하라 auto 타입 추론 실패 상황std::vector features(const Widget& w);Widget w;...// 기존 처리bool highPriority = features(w)[5];processWidget(w, highPriority);// auto를 사용한다면..// 컴파일은 여전히 성공한다.auto highPriority = features(w)[5];processWidget(w, highPriority); // 미정의 행동!auto 버전에서는 features(w)[5]의 타입이 bool이 아니기 때문이다.std::vector의 operator[]가 리턴하는 것은 std::vector::refer..
Effective C++/Effective Modern C++
2025. 2. 12. 10:58