c++ - Universal references with functions -


what type of "univ" in code below?

template<typename t> void func(t&& univ) {     // ?? }  int sum(int a, int b) {  return a+b;    }  int main() {      func(sum);  } 

i didn't know universal references worked functions. func(sum); equivalent func(&sum); or rvalue reference binding else simple pointer?

i don't know how put more words...

the type reference function taking 2 ints , returning , int

or, comment says: int(&)(int, int)


Comments

Popular posts from this blog

java - Solr query version issue: Invalid version or the data in not in 'javabin' format -

Hard vs. Soft Water: What's The Difference?

The Ten Most Livable Cities In The World