FastLED 3.9.15
Loading...
Searching...
No Matches

◆ default_random()

fl_random & fl::default_random ( )

Global default random number generator instance.

This provides a convenient global instance that can be used when you don't need to manage multiple separate random generators.

// Using the global instance
auto value = fl::default_random()();
fl::shuffle(vec.begin(), vec.end(), fl::default_random());
void shuffle(Iterator first, Iterator last, RandomGenerator &g)
Definition algorithm.h:527
fl_random & default_random()
Global default random number generator instance.
Definition random.cpp:8

Definition at line 8 of file random.cpp.

8 {
9 static ThreadLocal<fl_random> instance;
10 return instance.access();
11}
ThreadLocalFake< T > ThreadLocal

References fl::ThreadLocalFake< T >::access().

Referenced by shuffle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: