Disable dynamic allocation in stringstream
#2737
-
While working in memory restricted environment using custom allocator, I noticed that the following code:
Performs a dynamic allocation (via I assume this is not a bug in the STL implementation, as the standard says that the allocator will be used to construct the string in Is there something that can be done to prevent this? Or should I use |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Due to binary compatibility restrictions, we can't change how |
Beta Was this translation helpful? Give feedback.
Due to binary compatibility restrictions, we can't change how
basic_stringstream
uses the provided allocator - so if you need to control dynamic allocation, we recommend usingstd::basic_string
directly (where the provided allocator will be used for all persistent allocations).