std::shuffl...order_engine(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸŽ€ std::shuffle_order_engine::shuffle_order_engine πŸŽ€

okay bestie, buckle up πŸ’– this one's from the C++ Standard Libary manpage set (yes that's how it's spelled on the tin, don't come for me) β€” section 3, the constructor page. it's giving "let me introduce you to my little random engine adaptor" energy and honestly? iconic.


✨ NAME ✨

std::shuffle_order_engine::shuffle_order_engine β€” literally the constructor for the adaptor. that's the whole name. it said "my name is my name" πŸ’…


🌸 SYNOPSIS 🌸

      shuffle_order_engine();                           (1) (since C++11)
      explicit shuffle_order_engine( result_type s );   (2) (since C++11)
      template< class Sseq >                            (3) (since C++11)
      explicit shuffle_order_engine( Sseq& seq );
      explicit shuffle_order_engine( const Engine& e ); (4) (since C++11)
      explicit shuffle_order_engine( Engine&& e );      (5) (since C++11)

five whole flavours, all since C++11, no cap πŸ”₯


πŸ¦‹ DESCRIPTION πŸ¦‹

Constructs a new pseudo-random engine adaptor. that's the vibe. it's a fresh baby adaptor and you get to pick how it wakes up πŸ‘‘

here's the menu, pick your main character:

  1. Default constructor. the underlying engine is also default-constructed. no thoughts, head empty, fully valid 🌸
  2. Constructs the underlying engine with s. simple, clean, slay.
  3. Constructs the underlying engine with seed sequence seq. but β€” and this is the important part β€” this constructor only participates in overload resolution if Sseq qualifies as a SeedSequence. in particular, it does not participate in overload resolution if Sseq is implicitly convertible to result_type. so if you were hoping it'd just vibe with anything, no ma'am πŸ™ˆ
  4. Constructs the underlying engine with a copy of e. twin behaviour, no original harmed πŸ’–
  5. Move-constructs the underlying engine with e. after this, e holds unspecified, but valid state afterwards. it's not destroyed, it's just... different now. going through a phase. still valid tho ✨

πŸ’œ PARAMETERS πŸ’œ

  • s β€” integer value to construct the underlying engine with
  • seq β€” seed sequence to construct the underlying engine with
  • e β€” pseudo-random number engine to initialize with

πŸ“ EXAMPLE πŸ“

okay so real talk β€” this section is on the page but there is literally nothing in it. empty. void. nullptr of example sections 😭 so i'm not gonna invent code and lie to you, bestie. the section exists, the example does not. iykyk.


ngl the overload-resolution footnote on option 3 is the one thing here that will actually bite you in a compile error, so keep that in your notes app 🫢

source: http://cppreference.com Β· version / date: 2024.06.10 Β· page: std::shuffl...order_engine(3) β€” that's the whole footer, mwah, bye bestie, go seed something responsibly πŸ’…πŸ§šβ€β™€οΈβ­

πŸ“¦ where this page comes from