MCPcopy Create free account
hub / github.com/ShivaBhattacharjee/KeyZen / add

Function add

data/cpp/08_template_specialization.cpp:25–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25template <typename T> T add(T a, T b) {
26 if constexpr (std::is_integral<T>::value) {
27 std::cout << "integer add\n";
28 } else {
29 std::cout << "float add\n";
30 }
31 return a + b;
32}
33
34int main() {
35 printType(42);

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected