From owner-freebsd-ports@freebsd.org Mon Nov 14 14:09:41 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 95584C3FE26 for ; Mon, 14 Nov 2016 14:09:41 +0000 (UTC) (envelope-from otacilio.neto@bsd.com.br) Received: from mail-qt0-x234.google.com (mail-qt0-x234.google.com [IPv6:2607:f8b0:400d:c0d::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4739D1CF2 for ; Mon, 14 Nov 2016 14:09:41 +0000 (UTC) (envelope-from otacilio.neto@bsd.com.br) Received: by mail-qt0-x234.google.com with SMTP id c47so47549712qtc.2 for ; Mon, 14 Nov 2016 06:09:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsd.com.br; s=capeta; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=6Aw3hSj3RAyHmscfPvbi4H8iTiRBkyYuq61y6xK3blE=; b=DVecGtFKYhViFTK7dRkUGG9817HgIPedmc5FHuXP455cBUy6Be4PKIimyrcwbiX2/z MESs85brt1o3KVrtymi/o7sRUr8cc0+6sEPBPTNxIb8dBx16CEOS/j+y5u0PoAJyPeg+ evrS50QeHUjy8auLGjFPjcln29TMioOR/sqk4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=6Aw3hSj3RAyHmscfPvbi4H8iTiRBkyYuq61y6xK3blE=; b=NqrjUafXqPMlqr0oF+jZyvI1Z6RtFK3hRSo37F+Iv9vwDLA8s8PMC9qfYIm/tKnRrB JeLguL/jNuu+9pSMPR7YRpxaoGPB0fACEU66wBcVoBorAfF4Qae5P9AVJMVrI04qVmm3 e+7kS2ccDfpjIOKqXhB+n4HMAfqI5Bob7p+FZwnlBuB4s1+PruXc3lgOK689EI/IrtV8 KD8g5vlnZzRfwBTBiyY//he5H7OFbKpoDzTbKFw/Un/LoSkY+Qa6gBZ/uXAqcvgLUe0E MlKEFMpEk9XVowU7CjQETeKnBJgazLf5rk0pmPVzszs8ppJ+2xQujNZyYX4J5pCGCqUk iwoA== X-Gm-Message-State: ABUngvfJvRIc7BdbxpUQP1lAZfTk/QdxF10OEdfZ2pQyjlbTAsnGzBuHQXZGfaWM/mR6ag== X-Received: by 10.237.49.230 with SMTP id 93mr10744400qth.109.1479132580335; Mon, 14 Nov 2016 06:09:40 -0800 (PST) Received: from [10.50.213.112] ([177.20.152.129]) by smtp.googlemail.com with ESMTPSA id 29sm12513556qtu.21.2016.11.14.06.09.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Nov 2016 06:09:39 -0800 (PST) Subject: Re: How compile "String inf = static_cast(&(ostringstream() << pAct.minArea))->str();" To: Pietro Cerutti References: Cc: freebsd-ports@freebsd.org, owner-freebsd-ports@freebsd.org From: =?UTF-8?B?T3RhY8OtbGlv?= Message-ID: Date: Mon, 14 Nov 2016 11:09:35 -0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit 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 14:09:41 -0000 Em 14/11/2016 06:29, Pietro Cerutti escreveu: > 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) :) > I'm using your suggestion and it works fine. Thanks a lot! []'s -Otacilio