2 ms·
What's the difference between include and import now?
by kstrauser 3y ago
What's the difference between include and import now?
- gpderetta 3y agoModules.
- lostmsu 3y agoAre they in C++23?
- gpderetta 3y agoThey are in C++20. But only MSVC has an usable implementation yet.
- kazinator 3y agoSome 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!
- glouwbug 3y agoI’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
- Iwan-Zotow 3y agoHello Scons
- Conscat 3y ago#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.