I have two functions:
void fun(int k) {
++k;
}
template<class T>
void inc(T t) {
++t;
}
And I call these functions with std::ref:
int p = 5;
int o = 5;
fun(std::ref(p));
inc(std::ref(o));
After that value of p is 5 and value of o is 6. What is the difference when I call function with std::ref for these functions?