| > I was referring to classes as inherently C++.
> AFAIK you cannot have a naked struct in C++ The "class" keyword and the "struct" keyword differ only in default member visibility. You're free to use the struct keyword. Yes, such structs can have member functions, but they change little except to act as a convenience. A "naked struct" in C++ is called a POD ("Plain Old Data") type, and there are a few rules to ensure your structure meets that definition. The standard library has a type trait to test a class/struct to see if it meets that definition (called std::is_pod). > For example, constructors, destructors, virtual functions, namespaces. None of these actually interfere with any use cases or domain that I can think of. Constructors and destructors are insanely valuable features, even if you use nothing else. Functions are not virtual by default and impose no overhead unless used. > exceptions are a big part of C++ that I don't think you can remove? You can turn exceptions off at the compiler level. -fno-exceptions in GCC and Clang. RTTI can also be disabled. Disabling both in embedded cases is perfectly reasonable. > name mangling extern "C" {} blocks kill name mangling and allow you to export a C API and ABI compatible function. |