Does boost have something like small_function (with customizable buffer size)?
I tried googling, but I found nothing. I presume that that means it does not exist, but it is possible it is maybe hidden under some name I could not think of. I am ok with using internal header of some library in case it is code that is covered by tests. regards, Ivan
Le 2022-02-15 21:30, Ivan Matek via Boost-users a écrit :
I tried googling, but I found nothing.
I presume that that means it does not exist, but it is possible it is maybe hidden under some name I could not think of.
I am ok with using internal header of some library in case it is code that is covered by tests.
AFAIK it does not (if, by small_function, you mean a trivially copyable general function object). We had the need for one at work and finally wrote it (so it's currently closed source, sorry). For what it's worth, it's around 100 lines of code (i guess that's one of the reason nobody submitted one to boost yet). Regards, Julien
On Wed, Feb 16, 2022 at 8:37 AM Julien Blanc
AFAIK it does not (if, by small_function, you mean a trivially copyable general function object).
It does not need to be trivially copyable, I just want to specify(64.128 or 1701) bytes of stack space (as template argument) to use before using heap, similar as LLVM has for some types, but not for std::function https://llvm.org/doxygen/classllvm_1_1SmallString.html
participants (2)
-
Ivan Matek
-
Julien Blanc