prog.cpp: In function ‘int main()’:
prog.cpp:36:37: error: use of deleted function ‘constexpr FunctorNMC::FunctorNMC(const FunctorNMC&)’
my_for_each(v.begin(), v.end(), tmp);
^
prog.cpp:15:8: note: ‘constexpr FunctorNMC::FunctorNMC(const FunctorNMC&)’ is implicitly declared as deleted because ‘FunctorNMC’ declares a move constructor or move assignment operator
struct FunctorNMC //non-move-constructible
^
prog.cpp:6:10: error: initializing argument 3 of ‘Function my_for_each(InputIterator, InputIterator, Function) [with InputIterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; Function = FunctorNMC]’
Function my_for_each(InputIterator first, InputIterator last, Function fn)
^
prog.cpp: In instantiation of ‘Function my_for_each(InputIterator, InputIterator, Function) [with InputIterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; Function = FunctorNMC]’:
prog.cpp:36:37: required from here
prog.cpp:12:9: error: use of deleted function ‘FunctorNMC::FunctorNMC(FunctorNMC&&)’
return fn;
^
prog.cpp:18:2: error: declared here
FunctorNMC(FunctorNMC&&) = delete;
^