Closed pfeatherstone closed 2 years ago
If i run on my local machine i get output:
s1 `���-�` addr : 0x7fff2dc0c350
s2 `world` addr : 0x7fff2dc0c380
I've had a go at fixing this. I'm not convinced the changes to void_ptr
are trivial.
First bug is use of std::aligned_storage<Size, Alignment>
instead of std::aligned_storage_t<Size, Alignment>
@krzysztof-jusiak any ideas ?
I think i've fixed the library. But it definitely isn't polished. Here is a godbolt link
nice @pfeatherstone :clamp: Could you create a PR, please? thanks
@krzysztof-jusiak Yes no problem
Solved
Expected Behavior
We expect the following to work.
Actual Behavior
We get a segmentation fault. It breaks when using
local_storage
and using move semantics. The library just moves or swaps the underlying pointers. That won't work. Explicit move constructors MUST be called. So I believevoid_ptr
should be upgraded to include:Steps to Reproduce the Problem
Run the godbolt link.
Specifications
Run on any system and it will break.