c++ lambda 使用

  • Post author:
  • Post category:其他


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


  bool Register(std::string name, std::function<std::shared_ptr<rubik::KafkaResource>()> callback);



版权声明:本文为bravezhe原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。