std::discar...block_engine(3)

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

πŸ¦‹ std::discard_block_engine::discard_block_engine πŸ¦‹

okay bestie, welcome to the C++ Standard Libary manual β€” section 3, no cap. The page header is literally std::discar...block_engine(3) (yes, with the lil truncated vibe, iykyk), and we're talking about the constructor of std::discard_block_engine::discard_block_engine. It's giving β€œengine adaptor origin story” and I'm obsessed. πŸ’–


🌸 NAME 🌸

std::discard_block_engine::discard_block_engine β€” std::discard_block_engine::discard_block_engine

✨ Synopsis ✨

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

Constructs new pseudo-random engine adaptor. periodt. 🫢

  1. Default constructor. The underlying engine is also default-constructed. iconic default behavior, ngl. ✨
  2. Constructs the underlying engine with s. slay. πŸ’…
  3. Constructs the underlying engine with seed sequence seq. This constructor only participates in overload resolution if Sseq qualifies as a SeedSequence. In particular, this constructor does not participate in overload resolution if Sseq is implicitly convertible to result_type. read that twice, bestie β€” it's the main character caveat. 🚨
  4. Constructs the underlying engine with a copy of e. copy-paste but make it engine. πŸŽ€
  5. Move-constructs the underlying engine with e. e holds unspecified, but valid state afterwards. so it's still alive, just lowkey not the same vibe anymore. 😭

πŸŽ€ Parameters πŸŽ€

  • s β€” integer value to construct the underlying engine with. a whole number, doing engine stuff. πŸ”’
  • seq β€” seed sequence to construct the underlying engine with. seed-sequence energy fr fr. 🌱
  • e β€” pseudo-random number engine to initialize with. the engine being copied or moved into the situation. πŸ”₯

πŸ’œ Example πŸ’œ

this page doesn't actually show an example block, bestie β€” it just goes straight to the footer vibe. no cap, that's the whole content. πŸ’€


okay that's the page, bestie β€” source/version is http://cppreference.com, date is 2024.06.10, and the std::discar...block_engine(3) footer energy is officially wrapped. mwah, go construct something cute. πŸ’‹πŸ¦‹

πŸ“¦ where this page comes from