1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
14 // template <class InputIterator>
15 // set(InputIterator first, InputIterator last,
16 // const value_compare& comp, const allocator_type& a);
18 // template <class InputIterator>
19 // set(InputIterator first, InputIterator last,
20 // const allocator_type& a);
25 #include "test_macros.h"
26 #include "test_iterators.h"
27 #include "../../../test_compare.h"
28 #include "test_allocator.h"
46 typedef test_compare<std::less<V> > C;
47 typedef test_allocator<V> A;
48 std::set<V, C, A> m(input_iterator<const V*>(ar),
49 input_iterator<const V*>(ar+sizeof(ar)/sizeof(ar[0])),
51 assert(m.value_comp() == C(5));
52 assert(m.get_allocator() == A(7));
53 assert(m.size() == 3);
54 assert(distance(m.begin(), m.end()) == 3);
55 assert(*m.begin() == 1);
56 assert(*next(m.begin()) == 2);
57 assert(*next(m.begin(), 2) == 3);
74 typedef test_allocator<V> A;
75 typedef test_compare<std::less<int> > C;
77 std::set<V, C, A> m(ar, ar+sizeof(ar)/sizeof(ar[0]), a);
79 assert(m.size() == 3);
80 assert(distance(m.begin(), m.end()) == 3);
81 assert(*m.begin() == 1);
82 assert(*next(m.begin()) == 2);
83 assert(*next(m.begin(), 2) == 3);
84 assert(m.get_allocator() == a);