|
| 1 | +<?xml version='1.0' encoding='utf-8' standalone='no'?> |
| 2 | +<!DOCTYPE issue SYSTEM "lwg-issue.dtd"> |
| 3 | + |
| 4 | +<issue num="4224" status="New"> |
| 5 | +<title>Philox engines should be freestanding</title> |
| 6 | +<section> |
| 7 | +<sref ref="[rand.eng.philox]"/> |
| 8 | +</section> |
| 9 | +<submitter>Jiang An</submitter> |
| 10 | +<date>15 Mar 2025</date> |
| 11 | +<priority>99</priority> |
| 12 | + |
| 13 | +<discussion> |
| 14 | +<p> |
| 15 | +Philox engines don't seem to require floating-point operations or support from the operating system, |
| 16 | +so they are probably suitable for freestanding. However, as <paper num="P2976R1"/> was finished before |
| 17 | +the adoption of <paper num="P2075R6"/>, these engines are not made freestanding yet. |
| 18 | +</p> |
| 19 | +</discussion> |
| 20 | + |
| 21 | +<resolution> |
| 22 | +<p> |
| 23 | +This wording is relative to <paper num="N5001"/>. |
| 24 | +</p> |
| 25 | + |
| 26 | +<ol> |
| 27 | + |
| 28 | +<li><p>Modify <sref ref="[rand.synopsis]"/>, header <tt><random></tt> synopsis, as indicated:</p> |
| 29 | + |
| 30 | +<blockquote> |
| 31 | +<pre> |
| 32 | +[…] |
| 33 | +// <i><sref ref="[rand.eng.philox]"/>, class template philox_engine</i> |
| 34 | +template<class UIntType, size_t w, size_t n, size_t r, UIntType... consts> |
| 35 | + class philox_engine; <ins>// <i>partially freestanding</i></ins> |
| 36 | + |
| 37 | +[…] |
| 38 | +using philox4x32 = <i>see below</i>; <ins>// <i>freestanding</i></ins> |
| 39 | +using philox4x64 = <i>see below</i>; <ins>// <i>freestanding</i></ins> |
| 40 | +[…] |
| 41 | +</pre> |
| 42 | +</blockquote> |
| 43 | +</li> |
| 44 | + |
| 45 | +<li><p>Modify <sref ref="[rand.eng.philox]"/>, class template `philox_engine` synopsis, as indicated:</p> |
| 46 | + |
| 47 | +<blockquote> |
| 48 | +<pre> |
| 49 | +namespace std { |
| 50 | + template<class UIntType, size_t w, size_t n, size_t r, UIntType... consts> |
| 51 | + class philox_engine { |
| 52 | + […] |
| 53 | + // <i>inserters and extractors</i> |
| 54 | + template<class charT, class traits> |
| 55 | + friend basic_ostream<charT, traits>& |
| 56 | + operator<<(basic_ostream<charT, traits>& os, const philox_engine& x); <ins>// <i>hosted</i></ins> |
| 57 | + template<class charT, class traits> |
| 58 | + friend basic_istream<charT, traits>& |
| 59 | + operator>>(basic_istream<charT, traits>& is, philox_engine& x); <ins>// <i>hosted</i></ins> |
| 60 | + }; |
| 61 | +} |
| 62 | +</pre> |
| 63 | +</blockquote> |
| 64 | +</li> |
| 65 | +</ol> |
| 66 | +</resolution> |
| 67 | + |
| 68 | +</issue> |
0 commit comments