I'm a beinner and i want to know how the language works on the underlying,
can you explain me what happens exactly when i create and initalize an object
in the following example :
int a = 10; //
if we use the = is copy initalization that means that the value of the right-hand operand is created into the left-hand operand, but what exactly means ? the compiler creates a temporary or what ? or it is a simple copy ?
when a compiler creates a temporary ?
then , i'm studying the c++ primer book and for now ( first 100 pages ) i've studied just one case when we use temporary , do you think i will learn more in the next pages ? thank
No temporary object is required for the simple example you gave.
Specifics vary with the hardware platform, but in general what happens is as follows:
- Load 10 into a register
- Store the contents of the register at address of a.