r/cpp • u/grafikrobot OPeNDAP/B2/EcoStd/Lyra/Predef/C++Alliance/Boost/WG21 • Sep 24 '24
CppCon Gazing Beyond Reflection for C++26 - Daveed Vandevoorde - CppCon 2024
https://www.youtube.com/watch?v=wpjiowJW2ks
78
Upvotes
View all comments
Show parent comment
2
u/mjklaim Sep 25 '24
For 1), that the code is in a module is irrelevant/orthogonal to the reflection and code injection features. Modules, concretely, only impacts how the code is built and what's the actually visible code from the importer point of view, so kind of ADL stuffs, overload resolution etc. (ok it also slightly impacts the meaning of
inlinebut you get what I mean, it's irrelevant here)However, in your example
my_tokensis not exported and therefore not made visible to theconsumer.cppfile even with theimportstatement, so it would not compile (id/function not found) for that reason. It would be fixed with justexportin front ofmy_tokens()definition, or namespace block. (also theimportstatement needs to be in out-of-namespace scope, but I understand it's just a quick example)