2 ms·
std::function is literally an object that can be invoked like a function. As an object, it can contain multiple values. Move-only values are very used for comm
by corysama 4y ago
std::function is literally an object that can be invoked like a function. As an object, it can contain multiple values.
Move-only values are very used for common situations of unique resources that should not be duplicated.
But, what if you want to enclose a move-only value in a std::function? Are you simply out of luck and must give up on your dreams? A move-only function lets you get that work done.