std::seed_seq::param(3)

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

πŸ’– std::seed_seq::param(3) β€” C++ Standard Libary πŸ’–

Hiii bestie, welcome to the std::seed_seq::param(3) page, manual name C++ Standard Libary and all. We're about to get into std::seed_seq::param, and honestly it's giving niche-but-useful. πŸ’…

🌸 NAME 🌸

std::seed_seq::param β€” std::seed_seq::param. Yes, that's the name, no cap. It outputs the initial seed sequence stored in the std::seed_seq object. ✨

✨ Synopsis ✨

template< class OutputIt >          (since C++11)
void param( OutputIt dest ) const;

Okay so this outputs the initial seed sequence that's stored in the std::seed_seq object. That's the main-character job. πŸ‘‘

πŸ¦‹ Parameters πŸ¦‹

  • dest β€” an output iterator such that the expression *dest = rt is valid for a value rt of result_type. So dest has to be that exact kind of iterator, bestie. 🫢

πŸŽ€ Type requirements πŸŽ€

  • OutputIt must meet the requirements of LegacyOutputIterator. That's the rule, periodt. πŸ’€

🌈 Return value 🌈

(none) β€” nothing, nada, zero return value. The function is giving "I do the side effect and leave" energy. πŸ’œ

πŸ”₯ Exceptions πŸ”₯

It throws only if an operation on dest throws. That's it, that's the whole exception situation. If dest is chill, we're chill. 😌

πŸ“ Example πŸ“

// Run this code

#include <iostream>
#include <iterator>
#include <random>

int main()
{
    std::seed_seq s1 = {-1, 0, 1};
    s1.param(std::ostream_iterator<int>(std::cout, " "));
}

⭐ Output ⭐

-1 0 1

The output is literally -1 0 1, slay. πŸŽ€


πŸ’Œ cute sign-off: source/version/date is http://cppreference.com, 2024.06.10, and this iconic page is std::seed_seq::param(3) β€” mwah, bye bestie! πŸ’‹

πŸ“¦ where this page comes from