Cygwin + MinGW + GCC 相談室 Part 8 (987レス)
前次1-
抽出解除 レス栞

457
(2): 2019/03/09(土)08:54 ID:Ed78ws/P(1) AAS
random_deviceがクソすぎ

D:\learn\random>type test1.cpp
#include <random>
#include <iostream>
using namespace std;

int main()
{
random_device d;
cout << d() << endl;
cout << d() << endl;
cout << d() << endl;
}

D:\learn\random>g++ test1.cpp

D:\learn\random>a
3499211612
581869302
3890346734

D:\learn\random>a
3499211612
581869302
3890346734
460: 2019/03/10(日)12:24 ID:yzd/Af8M(1/3) AAS
>>457
MinGWはmt19937を使うと書いてあるぞ。
469: 2019/03/11(月)09:07 ID:SMAjCV/D(1) AAS
>>457
std::random_device::entropy()を表示させてみ

これで 0.0 が帰る場合は毎回同じ値が帰るから
VCはプロセスIDをうまく使ってrandom_deviceを実現してるようだな
MinGWは駄目だよ
前次1-
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ AAサムネイル

ぬこの手 ぬこTOP 1.204s*