Код: Выделить всё
void example() {
vector v;
v.emplace_back(1);
int *a = v.back().get();
{
// rest of code, v not used after this point
}
int b = *a;
}
Подробнее здесь: https://stackoverflow.com/questions/793 ... ving-scope
Код: Выделить всё
void example() {
vector v;
v.emplace_back(1);
int *a = v.back().get();
{
// rest of code, v not used after this point
}
int b = *a;
}