I'm currently working on a device with very little memory (4MB) and I have a component of my program that requires an std::set. I would like to migrate this set from using std::string to using const char pointers but I was wondering how memory is allocated to constant character pointers when used in a std::set.
Will the memory allocated for each entry to the std::set be freed when the pointer is removed from the set (by using .clear() or going out of scope), or will the string literal remain in memory until the end of the program's execution?
Thank you very much for your help. :)