#include template T add(T lhs, T rhs) { static_assert(std::is_arithmetic::value, "T is not arithmetic type!"); return lhs + rhs; } int main() { add(1, 2); // ok add("123", "abc"); // erreur }