From owner-freebsd-ports@freebsd.org Mon Nov 14 09:30:07 2016 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 220EAC40BD2; Mon, 14 Nov 2016 09:30:07 +0000 (UTC) (envelope-from gahr@FreeBSD.org) Received: from mail.ptrcrt.ch (gahr.cloud.tilaa.com [84.22.109.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60BE810EC; Mon, 14 Nov 2016 09:30:05 +0000 (UTC) (envelope-from gahr@FreeBSD.org) Received: from webmail.ptrcrt.ch (www.gahr.ch [192.168.1.2]) by mail.ptrcrt.ch (OpenSMTPD) with ESMTPSA id 53f6ffd9 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO; Mon, 14 Nov 2016 09:29:57 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Mon, 14 Nov 2016 10:29:57 +0100 From: Pietro Cerutti To: =?UTF-8?Q?Otac=C3=ADlio?= Cc: freebsd-ports@freebsd.org, owner-freebsd-ports@freebsd.org Subject: Re: How compile "String inf = static_cast(&(ostringstream() << pAct.minArea))->str();" Organization: The FreeBSD Project In-Reply-To: References: Message-ID: X-Sender: gahr@FreeBSD.org User-Agent: Roundcube Webmail/1.2.2 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2016 09:30:07 -0000 On 2016-11-09 02:37, OtacĂ­lio wrote: > I'm trying create a patch to OpenCV 3.1 runs on FreeBSD but clang > don't compiles lines like this: > > String inf = static_cast(&(ostringstream() << > pAct.minArea))->str(); There's nothing wrong with this code, provided that: * is included * ostringstream is actually std::ostringstream * pAct.minArea defines operator<< to std::ostringstream or one of its base classes What's the error you're getting? That being said, I'd switch to using c++11 and String inf = std::to_string(pAct.minArea) :) -- Pietro Cerutti gahr@FreeBSD.org PGP Public Key: http://gahr.ch/pgp