2011-01-29 00:46:28 +01:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is dual licensed under the MIT and the University of Illinois Open
|
|
|
|
// Source Licenses. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
// <vector>
|
|
|
|
|
|
|
|
// iterator begin();
|
|
|
|
// iterator end();
|
|
|
|
// const_iterator begin() const;
|
|
|
|
// const_iterator end() const;
|
|
|
|
// const_iterator cbegin() const;
|
|
|
|
// const_iterator cend() const;
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <cassert>
|
|
|
|
#include <iterator>
|
|
|
|
|
2013-06-27 21:35:32 +02:00
|
|
|
#include "../../min_allocator.h"
|
|
|
|
|
2011-01-29 00:46:28 +01:00
|
|
|
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;
|
|
|
|
}
|
2013-06-27 21:35:32 +02:00
|
|
|
#if __cplusplus >= 201103L
|
|
|
|
{
|
|
|
|
typedef bool T;
|
|
|
|
typedef std::vector<T, min_allocator<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, min_allocator<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, min_allocator<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, min_allocator<T>> C;
|
|
|
|
C::iterator i;
|
|
|
|
C::const_iterator j;
|
|
|
|
}
|
|
|
|
#endif
|
2011-01-29 00:46:28 +01:00
|
|
|
}
|