Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Support for c++20 modules

(1/4) > >>

sm0ke:
Hello, i like this IDE. But it's not allow to use modules in cpp.
Does the modules will be available by code::blocks in near future?

oBFusCATed:
Probably but someone needs to research how to do it.
Do you use a compiler which supports the final/standard variant of modules?

sm0ke:
I tried mingw64 snapshot version:
http://winlibs.com/
> GCC 11.0.1 snapshot 20210228 (experimental) + MinGW-w64 8.0.0 - release 1

It can compile modules when compile with "-fmodules-ts". But in the "export module _name;" _name should coincide with the file name. And file extension should be .cpp (not .ixx). Or it's not work.

Also... There is MSVC 19 Preview. Module file should be with .ixx extension (or with appropriate property).

Do not forget to recompile .cpp file that imports changed module. And module should be compiled before .cpp (or .h) file that its use. (make dependencies like with #include)

upd: I forgot to mention that clang can do with modules too, but it is too weird to configure to make it work.
clang i used from here:
http://winlibs.com/
GCC 10.3.0 + LLVM/Clang/LLD/LLDB 11.1.0 + MinGW-w64 8.0.0 - release 1

The_GTA:
Hello sm0ke, I like your suggestion very much! Please add nice support for C++20 modules because they allow for advanced programming practices! This new C++ language feature enables very high-tech modern powerful development practices that can shape the future of native development in a significant way. Let me inspire you:

* to use modules the cruft of C-style header files is no longer mandatory! Header files are only a thing for compatibility with C-only projects or system headers. There is now a C++-language-level space of function signatures and symbols inside of compilation units that can be activated by pure inclusion of module units and activation with the "import" statement.
* a dependency tree where static modules depend on static modules is also possible, and much nicer so! Since you do not need header files anymore, you do not need to specify include directories for module-based C++ depedency projects anymore. This does remove nasty time-consuming project configuration steps. A big kudos to the C++ language team for this C++20 feature!
* how does Code::Blocks IDE know about function declarations and definitions in case that they come from modules, not from header files of the same compilation unit? Does Code::Blocks support looking up of such language structures from across compilation units, such as from imported module compilation units? I hope so. And consider the bigger picture: does Code::Blocks support looking up of language structures from compilation module units from static library dependencies? A very special case of such is the C++ standard runtime (STL).
Code::Blocks must not leave the modern developer crowd behind! Get on the module-hype-train now. Developers like me will have even more reasons to promote your product as the "IDE with all the features you need". 👍😎

oBFusCATed:

--- Quote from: The_GTA on May 11, 2021, 06:38:01 pm ---A big kudos to the C++ language team for this C++20 feature!

--- End quote ---
It would have been big in 2011. Now it is just late and as always overdone/over-engineered and from what I'm hearing/reading it doesn't solve the biggest problem in C++ - slow compile times.


--- Quote from: The_GTA on May 11, 2021, 06:38:01 pm ---Get on the module-hype-train now.

--- End quote ---
I think, I wait until it gets the module-just-works-train. :)

p.s. your message looks like the messages produced by the spam bots... :)

Navigation

[0] Message Index

[#] Next page

Go to full version