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

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -