> If we’re talking about an algorithm as a class, the state managed by the class is algorithm state, not the data the algorithm acts on.
I was only talking about algorithm state here. Check, for example, how the C++ string searching algorithms work to get a feeling of how these APIs work in the wild. For an example of this gone wrong, look no further than C++ stable_search, which does not let the user reuse the merge sort buffer across searches.