Commit 05eeebfe by Paolo Carlini Committed by Paolo Carlini

random.h (linear_congruential_engine(_Sseq&), [...]): Do not enable for the type itself.

2010-02-16  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/random.h (linear_congruential_engine(_Sseq&),
	mersenne_twister_engine(_Sseq&), subtract_with_carry_engine(_Sseq&)):
	Do not enable for the type itself.
	(discard_block_engine(_Sseq&), independent_bits_engine(_Sseq&),
	shuffle_order_engine(_Sseq&)): Do not enable for the type itself too.
	(linear_congruential_engine<>::seed(_Sseq&),
	mersenne_twister_engine<>::seed(_Sseq&),
	subtract_with_carry_engine<>::seed(_Sseq&)): Use enable_if on the
	return type.
	(discard_block_engine<>::seed(_Sseq&),
	independent_bits_engine<>::seed(_Sseq&),
	shuffle_order_engine<>::seed(_Sseq&)): Do not use enable_if.
	* include/bits/random.tcc: Adjust definitions.
	* testsuite/26_numerics/random/independent_bits_engine/cons/copy.cc:
	New.
	* testsuite/26_numerics/random/subtract_with_carry_engine/cons/
	copy.cc: Likewise.
	* testsuite/26_numerics/random/discard_block_engine/cons/
	copy.cc: Likewise.
	* testsuite/26_numerics/random/mersenne_twister_engine/cons/
	copy.cc: Likewise.
	* testsuite/26_numerics/random/linear_congruential_engine/cons/
	copy.cc: Likewise.
	* testsuite/26_numerics/random/shuffle_order_engine/cons/
	copy.cc: Likewise.

	* testsuite/26_numerics/random/independent_bits_engine/cons/
	base_move.cc: Minor tweaks.
	* testsuite/26_numerics/random/independent_bits_engine/cons/seed1.cc:
	Likewise.
	* testsuite/26_numerics/random/independent_bits_engine/cons/seed2.cc:
	Likewise.
	* testsuite/26_numerics/random/independent_bits_engine/cons/
	base_copy.cc: Likewise.
	* testsuite/26_numerics/random/independent_bits_engine/cons/
	default.cc: Likewise.
	* testsuite/26_numerics/random/independent_bits_engine/cons/
	seed_seq.cc: Likewise.
	* testsuite/26_numerics/random/subtract_with_carry_engine/cons/
	seed1.cc: Likewise.
	* testsuite/26_numerics/random/subtract_with_carry_engine/cons/
	seed2.cc: Likewise.
	* testsuite/26_numerics/random/subtract_with_carry_engine/cons/
	default.cc: Likewise.
	* testsuite/26_numerics/random/subtract_with_carry_engine/cons/
	seed_seq.cc: Likewise.
	* testsuite/26_numerics/random/discard_block_engine/cons/base_move.cc:
	Likewise.
	* testsuite/26_numerics/random/discard_block_engine/cons/seed1.cc:
	Likewise.
	* testsuite/26_numerics/random/discard_block_engine/cons/seed2.cc:
	Likewise.
	* testsuite/26_numerics/random/discard_block_engine/cons/base_copy.cc:
	Likewise.
	* testsuite/26_numerics/random/discard_block_engine/cons/default.cc:
	Likewise.
	* testsuite/26_numerics/random/discard_block_engine/cons/seed_seq.cc:
	Likewise.
	* testsuite/26_numerics/random/mersenne_twister_engine/cons/seed1.cc:
	Likewise.
	* testsuite/26_numerics/random/mersenne_twister_engine/cons/seed2.cc:
	Likewise.
	* testsuite/26_numerics/random/mersenne_twister_engine/cons/
	default.cc: Likewise.
	* testsuite/26_numerics/random/mersenne_twister_engine/cons/
	seed_seq.cc: Likewise.
	* testsuite/26_numerics/random/linear_congruential_engine/cons/
	seed1.cc: Likewise.
	* testsuite/26_numerics/random/linear_congruential_engine/cons/
	seed2.cc: Likewise.
	* testsuite/26_numerics/random/linear_congruential_engine/cons/
	seed_seq.cc: Likewise.
	* testsuite/26_numerics/random/shuffle_order_engine/cons/base_move.cc:
	Likewise.
	* testsuite/26_numerics/random/shuffle_order_engine/cons/seed1.cc:
	Likewise.
 	* testsuite/26_numerics/random/shuffle_order_engine/cons/seed2.cc:
	Likewise.
	* testsuite/26_numerics/random/shuffle_order_engine/cons/base_copy.cc:
	Likewise.
	* testsuite/26_numerics/random/shuffle_order_engine/cons/default.cc:
	Likewise.
	* testsuite/26_numerics/random/shuffle_order_engine/cons/seed_seq.cc:
	Likewise.

