This is the mail archive of the gcc-help@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: Is this a bug?


Bob told us his preference.  So I'll admit my preferences: Haskell,
Ocaml, Prolog, Python, and Lisp, probably in that order.

Bill

> On Thu, 2009-07-16 at 17:31 -0700, Ian Lance Taylor wrote:
> > For an integer type there is no performance difference between ++x and
> > x++.
> > 
> > For a C++ class which defines operator++ and a copy constructor, there
> > can be performance differences between ++x and x++.  The latter often
> > requires the compiler to invoke the copy constructor to hold onto the
> > old value before invoking operator++.  So if you are writing C++, it's
> > often a good idea to write ++x when x is a class type, such as an STL
> > iterator.  The compiler can sometimes eliminate the copy constructor,
> > but not always.
> > 
> > Ian
> 
> Thank you, Ian. Being mostly a C programmer, I often forget about the
> things that C++ does behind the scenes.
> 
> My real preference is assembly language. Then it's just me and the
> machine. ;)
> 
> Bob
> 
> 
> 

________________________________________________________________
Please visit a saintly hero:
http://www.jakemoore.org


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