Faker C++
Loading...
Searching...
No Matches
Helper.h File Reference
#include <initializer_list>
#include <numeric>
#include <span>
#include <vector>
#include "Number.h"
Include dependency graph for Helper.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  faker::helper::WeightedElement< T >
 Get a random element by weight from a vector. More...
 

Namespaces

namespace  faker
 
namespace  faker::helper
 

Functions

template<class T >
faker::helper::arrayElement (std::span< const T > data)
 Get a random element from an STL container.
 
template<typename T , std::size_t N>
faker::helper::arrayElement (const std::array< T, N > &data)
 
template<typename It >
auto faker::helper::arrayElement (It start, It end) -> decltype(*::std::declval< It >())
 
template<class T >
faker::helper::arrayElement (const std::vector< T > &data)
 Get a random element from a vector.
 
template<class T >
faker::helper::arrayElement (const std::initializer_list< T > &data)
 Get a random element from an initializer list.
 
template<class T >
faker::helper::weightedArrayElement (const std::vector< WeightedElement< T > > &data)