diff --git a/src/graph/generation/sampler.hh b/src/graph/generation/sampler.hh index 068c0532bed251e5b7bcc99876fd8abb35743c07..c1ce6023c7796e1af2e0ade6617406bd268d0992 100644 --- a/src/graph/generation/sampler.hh +++ b/src/graph/generation/sampler.hh @@ -20,6 +20,7 @@ #include "random.hh" #include +#include namespace graph_tool { @@ -31,7 +32,7 @@ using namespace boost; // See http://www.keithschwarz.com/darts-dice-coins/ for a very clear // explanation, -template +template class Sampler { public: @@ -76,6 +77,8 @@ public: _small.clear(); } + Sampler() {} + template const Value& sample(RNG& rng) { @@ -103,7 +106,10 @@ private: } }; - const vector& _items; + typedef typename mpl::if_&, + vector >::type items_t; + items_t _items; vector _probs; vector _alias; vector _small;