Re: [Stlport-devel] need a string optimization
Brought to you by:
complement
|
From: Nigel S. <nst...@nv...> - 2009-03-30 23:01:01
|
>> is there a way to construct "const string" from >> existing "const char*" without dynamic memory allocation? > STLport implements library in accordance with C++ Standard or > C++ Standard Drafts. The absent of construction like you > suggest above has evident reasons: no guarantee that > time to live of originating (const char*) object longer then > ttl of stringwrapper object as you suggestion imply. Perhaps a custom allocator could be used in the cast of strings that don't need to be copied into dynamic memory. But there would need to be the ability to mix these strings with "regularly" allocated strings... ...sounds troublesome. - Nigel ----------------------------------------------------------------------------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. ----------------------------------------------------------------------------------- |