This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: temp obj created by compiler


In article <20050211142814.6971.qmail@web54402.mail.yahoo.com> 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...


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]