diff --git a/ecsact/runtime/common.h b/ecsact/runtime/common.h index d67d8515..67b0761d 100644 --- a/ecsact/runtime/common.h +++ b/ecsact/runtime/common.h @@ -54,8 +54,17 @@ ECSACT_TYPED_ID(ecsact_system_like_id); ECSACT_TYPED_ID(ecsact_component_like_id); #ifdef __cplusplus +template +constexpr bool ecsact_id_invalid_cast_v = false; + template -To ecsact_id_cast(From); +ECSACT_ALWAYS_INLINE To ecsact_id_cast(From) { + static_assert( + ecsact_id_invalid_cast_v, + "Invalid ecsact_id_cast - Incompatible ID Types" + ); +} + # define ECSACT_CAST_ID_FN(From, To) \ template<> \ ECSACT_ALWAYS_INLINE To ecsact_id_cast(From id) { \