Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | MiloRambaldi<james.hirschorn@gmail.com> |
|---|---|
| Newsgroups | comp.std.c++ |
| Subject | Random number engine adaptor requirements [rand.req.adapt] |
| Date | 2012-03-21 11:35 -0700 |
| Organization | http://groups.google.com |
| Message-ID | <5521955.2673.1332349807497.JavaMail.geo-discussion-forums@vbue17> (permalink) |
> From N3337: ----- 26.5.1.5 Random number engine adaptor requirements [rand.req.adapt] 1 A random number engine adaptor (commonly shortened to adaptor) a of type A is a random number engine that takes values produced by some other random number engine, and applies an algorithm to those values in order to deliver a sequence of values with different randomness properties. An engine b of type B adapted in this way is termed a base engine in this context. The expression a.base() shall be valid and shall return a const reference to a’s base engine. ... ----- My question is about the interpretation of "takes values produced by some other random number engine". Must a random number engine adapter apply to *all* random number engines, or can an adapter only apply to *some* random number engines. The motivation is the following case: We have a class of random number engines, that in addition to the standard provide some other member function to obtain random numbers. There is a useful adapter that is only relevant for this class of engines. If the adapter will only compile with engines from the class, can it still satisfy the standard? Reading all of 26.5.1.5, my interpretation is that the answer is yes. There is nothing in the standard explicitly stating that an adapter must obtain values from the base engine through its operator()() member. -- [ comp.std.c++ is moderated. To submit articles, try posting with your ] [ newsreader. If that fails, use mailto:std-cpp-submit@vandevoorde.com ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Back to comp.std.c++ | Previous | Next — Next in thread | Find similar
Random number engine adaptor requirements [rand.req.adapt] MiloRambaldi<james.hirschorn@gmail.com> - 2012-03-21 11:35 -0700
Re: Random number engine adaptor requirements [rand.req.adapt] Daniel Krügler<daniel.kruegler@googlemail.com> - 2012-03-22 11:23 -0700
Re: Random number engine adaptor requirements [rand.req.adapt] MiloRambaldi<james.hirschorn@gmail.com> - 2012-03-23 17:10 -0700
Re: Random number engine adaptor requirements [rand.req.adapt] Daniel Krügler <daniel.kruegler@googlemail.com> - 2012-03-24 19:26 -0700
Re: Random number engine adaptor requirements [rand.req.adapt] MiloRambaldi<james.hirschorn@gmail.com> - 2012-04-02 15:16 -0700
Re: Random number engine adaptor requirements [rand.req.adapt] Daniel Krügler <daniel.kruegler@googlemail.com> - 2012-04-03 23:20 -0700
csiph-web