Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::seed_seq::size

      From cppreference.com
      <cpp‎ |numeric‎ |random‎ |seed seq
       
       
       
      Pseudo-random number generation
       
       
      std::size_t size()constnoexcept;
      (since C++11)

      Returns the size of the underlying seed sequence.

      Contents

      [edit]Return value

      v .size()

      [edit]Complexity

      Constant time.

      [edit]Example

      Run this code
      #include <iostream>#include <random> int main(){std::seed_seq s1={-1,0,1};std::cout<< s1.size()<<'\n';}

      Output:

      3

      [edit]Defect report

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

      DRApplied toBehavior as publishedCorrect behavior
      LWG 2440C++11seed_seq::size was not noexceptmade noexcept
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/numeric/random/seed_seq/size&oldid=177244"

      [8]ページ先頭

      ©2009-2025 Movatter.jp