random.h (discrete_distribution<>::param_type): Disable move operations.

2010-10-12  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/random.h (discrete_distribution<>::param_type):
	Disable move operations.
	(piecewise_constant_distribution<>::param_type): Likewise.
	(piecewise_linear_distribution<>::param_type): Likewise.

	* include/bits/random.h (discrete_distribution<>::param_type::
	param_type()): Simplify, don't use _M_initialize.
	(piecewise_constant_distribution<>::param_type::param_type()):
	Likewise.
	(piecewise_linear_distribution<>::param_type::param_type()):
	Likewise.

From-SVN: r165391
This commit is contained in:
Paolo Carlini 2010-10-12 18:38:42 +00:00 committed by Paolo Carlini
parent 0c86e0dd92
commit ce9555cb82
2 changed files with 32 additions and 6 deletions

View File

@ -1,3 +1,17 @@
2010-10-12 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/random.h (discrete_distribution<>::param_type):
Disable move operations.
(piecewise_constant_distribution<>::param_type): Likewise.
(piecewise_linear_distribution<>::param_type): Likewise.
* include/bits/random.h (discrete_distribution<>::param_type::
param_type()): Simplify, don't use _M_initialize.
(piecewise_constant_distribution<>::param_type::param_type()):
Likewise.
(piecewise_linear_distribution<>::param_type::param_type()):
Likewise.
2010-10-12 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/random.tcc (piecewise_linear_distribution<>::

View File

@ -4697,8 +4697,8 @@ namespace std
friend class discrete_distribution<_IntType>;
param_type()
: _M_prob(), _M_cp()
{ _M_initialize(); }
: _M_prob(1, 1.0), _M_cp()
{ }
template<typename _InputIterator>
param_type(_InputIterator __wbegin,
@ -4714,6 +4714,10 @@ namespace std
param_type(size_t __nw, double __xmin, double __xmax,
_Func __fw);
// See: http://cpp-next.com/archive/2010/10/implicit-move-must-go/
param_type(const param_type&) = default;
param_type& operator=(const param_type&) = default;
std::vector<double>
probabilities() const
{ return _M_prob; }
@ -4889,8 +4893,8 @@ namespace std
friend class piecewise_constant_distribution<_RealType>;
param_type()
: _M_int(), _M_den(), _M_cp()
{ _M_initialize(); }
: _M_int(2), _M_den(1, 1.0), _M_cp()
{ _M_int[1] = _RealType(1); }
template<typename _InputIteratorB, typename _InputIteratorW>
param_type(_InputIteratorB __bfirst,
@ -4904,6 +4908,10 @@ namespace std
param_type(size_t __nw, _RealType __xmin, _RealType __xmax,
_Func __fw);
// See: http://cpp-next.com/archive/2010/10/implicit-move-must-go/
param_type(const param_type&) = default;
param_type& operator=(const param_type&) = default;
std::vector<_RealType>
intervals() const
{ return _M_int; }
@ -5097,8 +5105,8 @@ namespace std
friend class piecewise_linear_distribution<_RealType>;
param_type()
: _M_int(), _M_den(), _M_cp(), _M_m()
{ _M_initialize(); }
: _M_int(2), _M_den(2, 1.0), _M_cp(), _M_m()
{ _M_int[1] = _RealType(1); }
template<typename _InputIteratorB, typename _InputIteratorW>
param_type(_InputIteratorB __bfirst,
@ -5112,6 +5120,10 @@ namespace std
param_type(size_t __nw, _RealType __xmin, _RealType __xmax,
_Func __fw);
// See: http://cpp-next.com/archive/2010/10/implicit-move-must-go/
param_type(const param_type&) = default;
param_type& operator=(const param_type&) = default;
std::vector<_RealType>
intervals() const
{ return _M_int; }