lamarrr/STX

Pinning & In-place Construction of Option (and Result?)

lamarrr opened this issue · 0 comments

Is your feature request related to a problem? Please describe.
I have types that are not relocatable in my project (pinned to a memory address) and need to be able to construct Option of them. we use a lot of std::move that don't necessarily move the data but construct r-value references to them.
Result doesn't need pinning since it requires relocation (i.e. it is a return channel).
This would also mean removing our std::is_move_constructible_v requirement on Option, and also allow creating an Option<T> from Some(Args&&). We'd need to make Some be able to perfectly forward these arguments.

Describe the solution you'd like
Be able to pin Option to a memory address.

Describe alternatives you've considered
None

Additional context
None