In article <[EMAIL PROTECTED]> you write: >Thanks Jon, > >Can anyone throw more light on this. >
Stop telling us what you want to do, explain to us WHY you want to do it. There are lots of different reasons for which you might want to know more about temporary object generation, and we can probably give you a more detailed answer only if you tell us what you're trying to achieve. If you want to do something nasty that depends on the location where the temporary objects are generated, then you're probably going to lose, as a C++ compiler is generally permitted to optimize a lot of stuff away, and this kind of stuff will tend to vary widely from one gcc version to the next. If you want to understand the rules, then you're better off reading the C++ standard and related articles. From my point of view, discussions about expression templates and the lifetime of temporaries have been invaluable. If you just want to look at gcc output for self-teaching purposes, then that's another story entirely...