r/cpp • • 4d ago

What do you think about modules?

I see lot of people don't like modules how they are now can they can be improved and what can be suitable solution what do you think?

33 Upvotes

72 comments sorted by

View all comments

Show parent comment

6

u/javascript 3d ago

Valuable for a migration path, but eventually the plan should be to deprecate and remove includes. There isn't any interest in that right now.

5

u/NilacTheGrim 3d ago

Yeah, buddy. That's never gunna happen. Nor should it. Trivially easy C interop is crucial for C++.

7

u/javascript 3d ago

Interop isn't the same as syntactic superset. There are other strategies

2

u/NilacTheGrim 3d ago

Not for C++. That ship has sailed. C++ is the mostly superset of C language. If you dislike that don't use it. Use the other strategies languages like Rust or Swift or whatever.

9

u/gmes78 3d ago

Other languages can import C headers without a literal equivalent to the #include preprocessor directive.

4

u/pjmlp 3d ago

That honor actually belongs to Objective-C, which is always full ISO C, plus the Smalltalk like features on top.

So in Objective-C you can use any C language feature up to latest standard, C23 nowadays, unlike C++ which remains mostly C89, with the C standard library parts that don't conflict with C++ language features, or require C language constructs not accepted by C++.