1160814Ssimon// 2005-10-08  Paolo Carlini  <pcarlini@suse.de>
2160814Ssimon//
3160814Ssimon// Copyright (C) 2005-2015 Free Software Foundation, Inc.
4160814Ssimon//
5160814Ssimon// This file is part of the GNU ISO C++ Library.  This library is free
6160814Ssimon// software; you can redistribute it and/or modify it under the
7160814Ssimon// terms of the GNU General Public License as published by the
8160814Ssimon// Free Software Foundation; either version 3, or (at your option)
9160814Ssimon// any later version.
10160814Ssimon//
11160814Ssimon// This library is distributed in the hope that it will be useful,
12160814Ssimon// but WITHOUT ANY WARRANTY; without even the implied warranty of
13160814Ssimon// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14160814Ssimon// GNU General Public License for more details.
15160814Ssimon//
16160814Ssimon// You should have received a copy of the GNU General Public License along
17160814Ssimon// with this library; see the file COPYING3.  If not see
18160814Ssimon// <http://www.gnu.org/licenses/>.
19160814Ssimon
20160814Ssimon// 6.3.4.5  Class template unordered_multiset
21160814Ssimon
22160814Ssimon#include <tr1/unordered_set>
23160814Ssimon#include <string>
24160814Ssimon#include <testsuite_hooks.h>
25160814Ssimon
26160814Ssimon// libstdc++/24061
27160814Ssimonvoid test01()
28160814Ssimon{
29160814Ssimon  bool test __attribute__((unused)) = true;
30160814Ssimon
31160814Ssimon  typedef std::tr1::unordered_multiset<std::string> Mset;
32160814Ssimon  typedef Mset::iterator       iterator;
33160814Ssimon  typedef Mset::const_iterator const_iterator;
34160814Ssimon
35160814Ssimon  Mset ms1;
36160814Ssimon
37160814Ssimon  iterator it1 = ms1.insert(ms1.begin(), "all the love in the world");
38160814Ssimon  VERIFY( ms1.size() == 1 );
39160814Ssimon  VERIFY( *it1 == "all the love in the world" );
40160814Ssimon
41160814Ssimon  const_iterator cit1(it1);
42160814Ssimon  const_iterator cit2 = ms1.insert(cit1, "you know what you are?");
43160814Ssimon  VERIFY( ms1.size() == 2 );
44160814Ssimon  VERIFY( cit2 != cit1 );
45160814Ssimon  VERIFY( *cit2 == "you know what you are?" );
46160814Ssimon
47160814Ssimon  iterator it2 = ms1.insert(it1, "all the love in the world");
48160814Ssimon  VERIFY( ms1.size() == 3 );
49160814Ssimon  VERIFY( it2 != it1 );
50160814Ssimon  VERIFY( *it2 == "all the love in the world" );
51160814Ssimon}
52160814Ssimon
53160814Ssimonint main()
54160814Ssimon{
55160814Ssimon  test01();
56160814Ssimon  return 0;
57160814Ssimon}
58194206Ssimon