summaryrefslogtreecommitdiff
path: root/libcxx/test/containers/associative/map/map.access/iterator.pass.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-04-18 21:39:23 +0000
committerBill Wendling <isanbard@gmail.com>2012-04-18 21:39:23 +0000
commit392e4fbdd9b152efff4c051286f6b2c21270c902 (patch)
tree4ac339be2c4c7c596f068b59d5e512b157c7b433 /libcxx/test/containers/associative/map/map.access/iterator.pass.cpp
parenteb1c2bdc1f55fbc5d1e7bb86e9f0e038b0f5adb7 (diff)
Creating release_31 branchllvmorg-3.1.0-rc1
llvm-svn: 155059 llvm-svn: 155053 llvm-svn: 155051
Diffstat (limited to 'libcxx/test/containers/associative/map/map.access/iterator.pass.cpp')
-rw-r--r--libcxx/test/containers/associative/map/map.access/iterator.pass.cpp120
1 files changed, 0 insertions, 120 deletions
diff --git a/libcxx/test/containers/associative/map/map.access/iterator.pass.cpp b/libcxx/test/containers/associative/map/map.access/iterator.pass.cpp
deleted file mode 100644
index d8b2e1a58d5b..000000000000
--- a/libcxx/test/containers/associative/map/map.access/iterator.pass.cpp
+++ /dev/null
@@ -1,120 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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.
-//
-//===----------------------------------------------------------------------===//
-
-// <map>
-
-// class map
-
-// iterator begin();
-// const_iterator begin() const;
-// iterator end();
-// const_iterator end() const;
-//
-// reverse_iterator rbegin();
-// const_reverse_iterator rbegin() const;
-// reverse_iterator rend();
-// const_reverse_iterator rend() const;
-//
-// const_iterator cbegin() const;
-// const_iterator cend() const;
-// const_reverse_iterator crbegin() const;
-// const_reverse_iterator crend() const;
-
-#include <map>
-#include <cassert>
-
-int main()
-{
- {
- typedef std::pair<const int, double> V;
- V ar[] =
- {
- V(1, 1),
- V(1, 1.5),
- V(1, 2),
- V(2, 1),
- V(2, 1.5),
- V(2, 2),
- V(3, 1),
- V(3, 1.5),
- V(3, 2),
- V(4, 1),
- V(4, 1.5),
- V(4, 2),
- V(5, 1),
- V(5, 1.5),
- V(5, 2),
- V(6, 1),
- V(6, 1.5),
- V(6, 2),
- V(7, 1),
- V(7, 1.5),
- V(7, 2),
- V(8, 1),
- V(8, 1.5),
- V(8, 2)
- };
- std::map<int, double> m(ar, ar+sizeof(ar)/sizeof(ar[0]));
- assert(std::distance(m.begin(), m.end()) == m.size());
- assert(std::distance(m.rbegin(), m.rend()) == m.size());
- std::map<int, double>::iterator i;
- i = m.begin();
- std::map<int, double>::const_iterator k = i;
- assert(i == k);
- for (int j = 1; j <= m.size(); ++j, ++i)
- {
- assert(i->first == j);
- assert(i->second == 1);
- i->second = 2.5;
- assert(i->second == 2.5);
- }
- }
- {
- typedef std::pair<const int, double> V;
- V ar[] =
- {
- V(1, 1),
- V(1, 1.5),
- V(1, 2),
- V(2, 1),
- V(2, 1.5),
- V(2, 2),
- V(3, 1),
- V(3, 1.5),
- V(3, 2),
- V(4, 1),
- V(4, 1.5),
- V(4, 2),
- V(5, 1),
- V(5, 1.5),
- V(5, 2),
- V(6, 1),
- V(6, 1.5),
- V(6, 2),
- V(7, 1),
- V(7, 1.5),
- V(7, 2),
- V(8, 1),
- V(8, 1.5),
- V(8, 2)
- };
- const std::map<int, double> m(ar, ar+sizeof(ar)/sizeof(ar[0]));
- assert(std::distance(m.begin(), m.end()) == m.size());
- assert(std::distance(m.cbegin(), m.cend()) == m.size());
- assert(std::distance(m.rbegin(), m.rend()) == m.size());
- assert(std::distance(m.crbegin(), m.crend()) == m.size());
- std::map<int, double>::const_iterator i;
- i = m.begin();
- for (int j = 1; j <= m.size(); ++j, ++i)
- {
- assert(i->first == j);
- assert(i->second == 1);
- }
- }
-}