translation unit에 대해서
조회수 3115회
C의 static 함수는 왜 쓰는 건가요?에서 translation section이라는 말이 나오는데 이게 정확히 뭘 뜻하는 건지 알고싶습니다
1 답변
-
translation unit은 C++ compilation의 기본 단위입니다. <소스 파일 하나 + 직접/간접적으로 include된 헤더파일의 내용물(전처리기 조건에 따라 몇몇은 무시)>로 구성되어 있습니다.
translation unit 한개는 object file, library나 실행가능한 프로그램으로 컴파일 될 수 있습니다.
C++ standard :
A translation unit is the basic unit of compilation in C++. It consists of the contents of a single source file, plus the contents of any header files directly or indirectly included by it, minus those lines that were ignored using conditional preprocessing statements. A single translation unit can be compiled into an object file, library, or executable program. The notion of a translation unit is most often mentioned in the contexts of the One Definition Rule, and templates.
댓글 입력