feat: change exposed TU-local entities to inline#909
feat: change exposed TU-local entities to inline#909tmadlener merged 1 commit intoAIDASoft:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR changes header-exposed TU-local entities (constexpr variables and variable templates) from static constexpr to inline constexpr to enable their use in C++20 modules. The changes address the issue that static constexpr variables create translation-unit-local entities that cannot be properly exposed across module boundaries.
- Converted variable templates and constexpr variables from
static constexprtoinline constexpracross multiple header files - Updated tag variables and string_view constants to use inline storage linkage
- Maintained consistent keyword ordering (
inline constexpr) throughout most of the codebase
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| include/podio/utilities/TypeHelpers.h | Converted 8 variable templates from static constexpr to inline constexpr for type trait helpers |
| include/podio/utilities/MaybeSharedPtr.h | Changed MarkOwned tag variable from constexpr static to inline constexpr |
| include/podio/detail/LinkFwd.h | Updated 4 string_view constants for link naming from implicit static to inline linkage |
| include/podio/detail/Link.h | Modified 2 variable templates in LinkT class, though with inconsistent keyword ordering |
| include/podio/LinkNavigator.h | Changed ReturnFrom and ReturnTo tag variables to inline constexpr |
| include/podio/GenericParameters.h | Updated isSupportedGenericDataType variable template to inline constexpr |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Should the following also become podio/python/templates/Collection.h.jinja2 Lines 68 to 70 in e19a9a4 And then similar here podio/include/podio/detail/LinkCollectionImpl.h Lines 224 to 230 in e19a9a4 and here podio/include/podio/UserDataCollection.h Lines 101 to 103 in e19a9a4 |
Hmm... Those have not caused any issues in building modules (I'll admit this was mostly solved using whack-a-mole strategy). I think the difference is that they are not templates, and therefore they can have external linkage. |
0d7d340 to
561536a
Compare
This PR changes header-exposed TU-local entities (constexpr variables and variable templates) from static to inline. This allows them to be used in C++20 modules (#907).
BEGINRELEASENOTES
ENDRELEASENOTES