From: Paolo Carlini Date: Tue, 16 Feb 2010 19:19:55 +0000 (+0000) Subject: random.h (linear_congruential_engine(_Sseq&), [...]): Do not enable for the type... X-Git-Tag: releases/gcc-4.5.0~755 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=05eeebfe49ec779a71f1b7d639d07ecb895f3dbf;p=thirdparty%2Fgcc.git random.h (linear_congruential_engine(_Sseq&), [...]): Do not enable for the type itself. 2010-02-16 Paolo Carlini * 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 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 183a4ccb8012..7ea3348e9f93 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,90 @@ +2010-02-16 Paolo Carlini + + * 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 * include/bits/unique_ptr.h: (unique_ptr<>:: diff --git a/libstdc++-v3/include/bits/random.h b/libstdc++-v3/include/bits/random.h index b7ba1e0db51e..648185dfe0f3 100644 --- a/libstdc++-v3/include/bits/random.h +++ b/libstdc++-v3/include/bits/random.h @@ -188,11 +188,12 @@ namespace std * * @param __q the seed sequence. */ - template::value>::type> + template::value> + ::type> explicit linear_congruential_engine(_Sseq& __q) - { seed<_Sseq>(__q); } + { seed(__q); } /** * @brief Reseeds the %linear_congruential_engine random number generator @@ -210,9 +211,8 @@ namespace std * * @param __q the seed sequence. */ - template::value>::type> - void + template + typename std::enable_if::value>::type seed(_Sseq& __q); /** @@ -403,18 +403,18 @@ namespace std * * @param __q the seed sequence. */ - template::value>::type> + template::value> + ::type> explicit mersenne_twister_engine(_Sseq& __q) - { seed<_Sseq>(__q); } + { seed(__q); } void seed(result_type __sd = default_seed); - template::value>::type> - void + template + typename std::enable_if::value>::type seed(_Sseq& __q); /** @@ -576,11 +576,12 @@ namespace std * * @param __q the seed sequence. */ - template::value>::type> + template::value> + ::type> explicit subtract_with_carry_engine(_Sseq& __q) - { seed<_Sseq>(__q); } + { seed(__q); } /** * @brief Seeds the initial state @f$x_0@f$ of the random number @@ -601,9 +602,8 @@ namespace std * @brief Seeds the initial state @f$x_0@f$ of the * % subtract_with_carry_engine random number generator. */ - template::value>::type> - void + template + typename std::enable_if::value>::type seed(_Sseq& __q); /** @@ -767,10 +767,10 @@ namespace std * * @param __q A seed sequence. */ - template::value - && !std::is_same<_Sseq, _RandomNumberEngine> - ::value>::type> + template::value + && !std::is_same<_Sseq, _RandomNumberEngine>::value> + ::type> explicit discard_block_engine(_Sseq& __q) : _M_b(__q), _M_n(0) @@ -803,12 +803,11 @@ namespace std * sequence. * @param __q A seed generator function. */ - template::value>::type> + template void seed(_Sseq& __q) { - _M_b.seed<_Sseq>(__q); + _M_b.seed(__q); _M_n = 0; } @@ -971,10 +970,10 @@ namespace std * * @param __q A seed sequence. */ - template::value - && !std::is_same<_Sseq, _RandomNumberEngine> - ::value>::type> + template::value + && !std::is_same<_Sseq, _RandomNumberEngine>::value> + ::type> explicit independent_bits_engine(_Sseq& __q) : _M_b(__q) @@ -1001,11 +1000,10 @@ namespace std * seed sequence. * @param __q A seed generator function. */ - template::value>::type> + template void seed(_Sseq& __q) - { _M_b.seed<_Sseq>(__q); } + { _M_b.seed(__q); } /** * @brief Gets a const reference to the underlying generator engine @@ -1178,10 +1176,10 @@ namespace std * * @param __q A seed sequence. */ - template::value - && !std::is_same<_Sseq, _RandomNumberEngine> - ::value>::type> + template::value + && !std::is_same<_Sseq, _RandomNumberEngine>::value> + ::type> explicit shuffle_order_engine(_Sseq& __q) : _M_b(__q) @@ -1214,12 +1212,11 @@ namespace std * sequence. * @param __q A seed generator function. */ - template::value>::type> + template void seed(_Sseq& __q) { - _M_b.seed<_Sseq>(__q); + _M_b.seed(__q); _M_initialize(); } diff --git a/libstdc++-v3/include/bits/random.tcc b/libstdc++-v3/include/bits/random.tcc index 080a1dad88d4..0a39c71e9510 100644 --- a/libstdc++-v3/include/bits/random.tcc +++ b/libstdc++-v3/include/bits/random.tcc @@ -126,8 +126,8 @@ namespace std * Seeds the LCR engine with a value generated by @p __q. */ template - template - void + template + typename std::enable_if::value>::type linear_congruential_engine<_UIntType, __a, __c, __m>:: seed(_Sseq& __q) { @@ -344,8 +344,8 @@ namespace std _UIntType __a, size_t __u, _UIntType __d, size_t __s, _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f> - template - void + template + typename std::enable_if::value>::type mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>:: seed(_Sseq& __q) @@ -531,8 +531,8 @@ namespace std } template - template - void + template + typename std::enable_if::value>::type subtract_with_carry_engine<_UIntType, __w, __s, __r>:: seed(_Sseq& __q) { diff --git a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/base_copy.cc b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/base_copy.cc index 6c8498e7b106..ded2205b125c 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/base_copy.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/base_copy.cc @@ -3,7 +3,7 @@ // // 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 // software; you can redistribute it and/or modify it under the @@ -20,17 +20,11 @@ // with this library; see the file COPYING3. If not see // . -// 26.4.4.1 class template discard_block_engine [rand.adapt.disc] -// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt] - #include -#include void test01() { - bool test __attribute__((unused)) = true; - typedef std::subtract_with_carry_engine base_engine; diff --git a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/base_move.cc b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/base_move.cc index fabe17a2b563..4f903e53052a 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/base_move.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/base_move.cc @@ -3,7 +3,7 @@ // // 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 // software; you can redistribute it and/or modify it under the @@ -20,17 +20,11 @@ // with this library; see the file COPYING3. If not see // . -// 26.4.4.1 class template discard_block_engine [rand.adapt.disc] -// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt] - #include -#include void test01() { - bool test __attribute__((unused)) = true; - typedef std::subtract_with_carry_engine base_engine; diff --git a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/copy.cc b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/copy.cc new file mode 100644 index 000000000000..d244c7691621 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/copy.cc @@ -0,0 +1,42 @@ +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2010-02-16 Paolo Carlini +// +// 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 +// . + +#include + +void +test01() +{ + std::discard_block_engine + < + std::subtract_with_carry_engine, + 389, 24 + > e(1); + + const auto f(e); + auto g(f); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/default.cc index 926bb2c24dbe..0868f8f4a661 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/default.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/default.cc @@ -3,7 +3,7 @@ // // 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 // software; you can redistribute it and/or modify it under the @@ -20,17 +20,11 @@ // with this library; see the file COPYING3. If not see // . -// 26.4.4.1 class template discard_block_engine [rand.adapt.disc] -// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt] - #include -#include void test01() { - bool test __attribute__((unused)) = true; - std::discard_block_engine < std::subtract_with_carry_engine, diff --git a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed1.cc b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed1.cc index 4cedeb85d399..ae9f2b4ce15a 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed1.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed1.cc @@ -3,7 +3,7 @@ // // 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 // software; you can redistribute it and/or modify it under the @@ -20,17 +20,11 @@ // with this library; see the file COPYING3. If not see // . -// 26.4.4.1 class template discard_block_engine [rand.adapt.disc] -// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt] - #include -#include void test01() { - bool test __attribute__((unused)) = true; - unsigned long seed = 2; std::discard_block_engine diff --git a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed2.cc b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed2.cc index b66752c2b6e6..edf40b08c6df 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed2.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed2.cc @@ -3,7 +3,7 @@ // // 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 // software; you can redistribute it and/or modify it under the @@ -20,17 +20,11 @@ // with this library; see the file COPYING3. If not see // . -// 26.4.4.1 class template discard_block_engine [rand.adapt.disc] -// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt] - #include -#include void test01() { - bool test __attribute__((unused)) = true; - double seed = 2.0; std::discard_block_engine diff --git a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed_seq.cc b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed_seq.cc index aa86b9afedc9..c1f841a46309 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed_seq.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed_seq.cc @@ -3,7 +3,7 @@ // // 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 // software; you can redistribute it and/or modify it under the @@ -20,17 +20,11 @@ // with this library; see the file COPYING3. If not see // . -// 26.4.4.1 class template discard_block_engine [rand.adapt.disc] -// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt] - #include -#include void test01() { - bool test __attribute__((unused)) = true; - std::seed_seq seq; std::discard_block_engine diff --git a/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/base_copy.cc b/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/base_copy.cc index 2c8d88e4f26b..81d5d8f18411 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/base_copy.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/base_copy.cc @@ -3,7 +3,7 @@ // // 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 // software; you can redistribute it and/or modify it under the @@ -20,17 +20,11 @@ // with this library; see the file COPYING3. If not see // . -// 26.4.4.2 class template independent_bits_engine [rand.adapt.ibits] -// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt] - #include -#include void test01() { - bool test __attribute__((unused)) = true; - typedef std::subtract_with_carry_engine base_engine; diff --git a/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/base_move.cc b/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/base_move.cc index 1d2ede72c9b0..c5747b306d59 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/base_move.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/base_move.cc @@ -3,7 +3,7 @@ // // 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 // software; you can redistribute it and/or modify it under the @@ -20,17 +20,11 @@ // with this library; see the file COPYING3. If not see // . -// 26.4.4.2 class template independent_bits_engine [rand.adapt.ibits] -// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt] - #include -#include void test01() { - bool test __attribute__((unused)) = true; - typedef std::subtract_with_carry_engine base_engine; diff --git a/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/copy.cc b/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/copy.cc new file mode 100644 index 000000000000..1e88b89efe80 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/copy.cc @@ -0,0 +1,43 @@ +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2010-02-16 Paolo Carlini +// +// 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 +// . + +#include + +void +test01() +{ + std::independent_bits_engine + < + std::subtract_with_carry_engine, + 48, + uint_fast64_t + > e(1); + + const auto f(e); + auto g(f); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/default.cc index 7db0cf30ffc5..781e7a9e206d 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/default.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/default.cc @@ -3,7 +3,7 @@ // // 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 // software; you can redistribute it and/or modify it under the @@ -20,17 +20,11 @@ // with this library; see the file COPYING3. If not see // . -// 26.4.4.2 class template independent_bits_engine [rand.adapt.ibits] -// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt] - #include -#include void test01() { - bool test __attribute__((unused)) = true; - std::independent_bits_engine < std::subtract_with_carry_engine, diff --git a/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/seed1.cc b/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/seed1.cc index 9ad6164d963e..890045d8692d 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/seed1.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/seed1.cc @@ -3,7 +3,7 @@ // // 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 // software; you can redistribute it and/or modify it under the @@ -20,17 +20,11 @@ // with this library; see the file COPYING3. If not see // . -// 26.4.4.2 class template independent_bits_engine [rand.adapt.ibits] -// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt] - #include -#include void test01() { - bool test __attribute__((unused)) = true; - unsigned long seed = 2; std::independent_bits_engine diff --git a/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/seed2.cc b/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/seed2.cc index 3e8787730443..973ddd4dc6a0 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/seed2.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/seed2.cc @@ -3,7 +3,7 @@ // // 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 // software; you can redistribute it and/or modify it under the @@ -20,17 +20,11 @@ // with this library; see the file COPYING3. If not see // . -// 26.4.4.2 class template independent_bits_engine [rand.adapt.ibits] -// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt] - #include -#include void test01() { - bool test __attribute__((unused)) = true; - double seed = 2.0; std::independent_bits_engine diff --git a/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/seed_seq.cc b/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/seed_seq.cc index 724a324310ff..dcaed2d75b3b 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/seed_seq.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/seed_seq.cc @@ -3,7 +3,7 @@ // // 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 // software; you can redistribute it and/or modify it under the @@ -20,17 +20,11 @@ // with this library; see the file COPYING3. If not see // . -// 26.4.4.2 class template independent_bits_engine [rand.adapt.ibits] -// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt] - #include -#include void test01() { - bool test __attribute__((unused)) = true; - std::seed_seq seq; std::independent_bits_engine diff --git a/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/cons/copy.cc b/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/cons/copy.cc new file mode 100644 index 000000000000..06360aa0678e --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/cons/copy.cc @@ -0,0 +1,38 @@ +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2010-02-16 Paolo Carlini +// +// 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 +// . + +#include + +void +test01() +{ + std::linear_congruential_engine e(1); + + const auto f(e); + auto g(f); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/cons/seed1.cc b/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/cons/seed1.cc index 75a2e42c56d1..06d04775b8d8 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/cons/seed1.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/cons/seed1.cc @@ -3,7 +3,7 @@ // // 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 // software; you can redistribute it and/or modify it under the @@ -20,11 +20,7 @@ // with this library; see the file COPYING3. If not see // . -// 26.4.3.1 class template linear_congruential_engine [rand.eng.lcong] -// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng] - #include -#include void test01() diff --git a/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/cons/seed2.cc b/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/cons/seed2.cc index a8819598670a..1fa23dff2b08 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/cons/seed2.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/cons/seed2.cc @@ -3,7 +3,7 @@ // // 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 // software; you can redistribute it and/or modify it under the @@ -20,11 +20,7 @@ // with this library; see the file COPYING3. If not see // . -// 26.4.3.1 class template linear_congruential_engine [rand.eng.lcong] -// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng] - #include -#include void test01() diff --git a/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/cons/seed_seq.cc b/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/cons/seed_seq.cc index 4ec39b5bd3a7..d09d838247d8 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/cons/seed_seq.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/cons/seed_seq.cc @@ -20,9 +20,6 @@ // with this library; see the file COPYING3. If not see // . -// 26.4.3.1 class template linear_congruential_engine [rand.eng.lcong] -// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng] - #include void diff --git a/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/cons/copy.cc b/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/cons/copy.cc new file mode 100644 index 000000000000..3da72cbf5fd7 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/cons/copy.cc @@ -0,0 +1,45 @@ +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2010-02-16 Paolo Carlini +// +// 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 +// . + +#include + +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; +} diff --git a/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/cons/default.cc index 30634e1da30a..be5716080cab 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/cons/default.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/cons/default.cc @@ -3,7 +3,7 @@ // // 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 // software; you can redistribute it and/or modify it under the @@ -20,9 +20,6 @@ // with this library; see the file COPYING3. If not see // . -// 26.4.3.2 Class template mersenne_twister_engine [rand.eng.mers] -// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng] - #include #include diff --git a/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/cons/seed1.cc b/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/cons/seed1.cc index b37f97824961..cf24ffe13f60 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/cons/seed1.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/cons/seed1.cc @@ -3,7 +3,7 @@ // // 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 // software; you can redistribute it and/or modify it under the @@ -20,11 +20,7 @@ // with this library; see the file COPYING3. If not see // . -// 26.4.3.2 Class template mersenne_twister_engine [rand.eng.mers] -// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng] - #include -#include void test01() diff --git a/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/cons/seed2.cc b/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/cons/seed2.cc index d840772cd76a..425e5be7dca2 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/cons/seed2.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/cons/seed2.cc @@ -3,7 +3,7 @@ // // 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 // software; you can redistribute it and/or modify it under the @@ -20,11 +20,7 @@ // with this library; see the file COPYING3. If not see // . -// 26.4.3.2 Class template mersenne_twister_engine [rand.eng.mers] -// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng] - #include -#include void test01() diff --git a/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/cons/seed_seq.cc b/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/cons/seed_seq.cc index c2fb9131d364..aa98c9b9309c 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/cons/seed_seq.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/cons/seed_seq.cc @@ -20,9 +20,6 @@ // with this library; see the file COPYING3. If not see // . -// 26.4.3.2 Class template mersenne_twister_engine [rand.eng.mers] -// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng] - #include void diff --git a/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/base_copy.cc b/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/base_copy.cc index c0087721079c..197f5f0de9ea 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/base_copy.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/base_copy.cc @@ -3,7 +3,7 @@ // // 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 // software; you can redistribute it and/or modify it under the @@ -20,17 +20,11 @@ // with this library; see the file COPYING3. If not see // . -// 26.4.4.3 class template shuffle_order_engine [rand.adapt.shuf] -// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt] - #include -#include void test01() { - bool test __attribute__((unused)) = true; - typedef std::linear_congruential_engine base_engine; diff --git a/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/base_move.cc b/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/base_move.cc index caac982e53fe..c05bc19659db 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/base_move.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/base_move.cc @@ -3,7 +3,7 @@ // // 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 // software; you can redistribute it and/or modify it under the @@ -20,17 +20,11 @@ // with this library; see the file COPYING3. If not see // . -// 26.4.4.3 class template shuffle_order_engine [rand.adapt.shuf] -// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt] - #include -#include void test01() { - bool test __attribute__((unused)) = true; - typedef std::linear_congruential_engine base_engine; diff --git a/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/copy.cc b/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/copy.cc new file mode 100644 index 000000000000..c589a4edc8ac --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/copy.cc @@ -0,0 +1,42 @@ +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2010-02-16 Paolo Carlini +// +// 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 +// . + +#include + +void +test01() +{ + std::shuffle_order_engine + < + std::linear_congruential_engine, + 256 + > e(1); + + const auto f(e); + auto g(f); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/default.cc index 5d96933ef9fc..15a5c2d8fbdf 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/default.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/default.cc @@ -3,7 +3,7 @@ // // 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 // software; you can redistribute it and/or modify it under the @@ -20,17 +20,11 @@ // with this library; see the file COPYING3. If not see // . -// 26.4.4.3 class template shuffle_order_engine [rand.adapt.shuf] -// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt] - #include -#include void test01() { - bool test __attribute__((unused)) = true; - std::shuffle_order_engine < std::linear_congruential_engine, diff --git a/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/seed1.cc b/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/seed1.cc index f6827009c7d4..b39d45a396a0 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/seed1.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/seed1.cc @@ -3,7 +3,7 @@ // // 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 // software; you can redistribute it and/or modify it under the @@ -20,17 +20,11 @@ // with this library; see the file COPYING3. If not see // . -// 26.4.4.3 class template shuffle_order_engine [rand.adapt.shuf] -// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt] - #include -#include void test01() { - bool test __attribute__((unused)) = true; - unsigned long seed = 2; std::shuffle_order_engine diff --git a/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/seed2.cc b/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/seed2.cc index 44ba08896c07..c979e32b8717 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/seed2.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/seed2.cc @@ -3,7 +3,7 @@ // // 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 // software; you can redistribute it and/or modify it under the @@ -20,17 +20,11 @@ // with this library; see the file COPYING3. If not see // . -// 26.4.4.3 class template shuffle_order_engine [rand.adapt.shuf] -// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt] - #include -#include void test01() { - bool test __attribute__((unused)) = true; - double seed = 2.0; std::shuffle_order_engine diff --git a/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/seed_seq.cc b/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/seed_seq.cc index b88d7ebb6b71..01ea91f1e8ec 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/seed_seq.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/seed_seq.cc @@ -3,7 +3,7 @@ // // 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 // software; you can redistribute it and/or modify it under the @@ -20,17 +20,11 @@ // with this library; see the file COPYING3. If not see // . -// 26.4.4.3 class template shuffle_order_engine [rand.adapt.shuf] -// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt] - #include -#include void test01() { - bool test __attribute__((unused)) = true; - std::seed_seq seq; std::shuffle_order_engine diff --git a/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/cons/copy.cc b/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/cons/copy.cc new file mode 100644 index 000000000000..21df0a07e3c6 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/cons/copy.cc @@ -0,0 +1,38 @@ +// { dg-options "-std=c++0x" } +// { dg-require-cstdint "" } +// +// 2010-02-16 Paolo Carlini +// +// 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 +// . + +#include + +void +test01() +{ + std::subtract_with_carry_engine e(1); + + const auto f(e); + auto g(f); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/cons/default.cc b/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/cons/default.cc index 4311439b6e61..1297747a536a 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/cons/default.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/cons/default.cc @@ -3,7 +3,7 @@ // // 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 // software; you can redistribute it and/or modify it under the @@ -20,9 +20,6 @@ // with this library; see the file COPYING3. If not see // . -// 26.4.3.3 Class template subtract_with_carry_engine [rand.eng.sub] -// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng] - #include #include diff --git a/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/cons/seed1.cc b/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/cons/seed1.cc index 078392ccbd02..95db25f4dd85 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/cons/seed1.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/cons/seed1.cc @@ -3,7 +3,7 @@ // // 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 // software; you can redistribute it and/or modify it under the @@ -24,7 +24,6 @@ // 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng] #include -#include void test01() diff --git a/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/cons/seed2.cc b/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/cons/seed2.cc index d86187060925..73f9cbe0fffc 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/cons/seed2.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/cons/seed2.cc @@ -3,7 +3,7 @@ // // 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 // software; you can redistribute it and/or modify it under the @@ -24,7 +24,6 @@ // 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng] #include -#include void test01() diff --git a/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/cons/seed_seq.cc b/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/cons/seed_seq.cc index 617c455dab6f..3fc9991d7fe2 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/cons/seed_seq.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/cons/seed_seq.cc @@ -20,9 +20,6 @@ // with this library; see the file COPYING3. If not see // . -// 26.4.3.3 Class template subtract_with_carry_engine [rand.eng.sub] -// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng] - #include void