KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Okay, this may seem like a silly question, but here it goes: template <typename T> void foo(T& x) { } int main() { foo(42); // error in passing argument 1 of 'void foo(T&) [with T = int]' } What is preventing C++ to instantiate the foo function template with T = const int instead?
Tags (comma-separated)
Save Edits
Cancel