Le 14/01/2013 13:31, Konstantin Tokarev a écrit :
>
> 14.01.2013, 15:56, "Pau Garcia i Quiles" <[email protected]>:
>> On Mon, Jan 14, 2013 at 9:35 AM, Thiago Macieira <[email protected]> 
>> wrote:
>>
>>> On segunda-feira, 14 de janeiro de 2013 08.31.19, Yves Bailly wrote:
>>>> Which is not always that easy... if a library function returns, say, an
>>>> simple std::string *by value*, then who will destroy the allocated memory?
>>>> It's really too easy to break something, somwhere, causing a random crash
>>>> almost impossible to reproduce reliably.
>>>
>>> The ICU C API does not use std::string: it was meant to be used from C code.
>>> It's quite easy to avoid std::string in that case.
>>
>> But as John said a few mails ago, it seems the C is not enough to implement 
>> all the required features.
>
> ICU provides C++ API but it does not use std::string. It operates on char * 
> or UnicodeString objects.

Don't stay fixed on std::string or ICU, it was just given as a basic example in 
which it's
not always as easy to make sure allocated memory is freed in the same DLL ;-) 
This was just
an example in a broader discussion about mixing debug/release runtimes.

All I can tell after 10+ years programming heavy-weight apps on Windows, is 
"avoid
mixing runtimes at all cost". Just my own experience, nothing less, nothing 
more :-)

-- 
      /- Yves Bailly - Software developper  -\
      \- Sescoi R&D  - http://www.sescoi.fr -/
"The possible is done. The impossible is being done. For miracles,
thanks to allow a little delay."
_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to