From Jason Turner

[rand.adapt.shuf]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmprys3x709/{from.md → to.md} +14 -1
tmp/tmprys3x709/{from.md → to.md} RENAMED
@@ -18,10 +18,11 @@ transition is performed as follows:
18
 
19
  The generation algorithm yields the last value of `Y` produced while
20
  advancing `e`’s state as described above.
21
 
22
  ``` cpp
 
23
  template<class Engine, size_t k>
24
  class shuffle_order_engine {
25
  public:
26
  // types
27
  using result_type = typename Engine::result_type;
@@ -39,22 +40,34 @@ template<class Engine, size_t k>
39
  template<class Sseq> explicit shuffle_order_engine(Sseq& q);
40
  void seed();
41
  void seed(result_type s);
42
  template<class Sseq> void seed(Sseq& q);
43
 
 
 
 
44
  // generating functions
45
  result_type operator()();
46
  void discard(unsigned long long z);
47
 
48
  // property functions
49
- const Engine& base() const noexcept { return e; };
 
 
 
 
 
 
 
 
50
 
51
  private:
52
  Engine e; // exposition only
53
  result_type V[k]; // exposition only
54
  result_type Y; // exposition only
55
  };
 
56
  ```
57
 
58
  The following relation shall hold: `0 < k`.
59
 
60
  The textual representation consists of the textual representation of
 
18
 
19
  The generation algorithm yields the last value of `Y` produced while
20
  advancing `e`’s state as described above.
21
 
22
  ``` cpp
23
+ namespace std {
24
  template<class Engine, size_t k>
25
  class shuffle_order_engine {
26
  public:
27
  // types
28
  using result_type = typename Engine::result_type;
 
40
  template<class Sseq> explicit shuffle_order_engine(Sseq& q);
41
  void seed();
42
  void seed(result_type s);
43
  template<class Sseq> void seed(Sseq& q);
44
 
45
+ // equality operators
46
+ friend bool operator==(const shuffle_order_engine& x, const shuffle_order_engine& y);
47
+
48
  // generating functions
49
  result_type operator()();
50
  void discard(unsigned long long z);
51
 
52
  // property functions
53
+ const Engine& base() const noexcept { return e; }
54
+
55
+ // inserters and extractors
56
+ template<class charT, class traits>
57
+ friend basic_ostream<charT, traits>&
58
+ operator<<(basic_ostream<charT, traits>& os, const shuffle_order_engine& x);
59
+ template<class charT, class traits>
60
+ friend basic_istream<charT, traits>&
61
+ operator>>(basic_istream<charT, traits>& is, shuffle_order_engine& x);
62
 
63
  private:
64
  Engine e; // exposition only
65
  result_type V[k]; // exposition only
66
  result_type Y; // exposition only
67
  };
68
+ }
69
  ```
70
 
71
  The following relation shall hold: `0 < k`.
72
 
73
  The textual representation consists of the textual representation of