Get a random element by weight from a vector.
More...
#include <helper.h>
template<class T>
struct faker::helper::WeightedElement< T >
Get a random element by weight from a vector.
- Template Parameters
-
T | an element type of the weighted element. |
- Parameters
-
data | vector of weighted elements. |
- Returns
- T a weighted element value from the vector.
{10, "value2"}})
T weightedRandomElement(const std::vector< WeightedElement< T > > &data)
Definition helper.h:100
Get a random element by weight from a vector.
Definition helper.h:94
◆ value
◆ weight
The documentation for this struct was generated from the following file: