[cfe-dev] searching for an empty string in an empty string
Vladimir Voskresensky - Oracle
vladimir.voskresensky at oracle.com
Wed Jun 3 11:38:23 PDT 2015
On 06/ 2/15 05:51 PM, Tomasz Mikolajczyk wrote:
> 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?
In the latest SunPRO 12.4 pos is 0 as well.
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev