diff --git a/include/podio/detail/Link.h b/include/podio/detail/Link.h index c9ddd1b38..9cbb30ed8 100644 --- a/include/podio/detail/Link.h +++ b/include/podio/detail/Link.h @@ -272,7 +272,7 @@ class LinkT { !detail::isInterfaceInitializableFrom) { setTo(std::move(value)); } else { - static_assert(detail::always_false, "Argument type is ambiguous, can't determine link direction"); + static_assert(sizeof(T) == 0, "Argument type is ambiguous, can't determine link direction"); } } diff --git a/include/podio/utilities/TypeHelpers.h b/include/podio/utilities/TypeHelpers.h index b2a568f13..d774644d7 100644 --- a/include/podio/utilities/TypeHelpers.h +++ b/include/podio/utilities/TypeHelpers.h @@ -40,11 +40,6 @@ namespace det { namespace detail { - // A helper variable template that is always false, used for static_asserts - // and other compile-time checks that should always fail. - template - inline constexpr bool always_false = false; - /// Helper struct to determine whether a given type T is in a tuple of types /// that act as a type list in this case template diff --git a/src/rootUtils.h b/src/rootUtils.h index b022500b6..2a669ebe3 100644 --- a/src/rootUtils.h +++ b/src/rootUtils.h @@ -3,7 +3,6 @@ #include "podio/CollectionIDTable.h" #include "podio/utilities/RootHelpers.h" -#include "podio/utilities/TypeHelpers.h" #include "TBranch.h" #include "TTree.h" @@ -59,7 +58,7 @@ consteval auto getGPKeyName() { } else if constexpr (std::is_same::value) { return stringKeyName; } else { - static_assert(podio::detail::always_false, "Unsupported type for generic parameters"); + static_assert(sizeof(T) == 0, "Unsupported type for generic parameters"); } } @@ -77,7 +76,7 @@ consteval auto getGPValueName() { } else if constexpr (std::is_same::value) { return stringValueName; } else { - static_assert(podio::detail::always_false, "Unsupported type for generic parameters"); + static_assert(sizeof(T) == 0, "Unsupported type for generic parameters"); } } @@ -106,7 +105,7 @@ consteval auto getGPBranchOffsets() { } else if constexpr (std::is_same_v) { return GPBranchOffsets{7, 8}; } else { - static_assert(podio::detail::always_false, "Unsupported type for generic parameters"); + static_assert(sizeof(T) == 0, "Unsupported type for generic parameters"); } }