13.02.2024 13:07 Bonita Montero kirjutas:
> If you initialize a function<>-object with a reference_wrapper it
> is guaranteed that the function<>-object references an external
> function-object without any memory allocation. libstdc++ and libc++
> don't allocate any memory with such function<>-objects according
> to the standard, but MSVC does allocate external memory.
Cannot confirm that. MSVC++ 2022 x64 Release mode does not print "alloc"
at all for this program. In Debug mode there are a couple of allocs, but
these seem to be related to some std::string internals, not the
reference wrapper.