我有一条线:
std::uniform_real_distribution<T> distribution(std::numeric_limits<T>::lowest(), 
                                               std::numeric_limits<T>::max());
它编译但在Debug(VS 2017CE)上崩溃.我的猜测是,根据以下文件std::uniform_real_distribution:
需要
a ? b和b-a ? std::numeric_limits<RealType>::max()
当我的b是::max(),a是::lowest(),条件:
b-a ? std::numeric_limits<RealType>::max()
没有履行,因为b-a基本上是两倍的价值max.有没有解决这个问题,以便保持如此广泛的数字范围?::min()工作完美,但省略负值.仅浮动数字会出现问题.