std::function snippet