Skip to content

Commit 0d7d340

Browse files
authored
feat: change exposed TU-local entities to inline
1 parent e19a9a4 commit 0d7d340

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

include/podio/GenericParameters.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ using SupportedGenericDataTypes = std::tuple<int, float, std::string, double>;
2828

2929
/// Static bool for determining if a type T is a supported GenericParameters type
3030
template <typename T>
31-
static constexpr bool isSupportedGenericDataType = detail::isAnyOrVectorOf<T, SupportedGenericDataTypes>;
31+
inline constexpr bool isSupportedGenericDataType = detail::isAnyOrVectorOf<T, SupportedGenericDataTypes>;
3232

3333
/// Concept to be used for templates that should only be present for actually supported data types
3434
template <typename T>

include/podio/LinkNavigator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ namespace detail::links {
3535

3636
/// Tag variable to select the lookup of *From* objects have links with a *To*
3737
/// object in podio::LinkNavigator::getLinked
38-
static constexpr detail::links::ReturnFromTag ReturnFrom;
38+
inline constexpr detail::links::ReturnFromTag ReturnFrom;
3939
/// Tag variable to select the lookup of *To* objects that have links with a
4040
/// *From* object in podio::LinkNavigator::getLinked
41-
static constexpr detail::links::ReturnToTag ReturnTo;
41+
inline constexpr detail::links::ReturnToTag ReturnTo;
4242

4343
/// A helper class to more easily handle one-to-many links.
4444
///

include/podio/detail/Link.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ class LinkT {
4646
/// Variable template to for determining whether T is either FromT or ToT.
4747
/// Mainly defined for convenience
4848
template <typename T>
49-
static constexpr bool isFromOrToT = detail::isInTuple<T, std::tuple<FromT, ToT>>;
49+
inline constexpr static bool isFromOrToT = detail::isInTuple<T, std::tuple<FromT, ToT>>;
5050

5151
/// Variable template to for determining whether T is either FromT or ToT or
5252
/// any of their mutable versions.
5353
template <typename T>
54-
static constexpr bool isMutableFromOrToT =
54+
inline constexpr static bool isMutableFromOrToT =
5555
detail::isInTuple<T,
5656
std::tuple<FromT, ToT, detail::GetMutableHandleType<FromT>, detail::GetMutableHandleType<ToT>>>;
5757

include/podio/detail/LinkFwd.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
namespace podio {
1313
namespace detail {
1414

15-
constexpr std::string_view link_coll_name_prefix = "podio::LinkCollection<";
16-
constexpr std::string_view link_name_prefix = "podio::Link<";
17-
constexpr std::string_view link_name_infix = ",";
18-
constexpr std::string_view link_name_suffix = ">";
15+
inline constexpr std::string_view link_coll_name_prefix = "podio::LinkCollection<";
16+
inline constexpr std::string_view link_name_prefix = "podio::Link<";
17+
inline constexpr std::string_view link_name_infix = ",";
18+
inline constexpr std::string_view link_name_suffix = ">";
1919

2020
/// Get an SIO friendly type name for a LinkCollection (necessary for
2121
/// registration in the SIOBlockFactory)

include/podio/utilities/MaybeSharedPtr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace detail {
1212
struct MarkOwnedTag {};
1313
} // namespace detail
1414

15-
constexpr static auto MarkOwned [[maybe_unused]] = detail::MarkOwnedTag{};
15+
inline constexpr auto MarkOwned [[maybe_unused]] = detail::MarkOwnedTag{};
1616

1717
/// "Semi-smart" pointer class for pointers that at some point during their
1818
/// lifetime might hand over management to another entity. E.g. Objects that

include/podio/utilities/TypeHelpers.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ namespace detail {
5959
/// variable template for determining whether type T is in a tuple with types
6060
/// Ts
6161
template <typename T, typename Tuple>
62-
static constexpr bool isInTuple = TypeInTupleHelper<T, Tuple>::value;
62+
inline constexpr bool isInTuple = TypeInTupleHelper<T, Tuple>::value;
6363

6464
/// Helper struct to turn a tuple of types into a tuple of a template of types, e.g.
6565
///
@@ -92,7 +92,7 @@ namespace detail {
9292
/// variable template for determining whether the type T is in the tuple of all
9393
/// types or in the tuple of all vector of the passed types
9494
template <typename T, typename Tuple>
95-
static constexpr bool isAnyOrVectorOf = isInTuple<T, TupleCatType<Tuple, TupleOfVector<Tuple>>>;
95+
inline constexpr bool isAnyOrVectorOf = isInTuple<T, TupleCatType<Tuple, TupleOfVector<Tuple>>>;
9696

9797
/// Helper struct to extract the type from a std::vector or return the
9898
/// original type if it is not a vector. Works only for "simple" types and does
@@ -119,7 +119,7 @@ namespace detail {
119119

120120
/// Alias template for deciding whether the passed type T is a vector or not
121121
template <typename T>
122-
static constexpr bool isVector = IsVectorHelper<T>::value;
122+
inline constexpr bool isVector = IsVectorHelper<T>::value;
123123

124124
/// Helper struct to detect whether a type is a std::map or std::unordered_map
125125
template <typename T>
@@ -134,7 +134,7 @@ namespace detail {
134134
/// Alias template for deciding whether the passed type T is a map or
135135
/// unordered_map
136136
template <typename T>
137-
static constexpr bool isMap = IsMapHelper<T>::value;
137+
inline constexpr bool isMap = IsMapHelper<T>::value;
138138

139139
/// Helper struct to homogenize the (type) access for things that behave like
140140
/// maps, e.g. vectors of pairs (and obviously maps).
@@ -179,12 +179,12 @@ namespace detail {
179179
/// Variable template for determining whether type T is a podio generated
180180
/// mutable handle class
181181
template <typename T>
182-
constexpr static bool isMutableHandleType = det::is_detected_v<hasObject_t, std::remove_reference_t<T>>;
182+
inline constexpr bool isMutableHandleType = det::is_detected_v<hasObject_t, std::remove_reference_t<T>>;
183183

184184
/// Variable template for determining whether type T is a podio generated
185185
/// default handle class
186186
template <typename T>
187-
constexpr static bool isDefaultHandleType = det::is_detected_v<hasMutable_t, std::remove_reference_t<T>>;
187+
inline constexpr bool isDefaultHandleType = det::is_detected_v<hasMutable_t, std::remove_reference_t<T>>;
188188

189189
/// Variable template for obtaining the default handle type from any podio
190190
/// generated handle type.
@@ -218,7 +218,7 @@ namespace detail {
218218
///
219219
/// @note: This simply checks whether T has an interfaced_types type member.
220220
template <typename T>
221-
constexpr static bool isInterfaceType = det::is_detected_v<hasInterface_t, std::remove_reference_t<T>>;
221+
inline constexpr bool isInterfaceType = det::is_detected_v<hasInterface_t, std::remove_reference_t<T>>;
222222

223223
/// Helper struct to make the detection whether type U can be used to
224224
/// initialize the interface type T in a SFINAE friendly way
@@ -238,7 +238,7 @@ namespace detail {
238238
/// Variable template for checking whether the passed type T is an interface
239239
/// and can be initialized from type U
240240
template <typename T, typename U>
241-
constexpr static bool isInterfaceInitializableFrom = InterfaceInitializerHelper<T, U>::value;
241+
inline constexpr bool isInterfaceInitializableFrom = InterfaceInitializerHelper<T, U>::value;
242242

243243
} // namespace detail
244244

0 commit comments

Comments
 (0)