Including a header file into a header file without exposing it's content to the includer
问题 I would like to write a c++ wrapper for a C API. for this it is most convenient to just include the C-API header in my own header, but this also includes the header into the file of the outer system, that should not be exposed to the C-API. capi.h enum MyFlags { MY_FLAG_A, MY_FLAG_B, }; void FOO_bar(int flags); cppapi.hh #include "capi.h" enum class MyFlags { A = MY_FLAG_A, B = MY_FLAG_B }; namespace foo { void bar(MyFlags flags) { FOO_bar((int)flags); } } it is just to translate c naming