iterators.pass.cpp [plain text]
#include <vector>
#include <cassert>
#include <iterator>
int main()
{
{
typedef bool T;
typedef std::vector<T> C;
C c;
C::iterator i = c.begin();
C::iterator j = c.end();
assert(std::distance(i, j) == 0);
assert(i == j);
}
{
typedef bool T;
typedef std::vector<T> C;
const C c;
C::const_iterator i = c.begin();
C::const_iterator j = c.end();
assert(std::distance(i, j) == 0);
assert(i == j);
}
{
typedef bool T;
typedef std::vector<T> C;
C c;
C::const_iterator i = c.cbegin();
C::const_iterator j = c.cend();
assert(std::distance(i, j) == 0);
assert(i == j);
assert(i == c.end());
}
{
typedef bool T;
typedef std::vector<T> C;
C::iterator i;
C::const_iterator j;
}
}