Featured post
c++ - What is causing boost::lower to fail an is_singular assertion? -
i getting odd behavior boost::lower, when called on std::wstring. in particular, have seen following assertion fail in release build (but not in debug build):
assertion failed: !is_singular(), file c:\boost_1_40_0\boost/range/iterator_range.hpp, line 281
i have seen appear memory errors after calling boost::to_lower in contexts such as:
void test(const wchar_t* word) { std::wstring buf(word); boost::to_lower(buf); ... }
replacing calls boost::tolower(wstr)
std::transform(wstr.begin(), wstr.end(), wstr.begin(), towlower)
appears fix problem; i'd know what's going wrong.
my best guess perhaps problem has changing case of unicode characters -- perhaps encoding size of downcased character different encoding size of source character?
does have ideas might going on here? might if knew "is_singular()" means in context of boost, after doing few google searches wasn't able find documentation it.
relevant software versions: boost 1.40.0; ms visual studio 2008.
an iterator range should singular if it's been constructed default constructor (stores singular iterators, i.e doesn't represent range). it's rather hard believe boost's to_lower
function manages create singular range, suggests problem might elsewhere (a result of undefined behavior, such using uninitialized variables might initialized known value in debug builds).
read more on heisenbugs.
- Get link
- X
- Other Apps
Comments
Post a Comment