collate_byname<wchar_t>::string_type collate_byname<wchar_t>::do_transform(const wchar_t* low, const wchar_t* high) const { size_t n = _Locale_strwxfrm(_M_collate, NULL, 0, low, high - low); // NOT PORTABLE. What we're doing relies on internal details of the // string implementation. (Contiguity of string elements and presence // of trailing zero.) string_type buf(n, 0); _Locale_strwxfrm(_M_collate, &(*buf.begin()), n + 1, low, high - low); return buf; }
collate_byname<wchar_t>::string_type collate_byname<wchar_t> ::do_transform(const wchar_t* low, const wchar_t* high) const { size_t n = _Locale_strwxfrm(_M_collate, NULL, 0, low, high - low); __vector__<wchar_t, allocator<wchar_t> > buf(high - low); _Locale_strwxfrm(_M_collate, &buf.front(), n, low, high - low); wchar_t& __c1 = *(buf.begin()); wchar_t& __c2 = (n == (size_t)-1) ? *(buf.begin() + (high-low-1)) : *(buf.begin() + n); // wchar_t& __c2 = *(buf.begin() + n); return string_type( &__c1, &__c2 ); }