News for hackers. Stuff that matters.
Re:C++23: The Next C++ Standard by tialaramex on Tuesday July 11, 2023 @12:37PM (#36683477)
C++ has namespacing which makes sense because this language has an enormous amount of available 3rd party libraries and without name spacing you can't help stepping on each others toes.

There are two ways you might want to have this work anyway despite namespacing. One option would be that you just import the namespace and get all the stuff in it, this is popular in Java for example, however in C++ this is a bit fraught because while you can import a namespace, you actually get everything from that namespace and all containing namespaces.

Because the C++ standard library defines a huge variety of symbols, if you do this you get almost all of those symbols. Most words you might think of are in fact standard library symbols in C++, std::end, std::move, std::array, and so on. So if you imported all these symbols into your namespace it's easy to accidentally trip yourself, thus it's usual not to do so at all.

Another option would be to have some magic that introduces certain commonly used features, Rust's preludes do this, both generally (having namespaces for the explicit purpose of exporting names you'd often want together) and specifically ("the" standard library prelude for your Edition is automatically injected into all your Rust software by default). C++ could in principle do something like this but it does not.

Re:C++23: The Next C++ Standard by WalterBright on Tuesday July 11, 2023 @01:18PM (#36684110)
D avoids the stepping on each other problem by using modules.
Re:C++23: The Next C++ Standard by glouwbug on Tuesday July 11, 2023 @09:48PM (#36689544)
Can D compile modules in parallel?
Re:C++23: The Next C++ Standard by WalterBright on Wednesday July 12, 2023 @10:58AM (#36695523)
The language is designed so that is possible, although the current compiler does not. At one point, the compiler did all the file reading in parallel, but that was finally turned off because it did not significantly improve compile speed.