This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: avoid the use of default constructors in stl_algo.h



On Feb 14, 2007, at 3:48 PM, Gunter Winkler wrote: [snip]
Thus the open question is: How expensive are default cons, copy cons,
assign and destruct for "typical" iterators?

I usually have trivial default cons. and trivial destructor, similar
copy and assignment operations.

Without some kind of measurements that show us what improvements we'll see with this change, we can't consider the change on the grounds of performance. Performance, especially where compiler optimizations are important, is notoriously hard to characterize.


The second question is: Should the algorithms enforce the existence of
default constructors - which prohibits some optimizations of later
assignments - or not?

Default constructors are required for forward iterators, but we're not required to use them. I don't think this is an argument for or against.


My guess is that you'll need to demonstrate an improvement in performance for the libstdc++ maintainers to make this change.

	Cheers,
	Doug


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