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, 26 Aug 2012, Ulrich Drepper wrote:

On Sun, Aug 26, 2012 at 1:36 PM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
But I've just seen Paolo's suggestion for a __generate_impl that both
use, and I prefer that idea.

How about the following. I introduced a __generate_impl() member function. This required in a few cases an additional wrapper function but nothing too bad. The template parameter order is changed, too.

Hello,


I haven't looked at it in details, but I have 2 comments / questions:

1) it is really painful that C++ won't let us use a default argument of this->param(). I hit (variants of) this limitation quite often.

2) would it make sense to overload the free function std::generate to make it call these __generate member functions when it recognizes the last argument as the result of a bind of suitable types? That's quite ugly, but it could make it possible to benefit from the cool optimizations while still writing portable code. I haven't tried it so it could be impossible for some reason, or it could be ugly enough that it isn't worth it.

--
Marc Glisse


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