From Jason Turner

[depr.alg.random.shuffle]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpqxv1op1t/{from.md → to.md} +0 -113
tmp/tmpqxv1op1t/{from.md → to.md} RENAMED
@@ -1,113 +0,0 @@
1
- ## Random shuffle <a id="depr.alg.random.shuffle">[[depr.alg.random.shuffle]]</a>
2
-
3
- The function templates `random_shuffle` are deprecated.
4
-
5
- ``` cpp
6
- template<class RandomAccessIterator>
7
- void random_shuffle(RandomAccessIterator first,
8
- RandomAccessIterator last);
9
-
10
- template<class RandomAccessIterator, class RandomNumberGenerator>
11
- void random_shuffle(RandomAccessIterator first,
12
- RandomAccessIterator last,
13
- RandomNumberGenerator&& rng);
14
- ```
15
-
16
- *Effects:* Permutes the elements in the range \[`first`, `last`) such
17
- that each possible permutation of those elements has equal probability
18
- of appearance.
19
-
20
- *Requires:* `RandomAccessIterator` shall satisfy the requirements of
21
- `ValueSwappable` ([[swappable.requirements]]). The random number
22
- generating function object `rng` shall have a return type that is
23
- convertible to `iterator_traits<RandomAccessIterator>::difference_type`,
24
- and the call `rng(n)` shall return a randomly chosen value in the
25
- interval \[`0`, `n`), for `n > 0` of type
26
- `iterator_traits<RandomAccessIterator>::difference_type`.
27
-
28
- *Complexity:* Exactly `(last - first) - 1` swaps.
29
-
30
- *Remarks:* To the extent that the implementation of these functions
31
- makes use of random numbers, the implementation shall use the following
32
- sources of randomness:
33
-
34
- The underlying source of random numbers for the first form of the
35
- function is *implementation-defined*. An implementation may use the
36
- `rand` function from the standard C library.
37
-
38
- In the second form of the function, the function object `rng` shall
39
- serve as the implementation’s source of randomness.
40
-
41
- <!-- Link reference definitions -->
42
- [auto.ptr]: #auto.ptr
43
- [auto.ptr.cons]: #auto.ptr.cons
44
- [auto.ptr.conv]: #auto.ptr.conv
45
- [auto.ptr.members]: #auto.ptr.members
46
- [basic.scope.namespace]: basic.md#basic.scope.namespace
47
- [class.copy]: special.md#class.copy
48
- [class.dtor]: special.md#class.dtor
49
- [dcl.attr.deprecated]: dcl.md#dcl.attr.deprecated
50
- [dcl.fct.def]: dcl.md#dcl.fct.def
51
- [dcl.stc]: dcl.md#dcl.stc
52
- [depr]: #depr
53
- [depr.adaptors]: #depr.adaptors
54
- [depr.alg.random.shuffle]: #depr.alg.random.shuffle
55
- [depr.auto.ptr]: #depr.auto.ptr
56
- [depr.base]: #depr.base
57
- [depr.c.headers]: #depr.c.headers
58
- [depr.except.spec]: #depr.except.spec
59
- [depr.function.objects]: #depr.function.objects
60
- [depr.function.pointer.adaptors]: #depr.function.pointer.adaptors
61
- [depr.impldec]: #depr.impldec
62
- [depr.incr.bool]: #depr.incr.bool
63
- [depr.ios.members]: #depr.ios.members
64
- [depr.istrstream]: #depr.istrstream
65
- [depr.istrstream.cons]: #depr.istrstream.cons
66
- [depr.istrstream.members]: #depr.istrstream.members
67
- [depr.lib.bind.1st]: #depr.lib.bind.1st
68
- [depr.lib.bind.2nd]: #depr.lib.bind.2nd
69
- [depr.lib.binder.1st]: #depr.lib.binder.1st
70
- [depr.lib.binder.2nd]: #depr.lib.binder.2nd
71
- [depr.lib.binders]: #depr.lib.binders
72
- [depr.member.pointer.adaptors]: #depr.member.pointer.adaptors
73
- [depr.ostrstream]: #depr.ostrstream
74
- [depr.ostrstream.cons]: #depr.ostrstream.cons
75
- [depr.ostrstream.members]: #depr.ostrstream.members
76
- [depr.register]: #depr.register
77
- [depr.str.strstreams]: #depr.str.strstreams
78
- [depr.strstream]: #depr.strstream
79
- [depr.strstream.cons]: #depr.strstream.cons
80
- [depr.strstream.dest]: #depr.strstream.dest
81
- [depr.strstream.oper]: #depr.strstream.oper
82
- [depr.strstreambuf]: #depr.strstreambuf
83
- [depr.strstreambuf.cons]: #depr.strstreambuf.cons
84
- [depr.strstreambuf.members]: #depr.strstreambuf.members
85
- [depr.strstreambuf.virtuals]: #depr.strstreambuf.virtuals
86
- [except.unexpected]: except.md#except.unexpected
87
- [exception.unexpected]: #exception.unexpected
88
- [expr.post.incr]: expr.md#expr.post.incr
89
- [expr.pre.incr]: expr.md#expr.pre.incr
90
- [func.bind]: utilities.md#func.bind
91
- [func.bind.bind]: utilities.md#func.bind.bind
92
- [get.unexpected]: #get.unexpected
93
- [input.output]: input.md#input.output
94
- [iostreams.limits.pos]: input.md#iostreams.limits.pos
95
- [namespace.udecl]: dcl.md#namespace.udecl
96
- [set.unexpected]: #set.unexpected
97
- [stmt.dcl]: stmt.md#stmt.dcl
98
- [streambuf.pub.get]: input.md#streambuf.pub.get
99
- [swappable.requirements]: library.md#swappable.requirements
100
- [tab:future.c.headers]: #tab:future.c.headers
101
- [tab:future.newoff.values]: #tab:future.newoff.values
102
- [tab:future.seekoff.positioning]: #tab:future.seekoff.positioning
103
- [tab:future.strstreambuf.effects]: #tab:future.strstreambuf.effects
104
- [tab:future.strstreambuf1.effects]: #tab:future.strstreambuf1.effects
105
- [unexpected]: #unexpected
106
- [unexpected.handler]: #unexpected.handler
107
- [unique.ptr]: utilities.md#unique.ptr
108
-
109
- [^1]: An implementation should consider `alsize` in making this
110
- decision.
111
-
112
- [^2]: The function signature `strlen(const char*)` is declared in
113
- `<cstring>` ([[c.strings]]).