C++20's constexpr virtual functions can simplify templates code
Recently, I’ve learned about constexpr virtual
functions. The support for
which was added along with C++20. C++23 additionally allows for constexpr new
(with some restrictions). There’s a great article about constexpr virtual
on C++ stories blog, followed by another great post about constexpr new. I highly recommend reading Bartek’s posts.
Wanting to add this new feature to my tool belt I was wondering what would be
the best application for constexpr virtual
and how would I use them in my code.