Jump to content
  • Advertisement

Archived

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

Mithrandir

Adapting functions

This topic is 5490 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
Advertisement
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!