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

발아 바라 프로그래밍

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

발아 바라 프로그래밍

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

pimpl (1)
[Effective Modern C++] 항목 22. Pimpl 관용구를 사용할 때에는 특수 멤버 함수들을 구현 파일에서 정의하라

Pimpl 이란 "pointer to implementation" 을 의미한다. 코드를 먼저 살펴보자. 기존코드 class Widget { public: Widget(); ... private: std::string name; std:;vector data; Gadget g1, g2, g3; }; Pimpl 적용 코드 class Widget { public: Widget(); ~Widget(); ... private: struct Impl; Impl *pImpl; }; Pimpl 적용 코드를 보면 std::string, std::vector, Gadget 을 선언하지 않고 있기 때문에 #include 할 필요가 없어졌다. 덕분에 컴파일 속도가 빨라지게 되었다. 이렇게 선언만 하고 정의를 하지 않는 형식을..

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

티스토리툴바