Fix C++14 build.
PiperOrigin-RevId: 325618095 Change-Id: Ib9d47e20a8ab0e432948cf275211725936cec0ce
This commit is contained in:
parent
2f93ec916b
commit
79b77e8bfd
@ -297,8 +297,8 @@ class Array {
|
||||
std::mt19937 g(seed);
|
||||
std::normal_distribution<double> distribution(mean, stddev);
|
||||
for (int64 i = 0; i < num_elements(); ++i) {
|
||||
if constexpr (std::is_same<T, bool>()) {
|
||||
values_[i] = distribution(g) > 0.0;
|
||||
if (std::is_same<T, bool>()) {
|
||||
values_[i] = static_cast<T>(distribution(g) > 0.0);
|
||||
} else {
|
||||
values_[i] = static_cast<T>(distribution(g));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user