finished updating docs up to tutorial section

This commit is contained in:
Lorenzo Caminiti
2016-04-08 20:16:02 -07:00
parent 02ed8498ab
commit a5c462ccd2
35 changed files with 1705 additions and 1383 deletions

View File

@@ -0,0 +1,21 @@
#include <limits>
#include <cassert>
//[no_contracts
int inc(int& x)
// Precondition: x < std::numeric_limits<int>::max()
// Postcondition: x == oldof(x) + 1
// result == oldof(x)
{
return x++;
}
//]
int main() {
int x = std::numeric_limits<int>::max() - 1;
assert(inc(x) == std::numeric_limits<int>::max() - 1);
assert(x == std::numeric_limits<int>::max());
return 0;
}