Subject: [Boost-bugs] [Boost C++ Libraries] #2903: istarts_with fails when called for a literal widechar string (VS2005 with /Zc:wchar_t-)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-04-01 18:17:13
#2903: istarts_with fails when called for a literal widechar string (VS2005 with
/Zc:wchar_t-)
-----------------------------------------------------+----------------------
Reporter: boris.glick_at_[hidden] | Owner: pavol_droba
Type: Bugs | Status: new
Milestone: | Component: string_algo
Version: Boost 1.37.0 | Severity: Problem
Keywords: istarts_with, is_char_ptr, /Zc:wchar_t- |
-----------------------------------------------------+----------------------
When compiled with the flag /Zc:wchar_t-, this call returns false:
istarts_with(L"Prefix.FollowedByText", L"Prefix")
The reason, as far as I could determine:
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.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/2903> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:59 UTC