The standard algorithms work with iterator ranges, not containers. Given an iterator, there's no standard way even to tell whether it comes from a container; and certainly no way to access the container if it does.
In order to support this then, as well as bloating the iterator requirements to support the metaprogramming you suggest, you'll also need to bloat each iterator with a pointer/reference to its container. That would be quite a high cost (since many iterator types are usually implemented as a single pointer), for an optimisation that would rarely be needed (since you usually know which type of container you're dealing with).