[Click] Adding a replace() method to Vector

Michael Gellman m.gellman at imperial.ac.uk
Mon Apr 3 13:50:42 EDT 2006


I recently came across the need to replace one element in a Vector
with another. I know that I could do this with a delete() followed by
an insert(), but it felt a bit kludgy, and seems that the performance
of that approach wouldn't be very good, so I whipped up my own
replace() method by looking at some of the other methods for Vector.

I've attached the new method as a patch, as it may be of interest for
mainline Click.

Sincerely,

Michael Gellman
--
Intelligent Systems & Networks Group
Dept of Electrical & Electronic Engineering
Imperial College London
London SW7 2BT
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vector_replace.patch
Type: text/x-patch
Size: 1415 bytes
Desc: not available
Url : https://amsterdam.lcs.mit.edu/pipermail/click/attachments/20060403/3c92083f/vector_replace.bin


More information about the click mailing list