Easy
Calling a Numeric-constrained template with std::string
Compiled as C++20, what happens when this is compiled?
main.cpp
#include <concepts>
#include <iostream>
#include <string>
template <typename T>
concept Numeric = std::integral<T> || std::floating_point<T>;
template <Numeric T>
T add(T a, T b) {
return a + b;
}
int main() {
std::cout << add(std::string("a"), std::string("b")) << std::endl;
}26 of 117 in C++