`function_ref` is a lightweight function pointer, whereas `std::function` always involves a heap allocation.