Skip to content

Commit 39d9e04

Browse files
authored
Merge pull request #45785 from Dr15Jones/conceptsRef
Use concepts in Ref
2 parents 0d53ac7 + b9940f6 commit 39d9e04

File tree

1 file changed

+1
-7
lines changed
  • DataFormats/Common/interface

1 file changed

+1
-7
lines changed

DataFormats/Common/interface/Ref.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,9 @@ Ref: A template for a interproduct reference to a member of a product_.
120120
#include "DataFormats/Common/interface/RefTraits.h"
121121

122122
namespace edm {
123-
//Use SFINAE to test for embedded type with name key_compare
124-
template <typename, typename = void>
125-
struct has_key_compare : std::false_type {};
126-
template <typename T>
127-
struct has_key_compare<T, std::void_t<typename T::key_compare>> : std::true_type {};
128-
129123
template <typename C, typename K>
130124
bool compare_key(K const& lhs, K const& rhs) {
131-
if constexpr (has_key_compare<C>::value) {
125+
if constexpr (requires { typename C::key_compare; }) {
132126
using comparison_functor = typename C::key_compare;
133127
return comparison_functor()(lhs, rhs);
134128
} else {

0 commit comments

Comments
 (0)