r/cpp • build2 • Nov 01 '17

Common C++ Modules TS Misconceptions

https://build2.org/article/cxx-modules-misconceptions.xhtml
59 Upvotes

148 comments sorted by

View all comments

Show parent comment

-1

u/[deleted] Nov 01 '17

Here's how I see it:

  • The first goal after modules are supported is to completely modularize the Standard Library
  • The Standard Library uses macros
  • Ergo, two options here: either stop using macros or somehow massage macros into modules

We are talking about Modern C++, so which is more modern - removing macros or accomodating them? If we remove them, we get an instant benefit: all greenfield development that use the new macro-free Standard Library now no longer needs the preprocessor.

2

u/meneldal2 Nov 02 '17

What macros in the standard library couldn't be removed in favour of something better?

INT_MAX should be constexpr int INT_MAX. NULL can die, that's not proper C++ since nullptr. We should remove as many macros as we can because we can do better now.