Here's a trivial example of what I'm trying to achieve. Is it even possible to pass lambda into template function?
HEADER FILE
class my_impl {
public:
template<typename F> void do_something(F && f);
};
CPP FILE
// .cpp file
template<typename F> my_impl::do_something(F && f)
{
// ... implementation
}
template void my_impl::do_something<std::string &&>(std::string &&); // OK
template void my_impl::do_something<???>(???); // what goes here for lambda?
// used like this
my_impl impl;
impl.do_something( "123" );
impl.do_something( []() {
...
} );