Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::seed_seq::param

      From cppreference.com
      <cpp‎ |numeric‎ |random‎ |seed seq
       
       
       
      Pseudo-random number generation
       
       
      template<class OutputIt>
      void param( OutputIt dest)const;
      (since C++11)

      Copies the stored seeds to the range beginning withdest. Equivalent tostd::copy(v .begin(), v .end(), dest);.

      If values of typeresult_type are notwritable todest, the program is ill-formed.

      IfOutputIt does not satisfy the requirements ofLegacyOutputIterator, the behavior is undefined.

      Contents

      [edit]Parameters

      dest - the beginning iterator of the output range

      [edit]Exceptions

      Only throws the exceptions thrown by the operations ondest.

      [edit]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

      [edit]Defect reports

      The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

      DRApplied toBehavior as publishedCorrect behavior
      LWG 2180C++11seed_seq::param is non-throwingit may throw exceptions
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/numeric/random/seed_seq/param&oldid=177245"

      [8]ページ先頭

      ©2009-2025 Movatter.jp