Used std::ref instead of writing my own lambda

Made one func const, just because I can; no reason.