
21 Dec
2024
21 Dec
'24
1:46 p.m.
On Sat, Dec 21, 2024 at 2:15 PM Andrzej Krzemienski
Issue here is that you can not inherit from containers(or you can, but you shouldn't). This is a well known issue in C++.
Could you explain what the issue is? I do not believe I have ever heard of it.
Relevant containers do not have virtual destructor. And AFAIK there is no way to prevent people from putting your type in unique_ptr. IIRC some time ago I read that even if objects are of same size(i.e. derived object has no extra members) according to standard it is UB to delete derived using pointer to base, but I did not check in the standard.