So this is the situation:
vector <string>::iterator * it;
{
vector <string> v{"asd", "asd"};
auto iter = v.begin();
it = new vector <string>::iterator(iter);
}
(**it) = string("asd");
Now, i can't find any resources on the web that tells me if this is UB or if it's valid code.
My question so is:
when i create a iterator, if that iterator has a lifetime longer than the container that refers to, is undefined behavior or is defined somewhere in the standard?