[Clam-devel] refactoring backends (3)

dirk.griffioen dirk.griffioen at barcelonamedia.org
Mon Jun 8 08:44:01 PDT 2009


Hi,

I would very much like to take out duplicate code, a good example of 
what I mean is:



the only difference is the container, the rest code is the same.

So for instance the registerports function will boil down to 1 function:



Same goes for all the explicit loops, I would prefer std::for_each (or 
BOOST_FOREACH) for that matter:



as for me this separates the loop (not interesting) from the blanking 
code; but it can be argued that this last remark is trivial

My question then is
- is removing duplicate code by adding template code like the above 
liked as refactoring?
- is std::for_each liked?

Dirk





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20090608/12cc492a/attachment-0002.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: re1.png
Type: image/png
Size: 43086 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20090608/12cc492a/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: re.png
Type: image/png
Size: 93662 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20090608/12cc492a/attachment-0007.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bl1.png
Type: image/png
Size: 9644 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20090608/12cc492a/attachment-0008.png>


More information about the clam-devel mailing list