#include <iostream>
#include <vector>
#include <list>

struct {
    template<class containerType>
    void operator() ( containerType& vec ) {

        for (auto i = vec.begin(); i!=vec.end(); ++i) {
                std::cout << *i << ", ";
        }

        std::cout << '\n';

    }
} bar;

template<typename funcType>
void foo(funcType func) {

        std::vector<int> vals = { 1, 2, 3 };
        func(vals);

}

int main() {
        foo( bar );
}
