lundi 27 avril 2015

distribution as global variable

In my project, I am trying to use a uniform distribution as a global variable.

In one file (global.h), I write:

#include <random>
extern std::uniform_real_distribution<> sample;

Then, in another file, I want to initialize it (set the parameters) with:

#include "global.h"
std::uniform_real_distribution<>::param_type Params(-0.3,0.3);
sample.param(Params);

But I get the following error message:
'sample' does not name a type

Any suggestions?




Aucun commentaire:

Enregistrer un commentaire