Why are std::shuffle methods being deprecated in C++14?

后端 未结 4 1777
借酒劲吻你
借酒劲吻你 2020-12-05 12:43

According to the cppreference.com reference site on std::shufle, the following method is being deprecated in c++14:

template< class RandomIt >
void ran         


        
4条回答
  •  独厮守ぢ
    2020-12-05 13:12

    random_shuffle is being deprecated because its RNG is unspecified -- not just that you don't have to specify it, but that the standard itself doesn't specify it. On VC++, for instance, it uses rand(), which is implemented really poorly!

提交回复
热议问题