-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Open
Labels
Description
Needs a check that will find redundant usage of std::enable_if and will suggest more simplified overloading without SFINAE at all.
For example, in 90% usages of std::is_same type trait in a cooperation with std::enable_if we don't really want it.
Look at the sample below...
template<typename T>
std::enable_if<std::is_same<T, int>::value>::type process(T value) {
// int's implementation..
}
template<typename T>
std::enable_if<!std::is_same<T, int>::value>::type process(const T& value) {
// generic implementation..
}
...which might be changed to:
void process(int value) {
// int's implementation..
}
template<typename T>
void process(const T& value) {
// generic implementation..
}