// Copyright (C) 2000, International Business Machines
// Corporation and others. All Rights Reserved.
#ifndef _BCP_VECTOR_SANITY_H
#define _BCP_VECTOR_SANITY_H
// This file is fully docified.
#include "BCP_vector.hpp"
/** A helper function to test whether a set positions is sane for a vector.
The set of positions consists of the entries in
[firstpos,lastpos)
. The length of the vector is
maxsize
.
The set of positions is defined to be sane if and only if the entries are
in increasing order, there are no duplicate entries, no negative entries
and the largest entry is smaller than maxsize
.
If the sanity check fails the function throws a
\URL[BCP_fatal_error
]{BCP_fatal_error.html} exception.
*/
void BCP_vec_sanity_check(BCP_vec::const_iterator firstpos,
BCP_vec::const_iterator lastpos,
const int maxsize);
#endif