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 10:27 AM, Paolo Carlini
<paolo.carlini@oracle.com> wrote:
> Thus, all in all, for the time being I would go with __generate.

OK, here's a version of the patch with the patch for 54376 already assumed.

I changed to function name to __generate.  I feel much more
comfortable with using the leading underscores.

I changed _OutputIterator to _ForwardIterator.

I really think a free function isn't the right way to go.  The
functionality is intimately tied to the various classes.  Having very
much similar code outside the class is just confusing.

Also, I consider the interface clean and now very C++-y.  Iterators
are used and transparently all kinds of overloads are possible.  Only
the iterator variants need to be documented, making the extensions
easy to use.  The only minor complication is that the pointer type had
to be introduced (or something like __normal_iterator has to be
reinvented).

Anyone having strong feelings against this approach?

Attachment: QQ3
Description: Binary data


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