blob: 486b63c40a9125c9a41654d59615df4d5508d472 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
//===----------------------------------------------------------------------===//
//
// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// <forward_list>
// forward_list(size_type n, const value_type& v, const allocator_type& a);
#include <forward_list>
#include <cassert>
#include "../../../test_allocator.h"
int main()
{
{
typedef test_allocator<int> A;
typedef A::value_type T;
typedef std::forward_list<T, A> C;
T v(6);
unsigned N = 10;
C c(N, v, A(12));
unsigned n = 0;
for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n)
assert(*i == v);
assert(n == N);
assert(c.get_allocator() == A(12));
}
}
|