[libcxx-commits] [libcxx] [libc++] Add __pointer_int_pair (PR #94324)

via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jun 6 12:32:09 PDT 2024


huixie90 wrote:

Out of interest, how is this useful in the implementation of move_only_function ? I was thinking of

union {
   void* heap_callable_,
   alignas(void*) unsigned char buffer_[N]
   }
   
const vtable* vtable_

Where vtable contains
call
move
Destroy

We don’t seem to need a bool because the vtable function implementation should deal with question whether or not the object is in the buffer or in the heap


https://github.com/llvm/llvm-project/pull/94324


More information about the libcxx-commits mailing list