diff options
author | DDuarte <dnpd.dd@gmail.com> | 2016-01-03 20:38:58 +0000 |
---|---|---|
committer | DDuarte <dnpd.dd@gmail.com> | 2016-01-03 20:39:13 +0000 |
commit | ff9c999334d87acc3fcea9737753c30b7f1abe25 (patch) | |
tree | e88dd75cd4bec84ffe5862c6e9df5773f6537d4c /src | |
parent | 0c61cfd8ee0c9df27e755ae30b877ee3ff814bf0 (diff) |
Core/Utilities: Fix build in some versions of Ubuntu / GCC
Closes #16125
Diffstat (limited to 'src')
-rw-r--r-- | src/common/Utilities/Containers.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/Utilities/Containers.h b/src/common/Utilities/Containers.h index 13e5dc55bd3..c1e3ca9d8b0 100644 --- a/src/common/Utilities/Containers.h +++ b/src/common/Utilities/Containers.h @@ -92,12 +92,12 @@ namespace Trinity * Select a random element from a container where each element has a different chance to be selected. * * @param container Container to select an element from - * @param weightExtractor Function retrieving chance of each element in container + * @param weightExtractor Function retrieving chance of each element in container, expected to take an element of the container and returning a double * * Note: container cannot be empty */ - template <class C> - typename C::const_iterator SelectRandomWeightedContainerElement(C const& container, std::function<double(typename C::value_type const&)> const& weightExtractor) + template <class C, class Fn> + typename C::const_iterator SelectRandomWeightedContainerElement(C const& container, Fn weightExtractor) { std::vector<double> weights; weights.reserve(container.size()); |