Given the following structure and template functions, whether each of them uses a function with a different value for num, creating a new instance of the function, or since the parameter const numbers<num> & numsis a reference and will be implemented as a pointer that everyone uses with different values ββfor "num" can be directed to one function instance?
template<size_t num>
struct numbers{
public:
unsigned int nums[num];
};
template<size_t num>
void print(const numbers<num> & nums,size_t size){
for (int i=0;i<size;i++)
cout <<nums.nums[i]<<' ';
cout <<'\n';
}
source
share