MCPcopy Create free account
hub / github.com/DFHack/dfhack / vector_get_random

Function vector_get_random

library/include/MiscUtils.h:215–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213
214template<typename T>
215inline T vector_get_random(const std::vector<T>& vec, const T& defval = T())
216{
217 return vector_get(vec, random_index(vec), defval);
218}
219
220template<typename T>
221inline void vector_insert_at(std::vector<T> &vec, unsigned idx, const T &val)

Callers 2

autoDFAnnouncementMethod · 0.85
regrass_eventsFunction · 0.85

Calls 2

vector_getFunction · 0.85
random_indexFunction · 0.85

Tested by

no test coverage detected