Boost C++ Libraries: Ticket #2903: istarts_with fails when called for a literal widechar string (VS2005 with /Zc:wchar_t-) https://svn.boost.org/trac10/ticket/2903 <p> When compiled with the flag /Zc:wchar_t-, this call returns false: </p> <p> istarts_with(L"Prefix.<a class="missing wiki">FollowedByText</a>", L"Prefix") </p> <p> The reason, as far as I could determine: </p> <p> When /Zc:wchar_t- is defined, range_detail::is_char_ptr(L"Prefix") returns false, and as_literal() treats its argument as an array. So boost::end() points past the terminating NULL character, and the comparison fails. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2903 Trac 1.4.3 boris.glick@… Wed, 01 Apr 2009 18:18:37 GMT attachment set https://svn.boost.org/trac10/ticket/2903 https://svn.boost.org/trac10/ticket/2903 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">Bug_in_istarts_with.cpp</span> </li> </ul> <p> Code sample to demonstrate a bug. Compile with /Zc:wchar_t- </p> Ticket Pavol Droba Wed, 01 Apr 2009 18:28:45 GMT owner, component changed; cc set https://svn.boost.org/trac10/ticket/2903#comment:1 https://svn.boost.org/trac10/ticket/2903#comment:1 <ul> <li><strong>cc</strong> <span class="trac-author">droba@…</span> added </li> <li><strong>owner</strong> changed from <span class="trac-author">Pavol Droba</span> to <span class="trac-author">Thorsten Ottosen</span> </li> <li><strong>component</strong> <span class="trac-field-old">string_algo</span> → <span class="trac-field-new">range</span> </li> </ul> <p> This is not something, that can reasonably be fixed inside string_algo library. literal processing is part of range library, therefore i'm reassigning it there. </p> Ticket Thorsten Ottosen Sun, 05 Apr 2009 20:46:52 GMT <link>https://svn.boost.org/trac10/ticket/2903#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2903#comment:2</guid> <description> <p> Fix in trunk ... </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Thorsten Ottosen</dc:creator> <pubDate>Sun, 05 Apr 2009 20:49:50 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/2903#comment:3 https://svn.boost.org/trac10/ticket/2903#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket