There was a recent discussion about the C++ contracts, and one of the top comments [0][1] in it was that, well, there are already assertion libraries (especially after C++20's concepts) that already do all of that, and better.
[0] https://news.ycombinator.com/item?id=50361334
[1] https://news.ycombinator.com/item?id=50361455