Use unique_function were appropriate to support movable-only arguments