Embedded C++ for Real Systems
No-RTTI C++ 설계 — dynamic_cast 제거와 정적 타입 분기
-fno-rtti 환경에서 type info 없이 다형성 — enum tag, std::variant, CRTP.
· 4분 읽기
cpp embedded
Tech articles, book reviews, and presentations.
페이지 34 / 56
-fno-rtti 환경에서 type info 없이 다형성 — enum tag, std::variant, CRTP.
C++23의 Result type — Rust 같은 monadic 에러 처리, 예외 없이 풍부한 정보.
Result types, error chains, exception-free RAII — 실용적 에러 시스템 구축 패턴.
-fno-exceptions 환경에서 에러 처리 — error code, std::optional, std::expected.
C++17 polymorphic allocator — 같은 컨테이너 타입에 다른 메모리 출처 주입.
고정 크기 블록 + free list — 임베디드의 표준 allocator 구현.
STL allocator interface — 표준 컨테이너의 메모리 출처를 제어.
임베디드의 첫 번째 원칙 — new/malloc 없이 modern C++의 STL 같은 컨테이너 활용.
Template 제약을 명시 — SFINAE의 가독성 개선, 에러 메시지 명확화, 자체 문서화.
std::is_*, std::enable_if, SFINAE — 컴파일 타임 type 정보로 코드 분기와 검증.