From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 112980 invoked by alias); 6 Jun 2017 11:54:55 -0000 Mailing-List: contact cygwin-apps-help@cygwin.com; run by ezmlm Precedence: bulk Sender: cygwin-apps-owner@cygwin.com List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Mail-Followup-To: cygwin-apps@cygwin.com Received: (qmail 112775 invoked by uid 89); 6 Jun 2017 11:54:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy= X-HELO: rgout06.bt.lon5.cpcloud.co.uk Received: from rgout0607.bt.lon5.cpcloud.co.uk (HELO rgout06.bt.lon5.cpcloud.co.uk) (65.20.0.134) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 06 Jun 2017 11:54:53 +0000 X-OWM-Source-IP: 86.141.128.130 (GB) X-OWM-Env-Sender: jonturney@btinternet.com X-Junkmail-Premium-Raw: score=8/50,refid=2.7.2:2017.6.2.221216:17:8.707,ip=,rules=NO_URI_FOUND, NO_CTA_URI_FOUND, NO_MESSAGE_ID, NO_URI_HTTPS, TO_MALFORMED Received: from localhost.localdomain (86.141.128.130) by rgout06.bt.lon5.cpcloud.co.uk (9.0.019.13-1) (authenticated as jonturney@btinternet.com) id 58F7952B052245AA; Tue, 6 Jun 2017 12:54:57 +0100 From: Jon Turney To: cygwin-apps@cygwin.com Cc: Jon Turney Subject: [PATCH setup 3/9] Access StringOption's value by reference Date: Tue, 06 Jun 2017 11:55:00 -0000 Message-Id: <20170606115432.105020-4-jon.turney@dronecode.org.uk> In-Reply-To: <20170606115432.105020-1-jon.turney@dronecode.org.uk> References: <20170606115432.105020-1-jon.turney@dronecode.org.uk> X-SW-Source: 2017-06/txt/msg00010.txt.bz2 Access StringOption's value by reference, to avoid unnecessary temporaries. --- libgetopt++/include/getopt++/StringOption.h | 2 +- libgetopt++/src/StringOption.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libgetopt++/include/getopt++/StringOption.h b/libgetopt++/include/getopt++/StringOption.h index f13bc22..f13be8c 100644 --- a/libgetopt++/include/getopt++/StringOption.h +++ b/libgetopt++/include/getopt++/StringOption.h @@ -32,7 +32,7 @@ public: virtual std::string const shortHelp () const; virtual Result Process (char const *); virtual Argument argument () const; - operator std::string () const; + operator const std::string& () const; private: Argument _optional; diff --git a/libgetopt++/src/StringOption.cc b/libgetopt++/src/StringOption.cc index 462cf0d..210b00a 100644 --- a/libgetopt++/src/StringOption.cc +++ b/libgetopt++/src/StringOption.cc @@ -60,7 +60,7 @@ StringOption::Process (char const *optarg) return Failed; } -StringOption::operator string () const +StringOption::operator const string& () const { return _value; } -- 2.12.3