<div dir="ltr">Hi!<br><br>In certain embedded situations, you may want to avoid needless heap allocations. Since the major compiler makers apply &quot;small object optimisation&quot;, it would be nice to somehow query if a type satisfies the SOO or if std::function would do a heap allocation (something that we could maybe static_assert in the very least if no other options are automatically available). <br> I believe that whether an object satisfies SOO or not may depend on both size and alignment of the type, so the most straight-forward API I can think of is something along the lines of `std::function_is_inplace_v&lt;FUNCTION, TYPE&gt;` or something like that.<br>It would also be nice to have a &quot;std::inplace_function&quot; that is a stand-in replacement for std::function when it is unfit for similar reasons. I see a &quot;SG14&quot; inplace_function, but I am unsure if inplace_function has been up for discussion before and shot down for some reason.<br><br>// Robin</div>

