Date: Mon, 14 Nov 2016 11:09:35 -0300 From: =?UTF-8?B?T3RhY8OtbGlv?= <otacilio.neto@bsd.com.br> To: Pietro Cerutti <gahr@FreeBSD.org> Cc: freebsd-ports@freebsd.org, owner-freebsd-ports@freebsd.org Subject: Re: How compile "String inf = static_cast<ostringstream*>(&(ostringstream() << pAct.minArea))->str();" Message-ID: <d10217e1-8fe1-205c-b85b-0403b81c0d86@bsd.com.br> In-Reply-To: <d6f25afe1529486ce23d1d0945e87464@FreeBSD.org> References: <ebbf89d2-f83a-b03a-95db-05c7d5358aa7@bsd.com.br> <d6f25afe1529486ce23d1d0945e87464@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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*>(&(ostringstream() << >> pAct.minArea))->str(); > > There's nothing wrong with this code, provided that: > > * <sstream> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d10217e1-8fe1-205c-b85b-0403b81c0d86>