From Jason Turner

[forwardlist.overview]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpu1lh6m3l/{from.md → to.md} +13 -12
tmp/tmpu1lh6m3l/{from.md → to.md} RENAMED
@@ -8,23 +8,23 @@ access to list elements is not supported. It is intended that
8
  hand-written C-style singly linked list. Features that would conflict
9
  with that goal have been omitted.
10
 
11
  A `forward_list` satisfies all of the requirements of a container
12
  (Table  [[tab:containers.container.requirements]]), except that the
13
- `size()` member function is not provided. A `forward_list` also
14
- satisfies all of the requirements for an allocator-aware container
15
- (Table  [[tab:containers.allocatoraware]]). In addition, a
16
- `forward_list` provides the `assign` member functions (Table 
17
- [[tab:containers.sequence.requirements]]) and several of the optional
18
- container requirements (Table  [[tab:containers.sequence.optional]]).
19
- Descriptions are provided here only for operations on `forward_list`
20
- that are not described in that table or for operations where there is
21
- additional semantic information.
22
 
23
  Modifying any list requires access to the element preceding the first
24
  element of interest, but in a `forward_list` there is no constant-time
25
- way to acess a preceding element. For this reason, ranges that are
26
  modified, such as those supplied to `erase` and `splice`, must be open
27
  at the beginning.
28
 
29
  ``` cpp
30
  namespace std {
@@ -42,12 +42,13 @@ namespace std {
42
  typedef Allocator allocator_type;
43
  typedef typename allocator_traits<Allocator>::pointer pointer;
44
  typedef typename allocator_traits<Allocator>::const_pointer const_pointer;
45
 
46
  // [forwardlist.cons], construct/copy/destroy:
47
- explicit forward_list(const Allocator& = Allocator());
48
- explicit forward_list(size_type n);
 
49
  forward_list(size_type n, const T& value,
50
  const Allocator& = Allocator());
51
  template <class InputIterator>
52
  forward_list(InputIterator first, InputIterator last,
53
  const Allocator& = Allocator());
 
8
  hand-written C-style singly linked list. Features that would conflict
9
  with that goal have been omitted.
10
 
11
  A `forward_list` satisfies all of the requirements of a container
12
  (Table  [[tab:containers.container.requirements]]), except that the
13
+ `size()` member function is not provided and `operator==` has linear
14
+ complexity. A `forward_list` also satisfies all of the requirements for
15
+ an allocator-aware container (Table  [[tab:containers.allocatoraware]]).
16
+ In addition, a `forward_list` provides the `assign` member functions
17
+ (Table  [[tab:containers.sequence.requirements]]) and several of the
18
+ optional container requirements (Table 
19
+ [[tab:containers.sequence.optional]]). Descriptions are provided here
20
+ only for operations on `forward_list` that are not described in that
21
+ table or for operations where there is additional semantic information.
22
 
23
  Modifying any list requires access to the element preceding the first
24
  element of interest, but in a `forward_list` there is no constant-time
25
+ way to access a preceding element. For this reason, ranges that are
26
  modified, such as those supplied to `erase` and `splice`, must be open
27
  at the beginning.
28
 
29
  ``` cpp
30
  namespace std {
 
42
  typedef Allocator allocator_type;
43
  typedef typename allocator_traits<Allocator>::pointer pointer;
44
  typedef typename allocator_traits<Allocator>::const_pointer const_pointer;
45
 
46
  // [forwardlist.cons], construct/copy/destroy:
47
+ forward_list() : forward_list(Allocator()) { }
48
+ explicit forward_list(const Allocator&);
49
+ explicit forward_list(size_type n, const Allocator& = Allocator());
50
  forward_list(size_type n, const T& value,
51
  const Allocator& = Allocator());
52
  template <class InputIterator>
53
  forward_list(InputIterator first, InputIterator last,
54
  const Allocator& = Allocator());