In file included from prog.cpp:1:0:
/usr/include/c++/4.8/functional: In instantiation of ‘static void std::_Function_base::_Base_manager<_Functor>::_M_clone(std::_Any_data&, const std::_Any_data&, std::false_type) [with _Functor = main()::__lambda0; std::false_type = std::integral_constant<bool, false>]’:
/usr/include/c++/4.8/functional:1946:51: required from ‘static bool std::_Function_base::_Base_manager<_Functor>::_M_manager(std::_Any_data&, const std::_Any_data&, std::_Manager_operation) [with _Functor = main()::__lambda0]’
/usr/include/c++/4.8/functional:2457:19: required from ‘std::function<_Res(_ArgTypes ...)>::function(_Functor) [with _Functor = main()::__lambda0; <template-parameter-2-2> = void; _Res = void; _ArgTypes = {}]’
prog.cpp:24:41: required from here
/usr/include/c++/4.8/functional:1910:34: error: use of deleted function ‘main()::__lambda0::<lambda>(const main()::__lambda0&)’
__dest._M_access<_Functor*>() =
^
prog.cpp:23:31: note: ‘main()::__lambda0::<lambda>(const main()::__lambda0&)’ is implicitly deleted because the default definition would be ill-formed:
auto a = [c = std::move(c)]() {c.f();};
^
prog.cpp:4:5: error: ‘my_class::my_class(const my_class&)’ is private
my_class(const my_class&) = delete;
^
prog.cpp:23:31: error: within this context
auto a = [c = std::move(c)]() {c.f();};
^
prog.cpp:23:31: error: use of deleted function ‘my_class::my_class(const my_class&)’
prog.cpp:4:5: error: declared here
my_class(const my_class&) = delete;
^