tmp/tmpdksbnnle/{from.md → to.md}
RENAMED
|
@@ -39,10 +39,11 @@ for (k = n₀; k \neq n; k += 1) {
|
|
| 39 |
S = 2^{w₀ + 1} \cdot S + u \bmod 2^{w₀ + 1};
|
| 40 |
}
|
| 41 |
```
|
| 42 |
|
| 43 |
``` cpp
|
|
|
|
| 44 |
template<class Engine, size_t w, class UIntType>
|
| 45 |
class independent_bits_engine {
|
| 46 |
public:
|
| 47 |
// types
|
| 48 |
using result_type = UIntType;
|
|
@@ -72,18 +73,19 @@ template<class Engine, size_t w, class UIntType>
|
|
| 72 |
const Engine& base() const noexcept { return e; }
|
| 73 |
|
| 74 |
// inserters and extractors
|
| 75 |
template<class charT, class traits>
|
| 76 |
friend basic_ostream<charT, traits>&
|
| 77 |
-
operator<<(basic_ostream<charT, traits>& os, const independent_bits_engine& x);
|
| 78 |
template<class charT, class traits>
|
| 79 |
friend basic_istream<charT, traits>&
|
| 80 |
-
operator>>(basic_istream<charT, traits>& is, independent_bits_engine& x);
|
| 81 |
|
| 82 |
private:
|
| 83 |
Engine e; // exposition only
|
| 84 |
};
|
|
|
|
| 85 |
```
|
| 86 |
|
| 87 |
The following relations shall hold: `0 < w` and
|
| 88 |
`w <= numeric_limits<result_type>::digits`.
|
| 89 |
|
|
|
|
| 39 |
S = 2^{w₀ + 1} \cdot S + u \bmod 2^{w₀ + 1};
|
| 40 |
}
|
| 41 |
```
|
| 42 |
|
| 43 |
``` cpp
|
| 44 |
+
namespace std {
|
| 45 |
template<class Engine, size_t w, class UIntType>
|
| 46 |
class independent_bits_engine {
|
| 47 |
public:
|
| 48 |
// types
|
| 49 |
using result_type = UIntType;
|
|
|
|
| 73 |
const Engine& base() const noexcept { return e; }
|
| 74 |
|
| 75 |
// inserters and extractors
|
| 76 |
template<class charT, class traits>
|
| 77 |
friend basic_ostream<charT, traits>&
|
| 78 |
+
operator<<(basic_ostream<charT, traits>& os, const independent_bits_engine& x); // hosted
|
| 79 |
template<class charT, class traits>
|
| 80 |
friend basic_istream<charT, traits>&
|
| 81 |
+
operator>>(basic_istream<charT, traits>& is, independent_bits_engine& x); // hosted
|
| 82 |
|
| 83 |
private:
|
| 84 |
Engine e; // exposition only
|
| 85 |
};
|
| 86 |
+
}
|
| 87 |
```
|
| 88 |
|
| 89 |
The following relations shall hold: `0 < w` and
|
| 90 |
`w <= numeric_limits<result_type>::digits`.
|
| 91 |
|