On Thursday, 9 January 2014 at 09:58:24 UTC, Walter Bright wrote:
Please explain how this can work passing both string literals and allocated strings to cat().
By having your own string allocator that tests for membership when you free (if you allow free and foreign strings in your cat)?
How do you return a string that is the path part of a path/filename? (The terminating 0 is not a problem solved by creating your own allocator.)
If you discard the original you split at '/'. If you use your own stringallocator you don't have to worry about free... You either let the garbage remain until the pool is released or have a separate allocation structure that allows internal splits (no private size info before first char).
