Post

Does anybody know if there is a conforming implementation of C++26's std::polymorphic that stores small object in situ? I'm trying to avoid writing one. #cpp

Only typy able to do it in constexpr is the string type; std::function is not constexpr mainly because of the SBO. There is no mechanism how to store unknown type somewhere without allocation in constexpr (you need reinterpret_cast)

which would work now, but once we will get non-transient constexpr allocations ... suddenly you need to deal with types which are otherwise short-buffer eligible, but they are not, I ran into similar fun with constexpr std::any