News for hackers. Stuff that matters.
Re:C++23: The Next C++ Standard by turndown on Tuesday July 11, 2023 @12:00PM (#36682900)
Is the include correct? Wouldn't it just be import std; ?
Re:C++23: The Next C++ Standard by enriquto on Tuesday July 11, 2023 @12:04PM (#36682979)
Apparently, the header print adds symbols to the std namespace, just like other standard headers:

https://en.cppreference.com/w/cpp/header/print

Re:C++23: The Next C++ Standard by kstrauser on Tuesday July 11, 2023 @12:35PM (#36683433)
What's the difference between include and import now?
Re:C++23: The Next C++ Standard by gpderetta on Tuesday July 11, 2023 @12:58PM (#36683812)
Modules.
Re:C++23: The Next C++ Standard by lostmsu on Tuesday July 11, 2023 @03:33PM (#36686166)
Are they in C++23?
Re:C++23: The Next C++ Standard by gpderetta on Tuesday July 11, 2023 @05:32PM (#36687496)
They are in C++20. But only MSVC has an usable implementation yet.
Re:C++23: The Next C++ Standard by kazinator on Tuesday July 11, 2023 @07:21PM (#36688496)
Some C++ person recently wrote to the GNU Make mailing list about some grotesque experiments for supporting C++ modules inside GNU Make whereby GNU Make would communicate with some C++ compiler process over sockets and generate dependencies.

Any decent language with modules needs no make utility in the first place. You tell the compiler to build/update the program. The compiler compiles (if necessary) the interface definitions the program references, and in that vein recursively updates the whole tree, compiling anything that has changed; then links the program.

I didn't need any make utility when working with Modula-2 in 1990!

Re:C++23: The Next C++ Standard by glouwbug on Tuesday July 11, 2023 @09:48PM (#36689542)
I’ve always wondered why we use make in the first place. Is it really so hard to write a python script that keeps track of file time stamps in a JSON? gcc can even be invoked with certain flags to print header dependencies. Make is crusty, archaic, and over designed
Re:C++23: The Next C++ Standard by Iwan-Zotow on Wednesday July 12, 2023 @12:30AM (#36690491)
Hello Scons
Re:C++23: The Next C++ Standard by Conscat on Tuesday July 11, 2023 @01:09PM (#36683967)
#include is a preprocessor directive that substitutes the text of a file in place. import declares that this translation unit should link to a specified module unit. Usually there would only be a single translation unit for the entire program in the latter case, which obsoletes IPO/LTO (except when you have statically linked libraries), and means internal linkage functions (everything that is template, inline, or constexpr) do not have to be redundantly recompiled. That also means there would be no distinction between inline variables and static variables. This obsoletes unity builds and precompiled headers.
Re:C++23: The Next C++ Standard by KMag on Tuesday July 11, 2023 @04:03PM (#36686522)
The include is correct.

First, includes either need to be wrapped in angle brackets (for files included from the include path passed to the compiler) or quotes (for paths relative to the current file).

Second, the whole standard library would be huge to pull in, so it is split into many headers, even for symbols in the top level of the std namespace.

Re:C++23: The Next C++ Standard by irowe on Wednesday July 12, 2023 @06:27AM (#36692544)
Something I've learned recently is that the convention of when to use angle brackets and when to use quotes is not prescribed by the standard but instead is implementation-defined.