From issues-return-98729-archive-asf-public=cust-asf.ponee.io@nifi.apache.org Mon Jun 15 10:30:11 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id BD339180656 for ; Mon, 15 Jun 2020 12:30:10 +0200 (CEST) Received: (qmail 12315 invoked by uid 500); 15 Jun 2020 10:30:10 -0000 Mailing-List: contact issues-help@nifi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@nifi.apache.org Delivered-To: mailing list issues@nifi.apache.org Received: (qmail 12306 invoked by uid 99); 15 Jun 2020 10:30:10 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Jun 2020 10:30:10 +0000 From: =?utf-8?q?GitBox?= To: issues@nifi.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Bnifi-minifi-cpp=5D_szaszm_commented_on_a_change_in?= =?utf-8?q?_pull_request_=23809=3A_MINIFICPP-1254_-_Introduce_optional-lite?= Message-ID: <159221701001.8807.12643082412289165586.asfpy@gitbox.apache.org> Date: Mon, 15 Jun 2020 10:30:10 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit In-Reply-To: References: szaszm commented on a change in pull request #809: URL: https://github.com/apache/nifi-minifi-cpp/pull/809#discussion_r440079252 ########## File path: libminifi/include/utils/OptionalUtils.h ########## @@ -0,0 +1,44 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef LIBMINIFI_INCLUDE_UTILS_OPTIONALUTILS_H_ +#define LIBMINIFI_INCLUDE_UTILS_OPTIONALUTILS_H_ + +#include + +#include +#include "utils/GeneralUtils.h" + +namespace org { +namespace apache { +namespace nifi { +namespace minifi { +namespace utils { + +template +nonstd::optional::type> optional_from_nullable(T&& obj) { Review comment: I recommend introducing an alias to optional in our namespace and referring to that in our code. This would simplify later extension and migration. ``` namespace org::apache::nifi::minifi::utils { using nonstd::optional; } // namespace org::apache::nifi::minifi::utils ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org