What I want to do is, in a separate namespace, define my own sort(), copy(), etc implementations that work with database tables/views/etc containers instead of in-memory std containers. If I define my own sort() that accepts my custom forward iterator, how does the compiler resolve that? Or, what do I need to do so that it will resolve properly i.e. use my custom sort() instead of std sort(), even though I may be passing in custom iterator types that match the standard iterator type requirements?
If it uses std sort(), it would actually still work, it would just be extremely inefficient because it wouldn't be handing over the sort to the database, whereas my sort() implementation would. I'm just not sure how to properly invoke my sort() over std sort() when they have the same name and accept the same types. I may have missed some details in my description, so please bear with me on bludgeoning my way through this issue.
Also, I found the following question to be the most similar to what I'm asking (mentions ADL and partial specialization), but I'm not sure if it directly addresses my issue or describes the best way to go about doing what I've described: http://stackoverflow.com/questions/1988978/overloading-for-each-for-specific-iterator-types