You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
template<bool>
structenable_if {
using type = void;
};
template<typename>
structtrait {
staticconstexprbool value = false;
};
template<typename T>
structs {
typename enable_if<trait<T>::value>::type assign();
};
template<typename T>
auto s<T>::assign() -> typename enable_if<trait<T>::value>::type {
}
is rejected by clang with
<source>:17:12: error: return type of out-of-line definition of 's::assign' differs from that in the declaration 17 | auto s<T>::assign() -> typename enable_if<trait<T>::value>::type { | ^<source>:13:45: note: previous declaration is here 13 | typename enable_if<trait<T>::value>::type assign(); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^1 error generated.Compiler returned: 1