4 ms·
Something like this would do https://en.cppreference.com/w/cpp/named_req/Allocator https://en.cppreference.com/w/cpp/named_req/Allocator
by adontz 3y ago
Something like this would do https://en.cppreference.com/w/cpp/named_req/Allocator https://en.cppreference.com/w/cpp/named_req/Allocator
- defen 3y agoIn practice what would the actual code look like (pseudo-code is fine). How would I concatenate strings at runtime using `+`, once with one allocator and then again with another allocator?
- adontz 3y ago>> once with one allocator and then again with another allocator? I would: 1. Prohibit concatenating strings with different allocators. Strings with the same allocator can be concatenated. 2. Provide StringBuilder for concatenating anything in an effective manner. It's not only about different allocators, but supporting C-style strings and reducing number of allocations. So '+' is only for strings with same allocator, same UTF encoding, same everything. I'm really not fond of implicit type conversions.