• 3 Posts
  • 12 Comments
Joined 1 year ago
cake
Cake day: June 29th, 2023

help-circle






  • It’s actually not. Objective-C is a superset of C. C++ is not. It’s MOSTLY compatible…but it’s not a superset. See the restrict keyword, or the need for casting to and from void*, or the inability to name variables new or delete, or class, or this. I can’t count how many C projects I have which use this as a variable name that WILL NOT compile as C++…or the need for extern C to call C ABI code…in no way is it a superset

    EDIT: lol, you can downvote me if you want but I think you need to lookup what a superset is



  • …so that leads to another annoyance of mine. The insistence that there aren’t two languages but indeed one named C/C++. Obviously I’m being a bit sarcastic but people blur the lines HEAVILY and it drives me crazy. Most of the C code I’ve written is not compatible with C++…at least not without a lot of type casting at a bare minimum. Or a compiler flag to disable that. Never mind the other differences. And then there’s the restrict keyword, and the ABI problems if the C library you’re using doesn’t extern C in the headers…etc etc… -_-


  • Not a C++ developer, I prefer C. You are right in general however my understanding is that classes which are generic using templates must be fully implemented in header files because of how templates are implemented. That being said this code doesn’t appear to use templates so I’m not entirely sure I get it either?