From-SVN: r156815
parent 5498b6d2
2010-02-16 Paolo Carlini <paolo.carlini@oracle.com> 2010-02-16 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/random.h (linear_congruential_engine(_Sseq&),
mersenne_twister_engine(_Sseq&), subtract_with_carry_engine(_Sseq&)):
Do not enable for the type itself.
(discard_block_engine(_Sseq&), independent_bits_engine(_Sseq&),
shuffle_order_engine(_Sseq&)): Do not enable for the type itself too.
(linear_congruential_engine<>::seed(_Sseq&),
mersenne_twister_engine<>::seed(_Sseq&),
subtract_with_carry_engine<>::seed(_Sseq&)): Use enable_if on the
return type.
(discard_block_engine<>::seed(_Sseq&),
independent_bits_engine<>::seed(_Sseq&),
shuffle_order_engine<>::seed(_Sseq&)): Do not use enable_if.
* include/bits/random.tcc: Adjust definitions.
* testsuite/26_numerics/random/independent_bits_engine/cons/copy.cc:
New.
* testsuite/26_numerics/random/subtract_with_carry_engine/cons/
copy.cc: Likewise.
* testsuite/26_numerics/random/discard_block_engine/cons/
copy.cc: Likewise.
* testsuite/26_numerics/random/mersenne_twister_engine/cons/
copy.cc: Likewise.
* testsuite/26_numerics/random/linear_congruential_engine/cons/
copy.cc: Likewise.
* testsuite/26_numerics/random/shuffle_order_engine/cons/
copy.cc: Likewise.
* testsuite/26_numerics/random/independent_bits_engine/cons/
base_move.cc: Minor tweaks.
* testsuite/26_numerics/random/independent_bits_engine/cons/seed1.cc:
Likewise.
* testsuite/26_numerics/random/independent_bits_engine/cons/seed2.cc:
Likewise.
* testsuite/26_numerics/random/independent_bits_engine/cons/
base_copy.cc: Likewise.
* testsuite/26_numerics/random/independent_bits_engine/cons/
default.cc: Likewise.
* testsuite/26_numerics/random/independent_bits_engine/cons/
seed_seq.cc: Likewise.
* testsuite/26_numerics/random/subtract_with_carry_engine/cons/
seed1.cc: Likewise.
* testsuite/26_numerics/random/subtract_with_carry_engine/cons/
seed2.cc: Likewise.
* testsuite/26_numerics/random/subtract_with_carry_engine/cons/
default.cc: Likewise.
* testsuite/26_numerics/random/subtract_with_carry_engine/cons/
seed_seq.cc: Likewise.
* testsuite/26_numerics/random/discard_block_engine/cons/base_move.cc:
Likewise.
* testsuite/26_numerics/random/discard_block_engine/cons/seed1.cc:
Likewise.
* testsuite/26_numerics/random/discard_block_engine/cons/seed2.cc:
Likewise.
* testsuite/26_numerics/random/discard_block_engine/cons/base_copy.cc:
Likewise.
* testsuite/26_numerics/random/discard_block_engine/cons/default.cc:
Likewise.
* testsuite/26_numerics/random/discard_block_engine/cons/seed_seq.cc:
Likewise.
* testsuite/26_numerics/random/mersenne_twister_engine/cons/seed1.cc:
Likewise.
* testsuite/26_numerics/random/mersenne_twister_engine/cons/seed2.cc:
Likewise.
* testsuite/26_numerics/random/mersenne_twister_engine/cons/
default.cc: Likewise.
* testsuite/26_numerics/random/mersenne_twister_engine/cons/
seed_seq.cc: Likewise.
* testsuite/26_numerics/random/linear_congruential_engine/cons/
seed1.cc: Likewise.
* testsuite/26_numerics/random/linear_congruential_engine/cons/
seed2.cc: Likewise.
* testsuite/26_numerics/random/linear_congruential_engine/cons/
seed_seq.cc: Likewise.
* testsuite/26_numerics/random/shuffle_order_engine/cons/base_move.cc:
Likewise.
* testsuite/26_numerics/random/shuffle_order_engine/cons/seed1.cc:
Likewise.
* testsuite/26_numerics/random/shuffle_order_engine/cons/seed2.cc:
Likewise.
* testsuite/26_numerics/random/shuffle_order_engine/cons/base_copy.cc:
Likewise.
* testsuite/26_numerics/random/shuffle_order_engine/cons/default.cc:
Likewise.
* testsuite/26_numerics/random/shuffle_order_engine/cons/seed_seq.cc:
Likewise.
2010-02-16 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/unique_ptr.h: (unique_ptr<>:: * include/bits/unique_ptr.h: (unique_ptr<>::
unique_ptr(const unique_ptr<_Up, _Up_Deleter>&), unique_ptr(const unique_ptr<_Up, _Up_Deleter>&),
operator=(const unique_ptr<_Up, _Up_Deleter>&)): Remove, redundant, operator=(const unique_ptr<_Up, _Up_Deleter>&)): Remove, redundant,
......
...@@ -188,11 +188,12 @@ namespace std ...@@ -188,11 +188,12 @@ namespace std
* *
* @param __q the seed sequence. * @param __q the seed sequence.
*/ */
template<typename _Sseq, typename template<typename _Sseq, typename = typename
= typename std::enable_if<std::is_class<_Sseq>::value>::type> std::enable_if<!std::is_same<_Sseq, linear_congruential_engine>::value>
::type>
explicit explicit
linear_congruential_engine(_Sseq& __q) linear_congruential_engine(_Sseq& __q)
{ seed<_Sseq>(__q); } { seed(__q); }
/** /**
* @brief Reseeds the %linear_congruential_engine random number generator * @brief Reseeds the %linear_congruential_engine random number generator
...@@ -210,9 +211,8 @@ namespace std ...@@ -210,9 +211,8 @@ namespace std
* *
* @param __q the seed sequence. * @param __q the seed sequence.
*/ */
template<typename _Sseq, typename template<typename _Sseq>
= typename std::enable_if<std::is_class<_Sseq>::value>::type> typename std::enable_if<std::is_class<_Sseq>::value>::type
void
seed(_Sseq& __q); seed(_Sseq& __q);
/** /**
...@@ -403,18 +403,18 @@ namespace std ...@@ -403,18 +403,18 @@ namespace std
* *
* @param __q the seed sequence. * @param __q the seed sequence.
*/ */
template<typename _Sseq, typename template<typename _Sseq, typename = typename
= typename std::enable_if<std::is_class<_Sseq>::value>::type> std::enable_if<!std::is_same<_Sseq, mersenne_twister_engine>::value>
::type>
explicit explicit
mersenne_twister_engine(_Sseq& __q) mersenne_twister_engine(_Sseq& __q)
{ seed<_Sseq>(__q); } { seed(__q); }
void void
seed(result_type __sd = default_seed); seed(result_type __sd = default_seed);
template<typename _Sseq, typename template<typename _Sseq>
= typename std::enable_if<std::is_class<_Sseq>::value>::type> typename std::enable_if<std::is_class<_Sseq>::value>::type
void
seed(_Sseq& __q); seed(_Sseq& __q);
/** /**
...@@ -576,11 +576,12 @@ namespace std ...@@ -576,11 +576,12 @@ namespace std
* *
* @param __q the seed sequence. * @param __q the seed sequence.
*/ */
template<typename _Sseq, typename template<typename _Sseq, typename = typename
= typename std::enable_if<std::is_class<_Sseq>::value>::type> std::enable_if<!std::is_same<_Sseq, subtract_with_carry_engine>::value>
::type>
explicit explicit
subtract_with_carry_engine(_Sseq& __q) subtract_with_carry_engine(_Sseq& __q)
{ seed<_Sseq>(__q); } { seed(__q); }
/** /**
* @brief Seeds the initial state @f$x_0@f$ of the random number * @brief Seeds the initial state @f$x_0@f$ of the random number
...@@ -601,9 +602,8 @@ namespace std ...@@ -601,9 +602,8 @@ namespace std
* @brief Seeds the initial state @f$x_0@f$ of the * @brief Seeds the initial state @f$x_0@f$ of the
* % subtract_with_carry_engine random number generator. * % subtract_with_carry_engine random number generator.
*/ */
template<typename _Sseq, typename template<typename _Sseq>
= typename std::enable_if<std::is_class<_Sseq>::value>::type> typename std::enable_if<std::is_class<_Sseq>::value>::type
void
seed(_Sseq& __q); seed(_Sseq& __q);
/** /**
...@@ -767,10 +767,10 @@ namespace std ...@@ -767,10 +767,10 @@ namespace std
* *
* @param __q A seed sequence. * @param __q A seed sequence.
*/ */
template<typename _Sseq, typename template<typename _Sseq, typename = typename
= typename std::enable_if<std::is_class<_Sseq>::value std::enable_if<!std::is_same<_Sseq, discard_block_engine>::value
&& !std::is_same<_Sseq, _RandomNumberEngine> && !std::is_same<_Sseq, _RandomNumberEngine>::value>
::value>::type> ::type>
explicit explicit
discard_block_engine(_Sseq& __q) discard_block_engine(_Sseq& __q)
: _M_b(__q), _M_n(0) : _M_b(__q), _M_n(0)
...@@ -803,12 +803,11 @@ namespace std ...@@ -803,12 +803,11 @@ namespace std
* sequence. * sequence.
* @param __q A seed generator function. * @param __q A seed generator function.
*/ */
template<typename _Sseq, typename template<typename _Sseq>
= typename std::enable_if<std::is_class<_Sseq>::value>::type>
void void
seed(_Sseq& __q) seed(_Sseq& __q)
{ {
_M_b.seed<_Sseq>(__q); _M_b.seed(__q);
_M_n = 0; _M_n = 0;
} }
...@@ -971,10 +970,10 @@ namespace std ...@@ -971,10 +970,10 @@ namespace std
* *
* @param __q A seed sequence. * @param __q A seed sequence.
*/ */
template<typename _Sseq, typename template<typename _Sseq, typename = typename
= typename std::enable_if<std::is_class<_Sseq>::value std::enable_if<!std::is_same<_Sseq, independent_bits_engine>::value
&& !std::is_same<_Sseq, _RandomNumberEngine> && !std::is_same<_Sseq, _RandomNumberEngine>::value>
::value>::type> ::type>
explicit explicit
independent_bits_engine(_Sseq& __q) independent_bits_engine(_Sseq& __q)
: _M_b(__q) : _M_b(__q)
...@@ -1001,11 +1000,10 @@ namespace std ...@@ -1001,11 +1000,10 @@ namespace std
* seed sequence. * seed sequence.
* @param __q A seed generator function. * @param __q A seed generator function.
*/ */
template<typename _Sseq, typename template<typename _Sseq>
= typename std::enable_if<std::is_class<_Sseq>::value>::type>
void void
seed(_Sseq& __q) seed(_Sseq& __q)
{ _M_b.seed<_Sseq>(__q); } { _M_b.seed(__q); }
/** /**
* @brief Gets a const reference to the underlying generator engine * @brief Gets a const reference to the underlying generator engine
...@@ -1178,10 +1176,10 @@ namespace std ...@@ -1178,10 +1176,10 @@ namespace std
* *
* @param __q A seed sequence. * @param __q A seed sequence.
*/ */
template<typename _Sseq, typename template<typename _Sseq, typename = typename
= typename std::enable_if<std::is_class<_Sseq>::value std::enable_if<!std::is_same<_Sseq, shuffle_order_engine>::value
&& !std::is_same<_Sseq, _RandomNumberEngine> && !std::is_same<_Sseq, _RandomNumberEngine>::value>
::value>::type> ::type>
explicit explicit
shuffle_order_engine(_Sseq& __q) shuffle_order_engine(_Sseq& __q)
: _M_b(__q) : _M_b(__q)
...@@ -1214,12 +1212,11 @@ namespace std ...@@ -1214,12 +1212,11 @@ namespace std
* sequence. * sequence.
* @param __q A seed generator function. * @param __q A seed generator function.
*/ */
template<typename _Sseq, typename template<typename _Sseq>
= typename std::enable_if<std::is_class<_Sseq>::value>::type>
void void
seed(_Sseq& __q) seed(_Sseq& __q)
{ {
_M_b.seed<_Sseq>(__q); _M_b.seed(__q);
_M_initialize(); _M_initialize();
} }
......
...@@ -126,8 +126,8 @@ namespace std ...@@ -126,8 +126,8 @@ namespace std
* Seeds the LCR engine with a value generated by @p __q. * Seeds the LCR engine with a value generated by @p __q.
*/ */
template<typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m> template<typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
template<typename _Sseq, typename> template<typename _Sseq>
void typename std::enable_if<std::is_class<_Sseq>::value>::type
linear_congruential_engine<_UIntType, __a, __c, __m>:: linear_congruential_engine<_UIntType, __a, __c, __m>::
seed(_Sseq& __q) seed(_Sseq& __q)
{ {
...@@ -344,8 +344,8 @@ namespace std ...@@ -344,8 +344,8 @@ namespace std
_UIntType __a, size_t __u, _UIntType __d, size_t __s, _UIntType __a, size_t __u, _UIntType __d, size_t __s,
_UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __b, size_t __t, _UIntType __c, size_t __l,
_UIntType __f> _UIntType __f>
template<typename _Sseq, typename> template<typename _Sseq>
void typename std::enable_if<std::is_class<_Sseq>::value>::type
mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d,
__s, __b, __t, __c, __l, __f>:: __s, __b, __t, __c, __l, __f>::
seed(_Sseq& __q) seed(_Sseq& __q)
...@@ -531,8 +531,8 @@ namespace std ...@@ -531,8 +531,8 @@ namespace std
} }
template<typename _UIntType, size_t __w, size_t __s, size_t __r> template<typename _UIntType, size_t __w, size_t __s, size_t __r>
template<typename _Sseq, typename> template<typename _Sseq>
void typename std::enable_if<std::is_class<_Sseq>::value>::type
subtract_with_carry_engine<_UIntType, __w, __s, __r>:: subtract_with_carry_engine<_UIntType, __w, __s, __r>::
seed(_Sseq& __q) seed(_Sseq& __q)
{ {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// //
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -20,17 +20,11 @@ ...@@ -20,17 +20,11 @@
// with this library; see the file COPYING3. If not see // with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// 26.4.4.1 class template discard_block_engine [rand.adapt.disc]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random> #include <random>
#include <testsuite_hooks.h>
void void
test01() test01()
{ {
bool test __attribute__((unused)) = true;
typedef std::subtract_with_carry_engine<unsigned long, 24, 10, 24> typedef std::subtract_with_carry_engine<unsigned long, 24, 10, 24>
base_engine; base_engine;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// //
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -20,17 +20,11 @@ ...@@ -20,17 +20,11 @@
// with this library; see the file COPYING3. If not see // with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// 26.4.4.1 class template discard_block_engine [rand.adapt.disc]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random> #include <random>
#include <testsuite_hooks.h>
void void
test01() test01()
{ {
bool test __attribute__((unused)) = true;
typedef std::subtract_with_carry_engine<unsigned long, 24, 10, 24> typedef std::subtract_with_carry_engine<unsigned long, 24, 10, 24>
base_engine; base_engine;
......
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-02-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <random>
void
test01()
{
std::discard_block_engine
<
std::subtract_with_carry_engine<unsigned long, 24, 10, 24>,
389, 24
> e(1);
const auto f(e);
auto g(f);
}
int main()
{
test01();
return 0;
}
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// //
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -20,17 +20,11 @@ ...@@ -20,17 +20,11 @@
// with this library; see the file COPYING3. If not see // with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// 26.4.4.1 class template discard_block_engine [rand.adapt.disc]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random> #include <random>
#include <testsuite_hooks.h>
void void
test01() test01()
{ {
bool test __attribute__((unused)) = true;
std::discard_block_engine std::discard_block_engine
< <
std::subtract_with_carry_engine<unsigned long, 24, 10, 24>, std::subtract_with_carry_engine<unsigned long, 24, 10, 24>,
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// //
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -20,17 +20,11 @@ ...@@ -20,17 +20,11 @@
// with this library; see the file COPYING3. If not see // with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// 26.4.4.1 class template discard_block_engine [rand.adapt.disc]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random> #include <random>
#include <testsuite_hooks.h>
void void
test01() test01()
{ {
bool test __attribute__((unused)) = true;
unsigned long seed = 2; unsigned long seed = 2;
std::discard_block_engine std::discard_block_engine
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// //
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -20,17 +20,11 @@ ...@@ -20,17 +20,11 @@
// with this library; see the file COPYING3. If not see // with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// 26.4.4.1 class template discard_block_engine [rand.adapt.disc]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random> #include <random>
#include <testsuite_hooks.h>
void void
test01() test01()
{ {
bool test __attribute__((unused)) = true;
double seed = 2.0; double seed = 2.0;
std::discard_block_engine std::discard_block_engine
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// //
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -20,17 +20,11 @@ ...@@ -20,17 +20,11 @@
// with this library; see the file COPYING3. If not see // with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// 26.4.4.1 class template discard_block_engine [rand.adapt.disc]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random> #include <random>
#include <testsuite_hooks.h>
void void
test01() test01()
{ {
bool test __attribute__((unused)) = true;
std::seed_seq seq; std::seed_seq seq;
std::discard_block_engine std::discard_block_engine
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// //
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -20,17 +20,11 @@ ...@@ -20,17 +20,11 @@
// with this library; see the file COPYING3. If not see // with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// 26.4.4.2 class template independent_bits_engine [rand.adapt.ibits]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random> #include <random>
#include <testsuite_hooks.h>
void void
test01() test01()
{ {
bool test __attribute__((unused)) = true;
typedef std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12> typedef std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>
base_engine; base_engine;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// //
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -20,17 +20,11 @@ ...@@ -20,17 +20,11 @@
// with this library; see the file COPYING3. If not see // with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// 26.4.4.2 class template independent_bits_engine [rand.adapt.ibits]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random> #include <random>
#include <testsuite_hooks.h>
void void
test01() test01()
{ {
bool test __attribute__((unused)) = true;
typedef std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12> typedef std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>
base_engine; base_engine;
......
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-02-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <random>
void
test01()
{
std::independent_bits_engine
<
std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>,
48,
uint_fast64_t
> e(1);
const auto f(e);
auto g(f);
}
int main()
{
test01();
return 0;
}
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// //
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -20,17 +20,11 @@ ...@@ -20,17 +20,11 @@
// with this library; see the file COPYING3. If not see // with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// 26.4.4.2 class template independent_bits_engine [rand.adapt.ibits]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random> #include <random>
#include <testsuite_hooks.h>
void void
test01() test01()
{ {
bool test __attribute__((unused)) = true;
std::independent_bits_engine std::independent_bits_engine
< <
std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>, std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>,
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// //
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -20,17 +20,11 @@ ...@@ -20,17 +20,11 @@
// with this library; see the file COPYING3. If not see // with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// 26.4.4.2 class template independent_bits_engine [rand.adapt.ibits]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random> #include <random>
#include <testsuite_hooks.h>
void void
test01() test01()
{ {
bool test __attribute__((unused)) = true;
unsigned long seed = 2; unsigned long seed = 2;
std::independent_bits_engine std::independent_bits_engine
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// //
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -20,17 +20,11 @@ ...@@ -20,17 +20,11 @@
// with this library; see the file COPYING3. If not see // with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// 26.4.4.2 class template independent_bits_engine [rand.adapt.ibits]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random> #include <random>
#include <testsuite_hooks.h>
void void
test01() test01()
{ {
bool test __attribute__((unused)) = true;
double seed = 2.0; double seed = 2.0;
std::independent_bits_engine std::independent_bits_engine
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// //
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -20,17 +20,11 @@ ...@@ -20,17 +20,11 @@
// with this library; see the file COPYING3. If not see // with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// 26.4.4.2 class template independent_bits_engine [rand.adapt.ibits]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random> #include <random>
#include <testsuite_hooks.h>
void void
test01() test01()
{ {
bool test __attribute__((unused)) = true;
std::seed_seq seq; std::seed_seq seq;
std::independent_bits_engine std::independent_bits_engine
......
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-02-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <random>
void
test01()
{
std::linear_congruential_engine<unsigned long, 48271, 0, 2147483647> e(1);
const auto f(e);
auto g(f);
}
int main()
{
test01();
return 0;
}
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// //
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -20,11 +20,7 @@ ...@@ -20,11 +20,7 @@
// with this library; see the file COPYING3. If not see // with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// 26.4.3.1 class template linear_congruential_engine [rand.eng.lcong]
// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
#include <random> #include <random>
#include <testsuite_hooks.h>
void void
test01() test01()
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// //
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -20,11 +20,7 @@ ...@@ -20,11 +20,7 @@
// with this library; see the file COPYING3. If not see // with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// 26.4.3.1 class template linear_congruential_engine [rand.eng.lcong]
// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
#include <random> #include <random>
#include <testsuite_hooks.h>
void void
test01() test01()
......
...@@ -20,9 +20,6 @@ ...@@ -20,9 +20,6 @@
// with this library; see the file COPYING3. If not see // with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// 26.4.3.1 class template linear_congruential_engine [rand.eng.lcong]
// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
#include <random> #include <random>
void void
......
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-02-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <random>
void
test01()
{
typedef unsigned long value_type;
std::mersenne_twister_engine<
value_type, 32, 624, 397, 31,
0x9908b0dful, 11,
0xfffffffful, 7,
0x9d2c5680ul, 15,
0xefc60000ul, 18, 1812433253ul> e(1);
const auto f(e);
auto g(f);
}
int main()
{
test01();
return 0;
}
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// //
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -20,9 +20,6 @@ ...@@ -20,9 +20,6 @@
// with this library; see the file COPYING3. If not see // with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// 26.4.3.2 Class template mersenne_twister_engine [rand.eng.mers]
// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
#include <random> #include <random>
#include <testsuite_hooks.h> #include <testsuite_hooks.h>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// //
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -20,11 +20,7 @@ ...@@ -20,11 +20,7 @@
// with this library; see the file COPYING3. If not see // with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// 26.4.3.2 Class template mersenne_twister_engine [rand.eng.mers]
// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
#include <random> #include <random>
#include <testsuite_hooks.h>
void void
test01() test01()
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// //
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -20,11 +20,7 @@ ...@@ -20,11 +20,7 @@
// with this library; see the file COPYING3. If not see // with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// 26.4.3.2 Class template mersenne_twister_engine [rand.eng.mers]
// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
#include <random> #include <random>
#include <testsuite_hooks.h>
void void
test01() test01()
......
...@@ -20,9 +20,6 @@ ...@@ -20,9 +20,6 @@
// with this library; see the file COPYING3. If not see // with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// 26.4.3.2 Class template mersenne_twister_engine [rand.eng.mers]
// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
#include <random> #include <random>
void void
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// //
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -20,17 +20,11 @@ ...@@ -20,17 +20,11 @@
// with this library; see the file COPYING3. If not see // with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// 26.4.4.3 class template shuffle_order_engine [rand.adapt.shuf]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random> #include <random>
#include <testsuite_hooks.h>
void void
test01() test01()
{ {
bool test __attribute__((unused)) = true;
typedef std::linear_congruential_engine typedef std::linear_congruential_engine
<uint_fast32_t, 16807UL, 0UL, 2147483647UL> base_engine; <uint_fast32_t, 16807UL, 0UL, 2147483647UL> base_engine;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// //
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -20,17 +20,11 @@ ...@@ -20,17 +20,11 @@
// with this library; see the file COPYING3. If not see // with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// 26.4.4.3 class template shuffle_order_engine [rand.adapt.shuf]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random> #include <random>
#include <testsuite_hooks.h>
void void
test01() test01()
{ {
bool test __attribute__((unused)) = true;
typedef std::linear_congruential_engine typedef std::linear_congruential_engine
<uint_fast32_t, 16807UL, 0UL, 2147483647UL> base_engine; <uint_fast32_t, 16807UL, 0UL, 2147483647UL> base_engine;
......
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-02-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <random>
void
test01()
{
std::shuffle_order_engine
<
std::linear_congruential_engine<uint_fast32_t,16807UL, 0UL, 2147483647UL>,
256
> e(1);
const auto f(e);
auto g(f);
}
int main()
{
test01();
return 0;
}
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// //
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -20,17 +20,11 @@ ...@@ -20,17 +20,11 @@
// with this library; see the file COPYING3. If not see // with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// 26.4.4.3 class template shuffle_order_engine [rand.adapt.shuf]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random> #include <random>
#include <testsuite_hooks.h>
void void
test01() test01()
{ {
bool test __attribute__((unused)) = true;
std::shuffle_order_engine std::shuffle_order_engine
< <
std::linear_congruential_engine<uint_fast32_t,16807UL, 0UL, 2147483647UL>, std::linear_congruential_engine<uint_fast32_t,16807UL, 0UL, 2147483647UL>,
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// //
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -20,17 +20,11 @@ ...@@ -20,17 +20,11 @@
// with this library; see the file COPYING3. If not see // with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// 26.4.4.3 class template shuffle_order_engine [rand.adapt.shuf]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random> #include <random>
#include <testsuite_hooks.h>
void void
test01() test01()
{ {
bool test __attribute__((unused)) = true;
unsigned long seed = 2; unsigned long seed = 2;
std::shuffle_order_engine std::shuffle_order_engine
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// //
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -20,17 +20,11 @@ ...@@ -20,17 +20,11 @@
// with this library; see the file COPYING3. If not see // with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// 26.4.4.3 class template shuffle_order_engine [rand.adapt.shuf]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random> #include <random>
#include <testsuite_hooks.h>
void void
test01() test01()
{ {
bool test __attribute__((unused)) = true;
double seed = 2.0; double seed = 2.0;
std::shuffle_order_engine std::shuffle_order_engine
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// //
// 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-12-07 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -20,17 +20,11 @@ ...@@ -20,17 +20,11 @@
// with this library; see the file COPYING3. If not see // with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// 26.4.4.3 class template shuffle_order_engine [rand.adapt.shuf]
// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
#include <random> #include <random>
#include <testsuite_hooks.h>
void void
test01() test01()
{ {
bool test __attribute__((unused)) = true;
std::seed_seq seq; std::seed_seq seq;
std::shuffle_order_engine std::shuffle_order_engine
......
// { dg-options "-std=c++0x" }
// { dg-require-cstdint "" }
//
// 2010-02-16 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2010 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <random>
void
test01()
{
std::subtract_with_carry_engine<unsigned long, 24, 10, 24> e(1);
const auto f(e);
auto g(f);
}
int main()
{
test01();
return 0;
}
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// //
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -20,9 +20,6 @@ ...@@ -20,9 +20,6 @@
// with this library; see the file COPYING3. If not see // with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// 26.4.3.3 Class template subtract_with_carry_engine [rand.eng.sub]
// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
#include <random> #include <random>
#include <testsuite_hooks.h> #include <testsuite_hooks.h>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// //
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng] // 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
#include <random> #include <random>
#include <testsuite_hooks.h>
void void
test01() test01()
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// //
// 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net> // 2008-11-24 Edward M. Smith-Rowland <3dw4rd@verizon.net>
// //
// Copyright (C) 2008, 2009 Free Software Foundation, Inc. // Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng] // 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
#include <random> #include <random>
#include <testsuite_hooks.h>
void void
test01() test01()
......
...@@ -20,9 +20,6 @@ ...@@ -20,9 +20,6 @@
// with this library; see the file COPYING3. If not see // with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
// 26.4.3.3 Class template subtract_with_carry_engine [rand.eng.sub]
// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
#include <random> #include <random>
void void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment