Fix: compilation error with gcc and clang: error: no matching member function for call to 'set' #5

Manually merged
Brecht Van Lommel merged 1 commits from Pierre-Pontier/cycles:fix/node_set_enum_sfinae into main 2023-06-23 17:05:24 +02:00

View File

@ -105,7 +105,7 @@ struct Node {
/* Implicitly cast enums and enum classes to integer, which matches an internal way of how
* enumerator values are stored and accessed in a generic API. */
template<class ValueType, typename std::enable_if_t<std::is_enum_v<ValueType>> * = nullptr>
template<class ValueType, std::enable_if_t<std::is_enum_v<ValueType>, bool> = true>
void set(const SocketType &input, const ValueType &value)
{
static_assert(sizeof(ValueType) <= sizeof(int), "Enumerator type should fit int");