[Bug libstdc++/55169] std::discrete_distribution::operator(generator) makes unnecessary copy of parameter vector

2012-11-02 Thread paolo at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55169



--- Comment #4 from paolo at gcc dot gnu.org paolo at gcc dot gnu.org 
2012-11-02 10:45:40 UTC ---

Author: paolo

Date: Fri Nov  2 10:45:25 2012

New Revision: 193092



URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=193092

Log:

2012-11-02  Paolo Carlini  paolo.carl...@oracle.com



PR libstdc++/55169

* include/bits/random.h: Remove all uses of param().

(chi_squared_distribution::__generate_impl(_ForwardIterator,

_ForwardIterator, _UniformRandomNumberGenerator): Declare

* include/bits/random.tcc: ... define.

* include/ext/random: Remove all uses of param().



Modified:

trunk/libstdc++-v3/ChangeLog

trunk/libstdc++-v3/include/bits/random.h

trunk/libstdc++-v3/include/bits/random.tcc

trunk/libstdc++-v3/include/ext/random


[Bug libstdc++/55169] std::discrete_distribution::operator(generator) makes unnecessary copy of parameter vector

2012-11-02 Thread paolo at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55169



--- Comment #5 from paolo at gcc dot gnu.org paolo at gcc dot gnu.org 
2012-11-02 11:18:22 UTC ---

Author: paolo

Date: Fri Nov  2 11:18:13 2012

New Revision: 193093



URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=193093

Log:

2012-11-02  Paolo Carlini  paolo.carl...@oracle.com



PR libstdc++/55169

* include/bits/random.h: Remove all uses of param().



Modified:

branches/gcc-4_7-branch/libstdc++-v3/ChangeLog

branches/gcc-4_7-branch/libstdc++-v3/include/bits/random.h


[Bug libstdc++/55169] std::discrete_distribution::operator(generator) makes unnecessary copy of parameter vector

2012-11-02 Thread paolo.carlini at oracle dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55169



Paolo Carlini paolo.carlini at oracle dot com changed:



   What|Removed |Added



 Status|ASSIGNED|RESOLVED

 Resolution||FIXED

   Target Milestone|--- |4.7.3



--- Comment #6 from Paolo Carlini paolo.carlini at oracle dot com 2012-11-02 
11:19:37 UTC ---

Fixed mainline and 4.7.3.


[Bug libstdc++/55169] std::discrete_distribution::operator(generator) makes unnecessary copy of parameter vector

2012-11-01 Thread paolo.carlini at oracle dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55169



Paolo Carlini paolo.carlini at oracle dot com changed:



   What|Removed |Added



 Status|UNCONFIRMED |ASSIGNED

   Last reconfirmed||2012-11-01

 AssignedTo|unassigned at gcc dot   |paolo.carlini at oracle dot

   |gnu.org |com

 Ever Confirmed|0   |1



--- Comment #1 from Paolo Carlini paolo.carlini at oracle dot com 2012-11-01 
19:38:51 UTC ---

Yes, seems easy to fix.


[Bug libstdc++/55169] std::discrete_distribution::operator(generator) makes unnecessary copy of parameter vector

2012-11-01 Thread chri.snell at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55169



--- Comment #2 from Chris Nell chri.snell at gmail dot com 2012-11-01 
19:48:43 UTC ---

After a bit more poking, it appears that param() returns a copy (not a const

reference) for all distributions, not just discrete_distribution.  As such, it

might we worth looking into whether other implementations of

operator(generator) suffer from the same bug.


[Bug libstdc++/55169] std::discrete_distribution::operator(generator) makes unnecessary copy of parameter vector

2012-11-01 Thread paolo.carlini at oracle dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55169



--- Comment #3 from Paolo Carlini paolo.carlini at oracle dot com 2012-11-01 
19:59:48 UTC ---

Of course, of course. But in 4_7-branch we are going to change only the three

distributions using std::vectors