c++ lambda 使用

bool KafkaResourceManager::Register(std::string name, std::function()> callback) {
  std::shared_ptr resource = callback();
  if (resource) {
    return false;
  }
  kafka_resources_[name] = resource;
  return true;
}

 


  bool Register(std::string name, std::function()> callback);

 

你可能感兴趣的:(C++实战)