본문 바로가기 메뉴 바로가기

발아 바라 프로그래밍

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

발아 바라 프로그래밍

검색하기 폼
  • 분류 전체보기 (56)
    • Unreal Engine 4 (4)
    • C++ (45)
      • Effective Modern C++ (40)
    • 프로그래밍 (3)
    • 식물기르기 (2)
    • 티스토리 (1)
  • 방명록

using (1)
[Effective Modern C++] 항목 9. typedef보다 별칭 선언을 선호하라

C++11에는 별칭 선언(alias declaration)을 제공한다. 별칭 선언이란 typedef를 대체할 수 있으면서 몇가지 장점들이 있다. 먼저 둘의 차이를 보자. typedef std::unique_ptr UPtrMapSS; using UPtrMapSS = std::unique_ptr; typedef보다 별칭 선언을 선호해야하는 이유는 바로 별칭 템플릿(alias templates) 때문이다. template using MyAllocList = std::list; template struct MyAllocList { typedef std::list type; }; 당장 위에만 봐도 별칭 선언을 사용한 경우가 간단하다. 게다가 이를 다른 클래스에서 사용하려면 이름 앞에 typename을 꼭 붙여야한..

C++/Effective Modern C++ 2019. 9. 28. 21:04
이전 1 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • async
  • 보편참조
  • Join
  • Effective
  • 발아시기
  • forward
  • Effective Modern C++
  • std::forward
  • C++11
  • 보편 참조
  • MOVE
  • Modern
  • 다이소
  • thread
  • 람다
  • Overloading
  • const
  • C++
  • C++14
  • Override
  • Future
  • Perfect
  • Forwarding
  • auto
  • std::move
  • detach
  • C
  • CPP
  • Unreal
  • 포인터
more
«   2026/01   »
일 월 화 수 목 금 토
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 29 30 31
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바