This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.

4224. Philox engines should be freestanding

Section: 29.5.4.5 [rand.eng.philox] Status: New Submitter: Jiang An Opened: 2025-03-15 Last modified: 2025-03-15

Priority: Not Prioritized

View other active issues in [rand.eng.philox].

View all other issues in [rand.eng.philox].

View all issues with New status.

Discussion:

Philox engines don't seem to require floating-point operations or support from the operating system, so they are probably suitable for freestanding. However, as P2976R1 was finished before the adoption of P2075R6, these engines are not made freestanding yet.

Proposed resolution:

This wording is relative to N5001.

  1. Modify 29.5.2 [rand.synopsis], header <random> synopsis, as indicated:

    […]
    // 29.5.4.5 [rand.eng.philox], class template philox_engine
    template<class UIntType, size_t w, size_t n, size_t r, UIntType... consts>
      class philox_engine;               // partially freestanding
    
    […]
    using philox4x32 = see below; // freestanding
    using philox4x64 = see below; // freestanding
    […]
    
  2. Modify 29.5.4.5 [rand.eng.philox], class template philox_engine synopsis, as indicated:

    namespace std {
      template<class UIntType, size_t w, size_t n, size_t r, UIntType... consts>
      class philox_engine {
        […]  
        // inserters and extractors
        template<class charT, class traits>
          friend basic_ostream<charT, traits>&
            operator<<(basic_ostream<charT, traits>& os, const philox_engine& x); // hosted
        template<class charT, class traits>
          friend basic_istream<charT, traits>&
            operator>>(basic_istream<charT, traits>& is, philox_engine& x);       // hosted
      };
    }