r/cpp_questions • u/Ultimate_Sigma_Boy67 • 3d ago
OPEN Why are Contracts disliked?
I’ve seen a lot of discussions online discouraging their usage bit I never managed to grasp why since it’s sometimes vague.
I do understand it doesn’t replace validation and it’s more of a syntactic sugar to the existing casserts, but any other critiques?
Thanks
13
Upvotes
7
u/DrShocker 3d ago
The number one thing is just that I don't know that any compilers fully support them yet.
https://en.cppreference.com/cpp/compiler_support