This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: random numbers in bulk


On Sun, Aug 26, 2012 at 7:20 AM, Ulrich Drepper <drepper@gmail.com> wrote:
> What I could imagine working is that the iterator fill/generate_n
> functions are defined and in addition the special versions which use
> pointers of the result_type of the distribution.

How about the following?  This version adds one more version of the
fill() function which takes result_type pointers.  All these functions
have a default definition which simply falls back to the iterator
version.  Specializations can overload the new variant of the function
and it all works without modifying anything in the class definition.

As far as possible specification is concerned, only the iterator
versions would have to be specified.  The new interface is a
transparently added implementation detail.

If people agree this is acceptable and the consensus is that
generate_n() is the better name I can submit a patch so that the
remaining <random> work can be submitted.  Still ways to go...

Attachment: QQ2
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]