File Sorted.h

↰ Parent directory (ADS/sort)

The checks of the contracts of the sorts [see File Contract.h]: a copy of the input kept only when the audits are on (ADS_CONTRACTS >= 3), and the check that the output is sorted and holds the same items as the input, which sorts a copy of the input with std::sort and compares the two item by item through the equivalence of the order, in :math:` O( n log n ) ` time instead of the :math:` O( n^2 ) ` of std::is_permutation with a predicate; and the check that a sequence is sorted.

Definition (ADS/sort/Sorted.h)

Detailed Description

These checks call the comparator of the caller, so that checkingContract() tells a comparator that counts its calls, as those of the tests of the book, which calls come from a contract. The functions are defined in Sorted.tpp.

Donato Meoli

Dipartimento di Informatica Universita’ di Pisa

by Donato Meoli

Includes

Included By

Namespaces

Functions

Variables