Archived

This topic is now archived and is closed to further replies.

Adapting functions

This topic is 5273 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m having a real dilly of a time trying to figure a problem out. I''ve got many STL-type algorithms of my own design, and I would like to use the algorithms on both collections of a datatype, and collections of pointers of that datatype. Needless to say, I''d really love to not duplicate my code, so is there a simple way to do such a thing?

Share this post


Link to post
Share on other sites
I can''t say for sure, but it appears that I have found a solution:


overload operator() in all of my functors to accept pointers. This unfortunately has a side effect of requiring all iterators used to be able to be coerced into pointer objects, but that actually doesn''t seem to be a problem at the moment.

Share this post


Link to post
Share on other sites