Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::discard_block_engine<Engine,P,R>::discard_block_engine

      From cppreference.com
      <cpp‎ |numeric‎ |random‎ |discard block engine

      [edit template]
       
       
       
      Pseudo-random number generation
       
       
      discard_block_engine();
      (1)(since C++11)
      explicit discard_block_engine( result_type s);
      (2)(since C++11)
      template<class SeedSeq>
      explicit discard_block_engine( SeedSeq& seq);
      (3)(since C++11)
      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.

      1) Default constructor. The underlying engine is also default-constructed.
      2) Constructs the underlying engine withs.
      3) Constructs the underlying engine with seed sequenceseq.
      This overload participates in overload resolution only ifSseq satisfies the requirements ofSeedSequence.
      4) Constructs the underlying engine with a copy ofe.
      5) Move-constructs the underlying engine withe.e holds unspecified, but valid state afterwards.

      Contents

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

      [edit]Exceptions

      3) IfSeedSeq is notstd::seed_seq, throws the exceptions thrown by theseq.generate call.

      [edit]Example

      [edit]Defect reports

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

      DRApplied toBehavior as publishedCorrect behavior
      LWG 2181C++11overload(3) would not throw even if theseq.generate call throwspropagates the exception
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/numeric/random/discard_block_engine/discard_block_engine&oldid=132153"

      [8]ページ先頭

      ©2009-2025 Movatter.jp