I googled about copy initialization and found out that whenever we write T a = b;
,copy initialisation takes place. It was also mentioned that copy initialization also takes when we pass arguments by value in a function call.
I wanted to know that whenever we pass arguments to a function, is the " = " operator used by the compiler to copy initialize the parameters of the function? I know that "=" is not needed in syntax of the function call but does the copy initialization itself use "=" during function call by value?
For example , In the code given below :
#include<iostream>
using namespace std;
void fun(T1 x, T2 y){
// some code
}
int main(){
T1 a;
T2 b;
solve(a,b);
}
Does initialization of parameters take place as T1 x = a ;
and T2 y = b ;
? Is the "=" operator involved during the copy initialization of parameters in the function?