| bibhukalyana (4) | |||
|
Hi everyone, I want to know what happened internally in bitwise shift operation. What happened when i execute the below statement ?
Is it equivalent of doing "value >> 1" 10 times ?(According to execution time) Can i create an operator overloading for shift operator ? Thanks. | |||
|
|
|||
| Peter87 (3908) | |
The hardware can probably do value >> 10 in the same time as value >> 1 so doing value >> 1 10 times will be slower unless it is able to optimize it.You can overload the shift operator. If you haven't noticed, that is exactly what the streams do. | |
|
|
|