On 28.04.2009 20:31, Nagy József wrote: > what happeining, when I call the SetCapacity() function of the > csStringFast class? > Is the following code problem free? > > csStringFast<256> my_string; > mystring.SetCapacity(500);
Yes. The size you give as the template argument is the size of the class-internal buffer; so anything that fits into that is stored inside the object, not the heap (which means a bit less overhead, hence the "fast"). However, anything bigger than that will still be allocated on the heap - you'll lose the benefits of class-internal storage, but there is no difference in behaviour seen from the outside. -f.r.
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Register Now & Save for Velocity, the Web Performance & Operations Conference from O'Reilly Media. Velocity features a full day of expert-led, hands-on workshops and two days of sessions from industry leaders in dedicated Performance & Operations tracks. Use code vel09scf and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________ Crystal-main mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/crystal-main Unsubscribe: mailto:[email protected]?subject=unsubscribe
