Basically string is type of basic_string template class with char instantiation typedef basic_string string
Up to my knowledge, Here basic_string is class which contains some collections of some data members and member functions as similar like developer is creating one class.
Memseting on user defined class is not giving any issue(Exception for virtual class). So why it is causing issue in during memset on library class?
By exploring some links like this (memset structure with std::string contained), I found like it is not safe to apply memset on string because it is modifying internal data.
So my question is what kind of internal data is modified? Basically it can be POD’s or User defined data types. Is any other low level implementation is made inside string library.
Please note, I am not speaking about using the object after memsetting the class object, My entire concern is upon memsetting the object.
I know using memset on class is really bad idea, This is just for gaining the internal implementation knowledge.