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

4 reposts1 like

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)