Fix C++14 deprecated random_shuffle.
This commit is contained in:
parent
0145d9d514
commit
48bcf66ac7
|
|
@ -43,6 +43,17 @@ extern std::string VL_TO_STRING(QData lhs);
|
|||
inline std::string VL_TO_STRING(const std::string& obj) { return "\"" + obj + "\""; }
|
||||
extern std::string VL_TO_STRING_W(int words, WDataInP obj);
|
||||
|
||||
//===================================================================
|
||||
// Shuffle RNG
|
||||
|
||||
class VlURNG {
|
||||
public:
|
||||
typedef size_t result_type;
|
||||
static size_t min() { return 0; }
|
||||
static size_t max() { return 1ULL << 31; }
|
||||
size_t operator()() { return VL_MASK_I(31) & VL_RANDOM_I(32); }
|
||||
};
|
||||
|
||||
//===================================================================
|
||||
// Readmem/Writemem operation classes
|
||||
|
||||
|
|
@ -246,10 +257,7 @@ public:
|
|||
[=](const T_Value& a, const T_Value& b) { return with_func(a) < with_func(b); });
|
||||
}
|
||||
void reverse() { std::reverse(m_deque.begin(), m_deque.end()); }
|
||||
void shuffle() {
|
||||
std::shuffle(m_deque.begin(), m_deque.end(),
|
||||
[=](int) { return VL_RANDOM_I(32) % m_deque.size(); });
|
||||
}
|
||||
void shuffle() { std::shuffle(m_deque.begin(), m_deque.end(), VlURNG()); }
|
||||
VlQueue unique() const {
|
||||
VlQueue out;
|
||||
std::set<T_Value> saw;
|
||||
|
|
|
|||
|
|
@ -1245,7 +1245,7 @@ public:
|
|||
return reason;
|
||||
}
|
||||
VL_DEBUG_FUNC; // Declare debug()
|
||||
};
|
||||
};
|
||||
|
||||
const char* SplitVarImpl::cannotSplitPackedVarReason(const AstVar* varp) {
|
||||
return SplitPackedVarVisitor::cannotSplitReason(varp, true);
|
||||
|
|
|
|||
Loading…
Reference in New Issue