OSDN Git Service

* include/ext/random.tcc (__gnu_cxx:normal_mv_distribution<>)
authordrepper <drepper@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 5 Sep 2012 12:41:17 +0000 (12:41 +0000)
committerdrepper <drepper@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 5 Sep 2012 12:41:17 +0000 (12:41 +0000)
(operator()): Use __generate() function of _M_nd.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190975 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/include/ext/random.tcc

index 15d8485..b7fb795 100644 (file)
@@ -1,5 +1,8 @@
 2012-09-05  Ulrich Drepper  <drepper@gmail.com>
 
+       * include/ext/random.tcc (__gnu_cxx:normal_mv_distribution<>)
+       (operator()): Use __generate() function of _M_nd.
+
        * include/ext/random: Add __gnu_cxx:normal_mv_distribution<> class.
        * include/ext/random.tccAdd out-of-line functions for
        __gnu_cxx::normal_mv_distribution<>.
index 0fa006a..988dc22 100644 (file)
@@ -653,8 +653,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       {
        result_type __ret;
 
-       for (size_t __i = 0; __i < _Dimen; ++__i)
-         __ret[__i] = _M_nd(__urng);
+       _M_nd.__generate(__ret.begin(), __ret.end(), __urng);
 
        auto __t_it = __param._M_t.crbegin();
        for (size_t __i = _Dimen; __i > 0; --__i)