Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tiago Peixoto
graph-tool
Commits
b2cce016
Commit
b2cce016
authored
Oct 22, 2014
by
Tiago Peixoto
Browse files
Fix uniform_sample() to return a const reference
parent
a65ce3df
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/graph/generation/sampler.hh
View file @
b2cce016
...
...
@@ -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
)];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment