[Qt-interest] Undefined behavior in QString::toStdWString() ?

Thiago Macieira thiago.macieira at trolltech.com
Thu Dec 11 23:32:45 CET 2008


Robert Hairgrove wrote:
>If str is empty, begin() also does not point to anything, AFAIK; i.e.,
>begin() == end() in that case.

begin() == end(), but they do point somewhere.

But, in any case, even if it didn't, there's no problem because if the 
string is empty, the toWCharArray function won't do anything.

>It seems to me that checking for length() == 0, which is done only in
>case the compiler is MSVC 2005, should be done in any case.

-- 
Thiago Macieira - thiago.macieira (AT) nokia.com
  Senior Software Engineer - Nokia, Qt Software
  Qt Software is hiring - ask me
      Sandakerveien 116, NO-0402 Oslo, Norway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20081211/b6b20482/attachment.bin 


More information about the Qt-interest-old mailing list