// foo.h

struct Foo

{

static void FuncFoo()

{

...

}

};


// bar.h

struct Bar

{

template <typename T>

void FuncBar()

{

Foo::FuncFoo();

}

};


// main.cpp

#define INCLUDE_FOO_BAR


#ifdef INCLUDE_FOO_BAR

#include "foo.h"

#include "bar.h"

#else

#include "bar.h"

#include "foo.h"

#endif


int main()

{
Bar bar;

bar.FuncBar<int>();

}


위에같은 경우에는 permissive 옵션일때는 인클루드 순서에 상관없이 컴파일 되지만, permissive- 옵션을 주면 #define INCLUDE_FOO_BAR 무조건 해줘야 컴파일이 되는 경우입니다.

이런 간단한 경우 말고도 코드 짜다보면 permissive- 옵션이 불편할 때가 종종 있는데, 제가 translation unit 구성을 너무 배제하고 코딩해서 그런건지 아니면 원래 이 옵션을 끄는게 나은건지 잘 모르겠습니다.