|
|
|
|
|
by btown
76 days ago
|
|
Is there any good documentation about contracts? https://en.cppreference.com/w/cpp/language/contracts.html is incredibly confusing - its first displayed example seems to be an edge case where the assertion itself causes a mutation? https://en.cppreference.com/w/cpp/language/function.html#Fun... is vaguely better, but still quite dense. IMO the syntax makes things hard for a newcomer to the syntax to understand, which I see as core to any programming language's goals of community. double square_root(double num) asserts_pre(num >= 0)
would have been far more self-evident than just double square_root(double num) pre(num >= 0)
But I suppose brevity won out. |
|