@@ -267,33 +267,32 @@ struct ServiceRegistry {
267267
268268 // / @deprecated old API to be substituted with the ServiceHandle one
269269 template <class I , class C , enum ServiceKind K = ServiceKind::Serial>
270+ requires std::is_base_of_v<I, C>
270271 void registerService (C* service, Salt salt = ServiceRegistry::globalDeviceSalt())
271272 {
272273 // This only works for concrete implementations of the type T.
273274 // We need type elision as we do not want to know all the services in
274275 // advance
275- static_assert (std::is_base_of<I, C>::value == true ,
276- " Registered service is not derived from declared interface" );
277276 constexpr ServiceTypeHash typeHash{TypeIdHelpers::uniqueId<I>()};
278277 ServiceRegistry::registerService (typeHash, reinterpret_cast <void *>(service), K, salt, typeid (C).name ());
279278 }
280279
281280 // / @deprecated old API to be substituted with the ServiceHandle one
282281 template <class I , class C , enum ServiceKind K = ServiceKind::Serial>
282+ requires std::is_base_of_v<I, C>
283283 void registerService (C const * service, Salt salt = ServiceRegistry::globalDeviceSalt())
284284 {
285285 // This only works for concrete implementations of the type T.
286286 // We need type elision as we do not want to know all the services in
287287 // advance
288- static_assert (std::is_base_of<I, C>::value == true ,
289- " Registered service is not derived from declared interface" );
290288 constexpr ServiceTypeHash typeHash{TypeIdHelpers::uniqueId<I const >()};
291289 this ->registerService (typeHash, reinterpret_cast <void *>(const_cast <C*>(service)), K, salt, typeid (C).name ());
292290 }
293291
294292 // / Check if service of type T is currently active.
295293 template <typename T>
296- std::enable_if_t <std::is_const_v<T> == false , bool > active (Salt salt) const
294+ requires (std::is_const_v<T> == false )
295+ bool active (Salt salt) const
297296 {
298297 constexpr ServiceTypeHash typeHash{TypeIdHelpers::uniqueId<T>()};
299298 if (this ->getPos (typeHash, GLOBAL_CONTEXT_SALT) != -1 ) {
0 commit comments