모듈 인터페이스

글로벌 모듈 프래그먼트

module; // 글로벌 모듈 프래그먼트 시작
#include <cstddef> // 레거시 헤더 파일 추가

export module person; // 명명 모듈 선언문

모듈 퍼뷰

익스포트 블록

export
{
	namespace DataModel
	{
		class Person {};
		class Address {};
	}
}

모듈 구현 파일

//구현 코드는 아래와 같이 작성한다.

// 모듈 선언문. 이때 export 키워드는 생략한다.
// 암묵적으로 import person 선언문을 담고 있다.
// 헤더 모듈의 person과 동일한 모듈의 일부분 이기 때문에 module 헤더에서 선언한 include가 딸려온다.
module person; 

using namespace std;

person::person()
{
}
...