일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- Greedy
- Bronze
- Gold
- BFS
- level3
- SWEA
- Modern C++
- Euclidean
- effective C++
- Zenject
- smart pointer
- C++11
- Unity
- algorithm
- 3D RPG
- level1
- algoritm
- LEVEL2
- binary search
- BOJ
- stack
- trie
- two pointer
- 프로그래머스
- programmers
- 8-Puzzle
- Project
- PrefixSum
- knapsack Problem
- Silver
Archives
- Today
- Total
목록smart pointer (1)
Patrick's Devlog
[Modern C++] Smart Pointer
개요 급히 Modern C++에 대해 공부해야할 일이 생겨 간단하게 인터넷을 통해서 숙지하고자 게시글을 정리한다. 자료는 TCP School에서 참고하여 정리하였으며, 좀 더 자세한 내용을 확인하고 싶으면 아래 참고 자료 링크에 들어가면 된다. 스마트 포인터? C++에서 new 키워드를 사용해 동적으로 할당받은 메모리는 반드시 delete를 사용해 해제해야 한다. C++에서는 메모리 누수로부터 프로그램 안전성을 보장하기 위해 스마트포인터를 제공한다. 스마트 포인터는 포인터처럼 동작하는 클래스 템플릿으로, 사용이 끝난 메모리를 자동으로 해제해준다. ◆ 동작 보통 new 키워드를 이용해 원시 포인터가 실제 메모리를 가리키도록 초기화한 후 원시 포인터를 스마트 포인터에 대입하여 사용한다. 정의된 스마트 포인터..
Study/C++
2022. 5. 17. 17:58