Skip to content

Commit

Permalink
[NFC][SYCL] Modernize (idiomatic C++17) SingleNontypePropertyValueBase
Browse files Browse the repository at this point in the history
  • Loading branch information
aelovikov-intel committed Nov 20, 2024
1 parent 69572a2 commit d9411da
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions sycl/include/sycl/ext/oneapi/properties/property_value.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,11 @@ inline namespace _V1 {
namespace ext::oneapi::experimental {
namespace detail {

// Checks if a type T has a static value member variable.
template <typename T, typename U = int> struct HasValue : std::false_type {};
template <typename T>
struct HasValue<T, decltype((void)T::value, 0)> : std::true_type {};

// Base class for property values with a single non-type value
template <typename T, typename = void> struct SingleNontypePropertyValueBase {};

template <typename T>
struct SingleNontypePropertyValueBase<T, std::enable_if_t<HasValue<T>::value>> {
struct SingleNontypePropertyValueBase<T, std::void_t<decltype(T::value)>> {
static constexpr auto value = T::value;
};

Expand Down

0 comments on commit d9411da

Please sign in to comment.