I'm currently reading some C++ code, and can't find an explanation for the following syntax.
The function rng_fn
is just a random number generator that I want to seed with the same value every time the constructor is called. What does the rng_fn(nullptr)
do after the colon, and does this override what happens inside the constructor?
#include Object.h
Object::Object() : rng_fn(nullptr)
{
unsigned int seed = 1;
rng_fn(seed);
}
(I have removed everything from the constructor except for the lines I don't understand.)