I realize, after spending so much time on function wrapper classes, that all I want is a type erased API call. With inplace_function I get this but with a limited capacity. I'm either wasting memory or don't have enough. Its also 24 bytes for 2 words of capacity. With std::function, we have a call to the global allocator we cannot control. What I really want is a memory safe callback with no limitation on storage.
What I want is an interface wrapped in a smart pointer.