[cfe-dev] searching for an empty string in an empty string

Vladimir Voskresensky - Oracle vladimir.voskresensky at oracle.com
Tue Jun 2 12:01:47 PDT 2015


Hello Tomek,

What is your OS and the version of Studio you use?
What is your compile line for Studio?

Thanks,
Vladimir.

On 06/ 2/15 05:51 PM, Tomasz Mikolajczyk wrote:
> Hi,
>
> What should be the value of a pos variable in the following piece of code?
>
> auto pos = std::string().find("");
>
> I couldn't find answer to that and noticed it varies between standard library 
> implementations. For most I've checked pos is 0 (libstdc++, libcxx, msvc). I 
> noticed it is npos for Oracle Solaris SunPRO. I think that both results are 
> explainable. Is it an UB?
>
> Regards,
> Tomek
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150602/8f4e6bac/attachment.html>


More information about the cfe-dev mailing list