본문 바로가기
728x90

개발개발/c++ 203

[C++ 20] Module 🚩사용이유 ▶️ 빌드단계전처리 : include, define 등을 처리하는 단계 컴파일 : 오브젝트 파일 만드는 단계링크 : 만들어진 오브젝트 파일들을 심볼들로 묶어서 연결해주는 단계 ▶️ 기존에 사용하던 방법의 문제점1) 빌드 속도가 너무 느리다.ex) 중복적인 include 사용시 (반복된 substitution) 2) 매크로 (#define)ex) a클래스에 abc라는 매크로에 값을 넣고,b클래스에 abc라는 매크로에 다른 값을 넣은 후,c클래스에서 a와 b를 include한 후, abc를 불러온다면? -> c클래스에 나중에 include된 클래스의 매크로abc의 값을 가져온다. 3) 심볼 중복정의 ex) a클래스 헤더에 구현부까지 만든 함수가 있을 경우c클래스에서 a클래스를 includ.. 2025. 2. 15.
[C++20] Concept 🚩 Concept 사용 이유class GameObject{}class Knight : GameObject{}class Orc : GameObject{}class Program{ static void TestObj (T obj) where T : GameObject { } static void Main( string [] args ) { TestObj ( new Knight() ); // TestObj (3); // 사용불가 }}c++의 Concept은 c#의 where절 처럼 템플릿의 형태에 제한을 줄 수 있도록 해주는 문법이다. 🚩Concept 사용하는 방식은 4가지 1️⃣ Requires Clause(절)templaterequires s.. 2025. 2. 14.
C++의 역사, C++20의 핵심, 개발환경 🚩C++ 버전별 역사 ▶️뒤에 붙은 숫자는 등장연도를 뜻한다. C++98TemplatesSTLStringI/O StreamC++11MoveUnified InitializationLambdaconstexprMultithreadMemory ModelSmart PointerRegular ExpressionHash Tablestd::arrayC++14Reader-Writer LockGeneric LambdaC++17Fold expressionconstexpr ifStructured BindingParallel AlgorithmFilesystemstd::anystd::optionalstd::variantC++20ConceptModuleRangeCoroutine 🚩C++ 20에서 살펴볼 내용 C++ 20 핵심.. 2025. 2. 13.
728x90