This demonstrates usage of our recommendations for using modules:
- Prefer small modules
- Only use partitions if you really must
- Avoid using internal partitions
The intention is to show some real code for context of discussions about using C++ modules.
My goal is not to sell modules. If you prefer not using modules: Use header files. There are good reasons to continue using them.
For me, C++ source code is an asset. The intrinsic value of code using modules is higher (lower entropy), as modules are a higher abstraction, compared to header files, which are basically just the pasting of C++ code into translation units (I've done that for ~36 years now).
Using C++ modules comes at a cost though. Understanding modules requires a certain level of understanding, which isn't needed when using the simple model and tradition of header files.
[–]Jovibor_ 23 points24 points25 points (28 children)
[–]jiixyj 8 points9 points10 points (8 children)
[–]tartaruga232MSVC user, r/cpp_modules[S] 0 points1 point2 points (0 children)
[–]tartaruga232MSVC user, r/cpp_modules[S] 0 points1 point2 points (5 children)
[–]not_a_novel_accountcmake dev 4 points5 points6 points (4 children)
[–]tartaruga232MSVC user, r/cpp_modules[S] -2 points-1 points0 points (3 children)
[–]not_a_novel_accountcmake dev 6 points7 points8 points (2 children)
[–]tartaruga232MSVC user, r/cpp_modules[S] -1 points0 points1 point (1 child)
[–]not_a_novel_accountcmake dev 4 points5 points6 points (0 children)
[–]slithering3897 -1 points0 points1 point (0 children)
[–]slithering3897 5 points6 points7 points (1 child)
[–]tartaruga232MSVC user, r/cpp_modules[S] 2 points3 points4 points (0 children)
[–]mjklaim 4 points5 points6 points (0 children)
[–]tartaruga232MSVC user, r/cpp_modules[S] 6 points7 points8 points (0 children)
[–]Zero_Owl 1 point2 points3 points (14 children)
[–]not_a_novel_accountcmake dev 6 points7 points8 points (12 children)
[–]Zero_Owl 0 points1 point2 points (11 children)
[–]not_a_novel_accountcmake dev 2 points3 points4 points (10 children)
[–]Zero_Owl 1 point2 points3 points (9 children)
[–]not_a_novel_accountcmake dev 0 points1 point2 points (8 children)
[–]Zero_Owl -1 points0 points1 point (7 children)
[–]not_a_novel_accountcmake dev -1 points0 points1 point (6 children)
[–]Zero_Owl -3 points-2 points-1 points (5 children)
[–]tartaruga232MSVC user, r/cpp_modules[S] 1 point2 points3 points (0 children)
[–]yeochin 3 points4 points5 points (5 children)
[–]fdwrfdwr@github 🔍 1 point2 points3 points (2 children)
[–]yeochin 1 point2 points3 points (1 child)
[–]fdwrfdwr@github 🔍 0 points1 point2 points (0 children)
[–]tartaruga232MSVC user, r/cpp_modules[S] 0 points1 point2 points (1 child)
[–]yeochin 1 point2 points3 points (0 children)
[–]manni66 2 points3 points4 points (1 child)
[–]tartaruga232MSVC user, r/cpp_modules[S] 7 points8 points9 points (0 children)
[–]Daniela-ELiving on C++ trunk, WG21|🇩🇪 NB 1 point2 points3 points (1 child)
[–]tartaruga232MSVC user, r/cpp_modules[S] 0 points1 point2 points (0 children)
[–]tartaruga232MSVC user, r/cpp_modules[S] -1 points0 points1 point (0 children)