diff options
author | Yuri Gorshenin <y@maps.me> | 2016-03-11 17:58:38 +0300 |
---|---|---|
committer | Sergey Yershov <yershov@corp.mail.ru> | 2016-03-23 16:53:01 +0300 |
commit | 596b740b358d51e0614acafcb9eacb32386035e0 (patch) | |
tree | e97705684000e0a57d97d1c15990ebf119724a56 /base | |
parent | 63fb4b6c76961f4b924fb3e9edc84055ed635d22 (diff) |
Review fixes.
Diffstat (limited to 'base')
-rw-r--r-- | base/stl_helpers.hpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/base/stl_helpers.hpp b/base/stl_helpers.hpp index 916989a040..f4f3ca3b97 100644 --- a/base/stl_helpers.hpp +++ b/base/stl_helpers.hpp @@ -7,6 +7,8 @@ namespace my { namespace impl { +// When isField is true, Comparer operates on a pointers-to-field. +// Otherwise, Comparer operates on a pointers-to-const-method. template <bool isField, typename T, typename C> struct Comparer; @@ -50,9 +52,10 @@ void SortUnique(std::vector<T> & v) } // Creates a comparer being able to compare two instances of class C -// (given by reference or pointer) by a field of C. For example, to -// create comparer that is able to compare pairs of ints by second -// component, it's enough to call CompareBy(&pair<int, int>::second). +// (given by reference or pointer) by a field or const method of C. +// For example, to create comparer that is able to compare pairs of +// ints by second component, it's enough to call CompareBy(&pair<int, +// int>::second). template <typename T, typename C> impl::Comparer<true, T, C> CompareBy(T(C::*p)) { |