#include <iostream>
#include <type_traits> // <-------
using namespace std;

template<typename T>
enable_if_t<is_fundamental<T>::value, T>
sum(const T& a, const T& b) { return a + b;}

template<typename T>
enable_if_t<!is_fundamental<T>::value, T>
sum(const T&, const T&) { static_assert(false, "Not fundamental type");}

int main()
{
    struct A {};
    cout << sum(5.1f, 9.4f) << endl;
    sum(A(), A());
    return 0;
}
