Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
25
template <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
34
int main() {
35
printType(42);
Callers
1
main
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected