[ scummvm-Patches-1715313 ] CORE: STL like algorithm implementation

SourceForge.net noreply at sourceforge.net
Wed May 9 00:22:32 CEST 2007


Patches item #1715313, was opened at 2007-05-09 00:22
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418822&aid=1715313&group_id=37116

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Johannes Schickel (lordhoto)
Assigned to: Max Horn (fingolfin)
Summary: CORE: STL like algorithm implementation

Initial Comment:
Hi,

This patch implements functionality like <algorithm> in the STL. I added some example usages (for Common::for_each, which works like std::for_each, Common::copy, which works like std::copy, Common::copy_backward, which works like std::copy_backward and Common::find_if, which works like... I guess you got it by now ;-)).

First of all I used it in our Common::Array implementation. I extended our tests for Common::Array also, to test if it works like before. What we can gain of the use of Common::copy/Common::copy_backward is that we're able to specialize the templates only for 'int','short',etc. to use memcpy instead of a custom copy loop there.

Second I changes some Kyrandia engine code to use the new functionality, which saves at least code lines and looks far superior IMHO.

Maybe it's a bit 'over engineered' for our needs. But I think it's a good addition, which also eases it for coders used to the STL to get into our code.

Also I don't know if we have support for some compilers which have a hard time with templates, msvc6 should've at least, but I don't think anyone uses it for building ScummVM...

I'm assigning this to Fingolfin, since he's in charge of our core code base, but others are free to comment on this too :-)

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418822&aid=1715313&group_id=37116




More information about the Scummvm-tracker mailing list