]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/contract/example/features/introduction_comments.cpp
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / libs / contract / example / features / introduction_comments.cpp
1
2 // Copyright (C) 2008-2018 Lorenzo Caminiti
3 // Distributed under the Boost Software License, Version 1.0 (see accompanying
4 // file LICENSE_1_0.txt or a copy at http://www.boost.org/LICENSE_1_0.txt).
5 // See: http://www.boost.org/doc/libs/release/libs/contract/doc/html/index.html
6
7 #include <cassert>
8
9 //[introduction_comments
10 void inc(int& x)
11 // Precondition: x < std::numeric_limit<int>::max()
12 // Postcondition: x == oldof(x) + 1
13 {
14 ++x; // Function body.
15 }
16 //]
17
18 int main() {
19 int x = 10;
20 inc(x);
21 assert(x == 11);
22 return 0;
23 }
24