현대적인 C++ 튜토리얼
이 튜토리얼은 경험 있는 개발자들에게 C++11/14/17/20의 새로운 기능에 대한 빠른 참고 자료를 제공하는 것을 목표로 합니다. 언어 사용성 향상, 런타임 성능 향상, 새로운 컨테이너, 스마트 포인터 및 메모리 관리, 정규 표현식, 동시 프로그래밍, 그리고 C++20의 미리보기를 다룹니다.
강좌 개요
📚 콘텐츠 요약
이 튜토리얼은 경험 있는 개발자들이 C++11/14/17/20의 새로운 기능을 빠르게 참조할 수 있도록 설계되었습니다. 내용은 언어 사용성 향상, 런타임 성능 개선, 새 컨테이너 및 스마트 포인터, 메모리 관리, 정규 표현식, 동시 프로그래밍, 그리고 C++20의 미리보기까지 포함됩니다.
빠르게 C++11/14/17/20에 익숙해지고 현대적인 C++ 프로그래밍의 문을 여는 데 도움이 됩니다.
저자: 오창쿤 (Ou Changkun)
감사의 말: CC BY-NC-ND 4.0 라이선스 하에 제공되며, 모든 GitHub 기여자 및 관련 커뮤니티 지원에 감사를 표합니다.
🎯 학습 목표
- 명령줄 도구를 사용하여 C++ 컴파일러 환경과 대상 아키텍처를 식별하고 확인한다.
- C(C89, C99, C11)와 C++(C++98, C++1x) 간의 표준 호환성 및 겹치는 역사적 배경을 설명한다.
extern "C"헤더와 다단계 컴파일 워크플로우를 사용하여 기능적인 언어 간 링킹을 구현한다.nullptr을 사용하여 포인터 모호성을 해결하고,constexpr및if constexpr을 활용하여 컴파일 시점 로직을 구현한다.auto,decltype, 타입 별칭(using)을 사용하여 복잡한 선언을 단순화하면서도override와final을 통해 강력한 객체 지향 설계를 보장한다.- 가변 템플릿, 폴드 표현식, 비형식 템플릿 매개변수 추론을 활용하여 매우 일반적인 코드를 설계한다.
- 다양한 캡처 모드(값, 참조, 표현식, 일반화)를 사용하여 람다 표현식을 정의하고 구현한다.
std::function과std::bind를 사용하여 유연한 함수 래퍼와 부분 함수 적용을 생성한다.- 표현식을 Lvalue, Prvalue, Xvalue로 분류하고, 이동 세미틱스를 적용하여 클래스 자원 관리를 최적화한다.
std::array(고정 크기, 스택)와std::vector(동적 크기, 힙)의 메모리 모델과 사용 사례를 구분한다.
수업 共 10 课时 · 预计 30.0h
수업
Lesson
This lesson explores the evolution of C++ and the importance of adopting modern, type-safe coding practices over legacy C-style habits. Students will learn to utilize explicit casting operators and compiler diagnostics to improve code stability, security, and performance.
This lesson explores modern C++ language usability by addressing the "NULL Trap" through the introduction of `nullptr` and examining how `constexpr` and `noexcept` shift computation and error handling to compile-time. Students will learn to improve code safety and performance by replacing legacy C-style macros and casts with modern, type-safe alternatives.
This lesson explores performance optimization in modern C++ through move semantics, lambda expressions, and efficient memory management. Students will learn to leverage zero-cost abstractions like std::array and SFINAE to improve code performance and type safety in resource-constrained environments.
This lesson explores the transition from legacy C-style arrays to the modern std::array, highlighting how the latter provides type safety and STL integration without sacrificing performance. Students will learn to leverage stack-based memory allocation, bounds-checking, and perfect forwarding to write more efficient and robust C++ code.
This lesson explores the pitfalls of manual memory management, such as memory leaks and dangling pointers, and introduces RAII (Resource Acquisition Is Initialization) as a safer, automated alternative. Students will learn how to utilize smart pointers like std::unique_ptr, std::shared_ptr, and std::weak_ptr to ensure deterministic resource cleanup and exception safety in modern C++.
This lesson explores the transition from imperative, manual string searching to declarative pattern matching using regular expressions and formal grammars. Students will learn to apply regex metacharacters and anchors to efficiently parse unstructured data while understanding the performance benefits of using Deterministic Finite Automata.
This lesson explores the transition to standardized concurrency in C++11, which introduced a formal memory model and native thread support to replace platform-specific APIs. Students will learn to manage thread lifecycles, ensure cross-platform data consistency with standardized types, and use the noexcept specifier to maintain program stability in multi-threaded environments.
This lesson explores the evolution of C++ from platform-specific coding to a unified, high-level abstraction layer, focusing on the transition from legacy macros to modern standards. Students will learn to leverage C++11 concurrency features and C++23 filesystem utilities to write portable, maintainable code that avoids OS-specific dependencies.
This lesson explores modernizing C++ development by transitioning from platform-specific APIs to standardized, high-level abstractions like task-based parallelism and the C++11 memory model. Students will learn to improve code maintainability and safety by utilizing features such as std::future, std::atomic, and extended integer types like long long int.
This lesson explores the evolution of C++20, focusing on the "Big Four" features—Concepts, Modules, Coroutines, and Ranges—that shift the language toward a more declarative and efficient programming model. Students will learn how these tools improve code safety, reduce build times, and replace complex template metaprogramming with clearer, constrained syntax.