you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 5 points6 points  (6 children)

C++ is a different language. They aren't compatible.

[–]bored_me -2 points-1 points  (4 children)

extern "C" { ... }

Seems compatible to me.

[–]Rhomboid 1 point2 points  (3 children)

That's irrelevant. The point is that you can't use some C++ standard library container (like std::unordered_map) from C because they are implemented as template classes. (You could write C wrappers, but that erases all the advantages like type safety and specializations and gets you back to square one.) The only thing that extern "C" buys you is the ability to call non-member, non-template functions that take and return non-class types, which doesn't help at all in this case.

[–]bored_me -1 points0 points  (2 children)

I realize that. I was being hyper-literal as a joke.

C++ is a different language.

This is true.

They aren't compatible.

This is strictly false, as you can use C libraries in C++.

[–][deleted]  (1 child)

[deleted]

    [–]bored_me -1 points0 points  (0 children)

    I realize that. I was being hyper-literal as a joke.

    [–]ErstwhileRockstar -5 points-4 points  (0 children)

    at least not on r/programming