I have found a function in a library in c++ and I can’t tell the types of the parameters being passed in and just so my knowledge and understanding is complete it would be good for me to know.
To me they look like arrays of function pointers but without the *, am I right in my assumption?
template < typename _Tp , size_t _Nm >
inline void swap ( _Tp ( & __a ) [ _Nm ] , _Tp ( & __b ) [ _Nm ] )
The types of both arguments are the same. They are references to arrays of length
_Nmwhere each element is of type_Tp. The type of the elements and length of the arrays must match in both arguments. Consider the similarity between the types of those arguments and the type of arrRef in the following example:For example, if we have the following:
We instantiate a version of
swapwith the signaturevoid swap(int (&)[5], int (&)[5]).