#pragma once #include using std::back_inserter; using std::distance; namespace impl { template class BackInserterFn { ContT & m_cont; public: BackInserterFn(ContT & cont) : m_cont(cont) {} template void operator() (T const & t) { m_cont.push_back(t); } }; } template impl::BackInserterFn MakeBackInserter(ContT & cont) { return impl::BackInserterFn(cont); }