generator_seed_seq.hpp 861 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* boost random/mersenne_twister.hpp header file
  2. *
  3. * Copyright Jens Maurer 2000-2001
  4. * Copyright Steven Watanabe 2010
  5. * Distributed under the Boost Software License, Version 1.0. (See
  6. * accompanying file LICENSE_1_0.txt or copy at
  7. * http://www.boost.org/LICENSE_1_0.txt)
  8. *
  9. * See http://www.boost.org for most recent version including documentation.
  10. *
  11. * $Id$
  12. *
  13. */
  14. #ifndef BOOST_RANDOM_DETAIL_GENERATOR_SEED_SEQ_HPP_INCLUDED
  15. #define BOOST_RANDOM_DETAIL_GENERATOR_SEED_SEQ_HPP_INCLUDED
  16. namespace boost {
  17. namespace random {
  18. namespace detail {
  19. template<class Generator>
  20. class generator_seed_seq {
  21. public:
  22. generator_seed_seq(Generator& g) : gen(&g) {}
  23. template<class It>
  24. void generate(It first, It last) {
  25. for(; first != last; ++first) {
  26. *first = (*gen)();
  27. }
  28. }
  29. private:
  30. Generator* gen;
  31. };
  32. }
  33. }
  34. }
  35. #endif