Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created September 13, 2024 05:41
Show Gist options
  • Save velotiotech/e2f1aacb054bc38435fb3cf5b41c6d7d to your computer and use it in GitHub Desktop.
Save velotiotech/e2f1aacb054bc38435fb3cf5b41c6d7d to your computer and use it in GitHub Desktop.
#include <iostream>
template <typename T>
void func(T&& t) {
T y = t;
t += 3;
std::cout << y << " ";
}
int main() {
int c = 5;
func(c);
func(5);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment