태그: 타입안전성
9편
-
[2026] C++ new vs malloc | 생성자·타입 안전성·예외 처리 완벽 비교
C++ new vs malloc 차이점. 생성자·소멸자, 타입 안전성, 실패 시 예외 vs nullptr. 성능은 거의 비슷하지만 C++ 객체에는 new·delete를 쓰는 것이 맞는 이유와 실전 선택을 정리합니다.
-
[2026] C++ std::optional vs 포인터 | null 처리 안전하고 명확한 선택
C++ std::optional vs nullptr 포인터 비교. 값 없음을 타입으로 표현하는 optional, 다형성·비소유 참조는 포인터. 힙 할당 없는 optional의 이점과 언제 무엇을 쓸지 선택 기준을 설명합니다.
-
[2026] C++ std::variant vs union | 타입 안전성 완벽 비교
Everything about C++ std::variant vs union : from basic concepts to practical applications. Master key content quickly with examples.여러 타입 중 하나를 저장하고 싶...
-
[2026] C++ std::any vs void* | 타입 소거 안전한 선택
Everything about C++ std::any vs void* : from basic concepts to practical applications. Master key content quickly with examples.모든 타입을 저장하고 싶어요. 실전 예...
-
[2026] C++ const 에러 | passing as const 컴파일 에러 완벽 해결
Everything about C++ const 에러 : from basic concepts to practical applications. Master key content quickly with examples.passing, 들어가며: passing as cons...
-
[2026] C++ auto 타입 추론 에러 | cannot deduce 컴파일 에러 해결
Everything about C++ auto 타입 추론 에러 : from basic concepts to practical applications. Master key content quickly with examples.cannot, 들어가며: auto를 썼더니 타...
-
[2026] C++ explicit 키워드 | 암시적 변환 방지 생성자 에러 해결
Everything about C++ explicit 키워드 : from basic concepts to practical applications. Master key content quickly with examples.함수에 잘못된 타입을 전달했는데 컴파일이 돼요....
-
[2026] C++ std::optional·std::variant 완벽 가이드 | nullptr 대신 타입 안전하게
C++ nullptr 체크 지겹다. std::optional로 값 유무를, std::variant로 여러 타입 중 하나를 타입 안전하게. has_value, value_or, std::visit, std::get, std::holds_alternative 실전 활용.
-
[2026] C++ optional·variant·any | nullptr 체크 지겹다 C++17 타입 안전 처리
C++ optional·variant·any에 대해 정리한 개발 블로그 글입니다. 사용자 정보를 조회하는 함수를 만들었습니다. 하지만 사용자가 없을 때를 표현하기 어려웠습니다. std::optional은 . Start now.값이 있거나 없거나를 타입으로 표현해서 nu...