Commit b2cce016 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Fix uniform_sample() to return a const reference

parent a65ce3df
......@@ -109,7 +109,7 @@ private:
// uniform sampling from containers
template <class Container, class RNG>
typename Container::value_type& uniform_sample(Container& v, RNG& rng)
const typename Container::value_type& uniform_sample(const Container& v, RNG& rng)
{
std::uniform_int_distribution<size_t> i_rand(0, v.size() - 1);
return v[i_rand(rng)];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment