diff --git a/Framework/Core/include/Framework/DataRefUtils.h b/Framework/Core/include/Framework/DataRefUtils.h index c63b06357b8ed..2839860965357 100644 --- a/Framework/Core/include/Framework/DataRefUtils.h +++ b/Framework/Core/include/Framework/DataRefUtils.h @@ -122,7 +122,7 @@ struct DataRefUtils { // object only depends on the state at serialization of the original object. However, // all objects created during deserialization are new and must be owned by the collection // to avoid memory leak. So we call SetOwner if it is available for the type. - if constexpr (has_root_setowner::value) { + if constexpr (requires(T t) { t.SetOwner(true); }) { result->SetOwner(true); } }); diff --git a/Framework/Core/include/Framework/TypeTraits.h b/Framework/Core/include/Framework/TypeTraits.h index 19ca548835cdd..faa9055de3280 100644 --- a/Framework/Core/include/Framework/TypeTraits.h +++ b/Framework/Core/include/Framework/TypeTraits.h @@ -147,22 +147,5 @@ class has_root_dictionary::value>::ty { }; -// Detect whether a class is a ROOT class implementing SetOwner -// This member detector idiom is implemented using SFINAE idiom to look for -// a 'SetOwner()' method. -template -struct has_root_setowner : std::false_type { -}; - -template -struct has_root_setowner< - T, - std::conditional_t< - false, - class_member_checker< - decltype(std::declval().SetOwner(true))>, - void>> : public std::true_type { -}; - } // namespace o2::framework #endif // FRAMEWORK_TYPETRAITS_H