Comment by Surac

4 days ago

What are they even good forbid we can’t validate the input with? A convenient way to write down parameter ranges. Nothing more

Same uses as assert, but more options for what to do when they fail and you can move them (pre/post at least) into the function declaration so they act as a kind of executable documentation (when you compile the program so that they are executed and not dropped).