The : in function definitions?


1
2
3
int addTwoNum(int a, int b) : (bunch of crap goes here) {
 return (a+b);
}


What is it called so I can look up information about it? I tried looking up basic function information, but nothing I saw covered it, but I know I've seen it before.
This is [would be] an initialiser list [for a class or struct constructor] : https://en.cppreference.com/w/cpp/utility/initializer_list
Last edited on
It looks like a member initializer list (not to be confused with std::initializer_list) but those are only allowed on constructors, not on regular functions.
Oh yes my bad, should have specified that they are not allowed for functions..
Thank you for the quick replies. I will look into it. Thanks.
Topic archived. No new replies allowed.