Is there anything wrong with
#import "SomeCppHeaderFile.h"
in an objective C++ header? Or should I be including like this (is there any difference if the cpp header has the usual #ifndef #define #endif header gard macros)
#include "SomeCppHeaderFile.h"
There is nothing wrong with
#import "SomeCppHeaderFile.h". The#importdirective does exist in the C/C++ preprocessors of GCC and Clang; the difference with#includeis that it is designed to not include twice the same file in the same compilation unit.This directive is not standard C, so if you expect to ship your libraries on other systems, be careful. As far as I know, it is supported only by GCC and Clang, and the guys at GCC don’t like it much for this reason.