Make an external function behave like a member function (C++) : Assuming I have a function like the following in C++:

    template<typename Container>
    void doNothing(Container * container) {
        for (auto element: container) {
             std::cout << element;
        }
    }

Would it be possible to "simulate"  methods on various classes that could implement this function by passing this to it instead of the first parameter. (E.g. a class like std::vector<int>, std::string ... etc).

So basically instead of having to use it as:

    std::vector<double> a{1, 2, 0.5}:
    doNothing(a);

I could call it as:

    std::vector<double> a{1, 2, 0.5}:
    a.doNothing();