You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: "Learn more about: value_compare Class"
3
2
title: "value_compare Class"
4
-
ms.date: "11/04/2016"
3
+
description: "Learn more about: value_compare Class"
4
+
ms.date: 11/04/2016
5
5
f1_keywords: ["hash_map/std::value_compare"]
6
6
helpviewer_keywords: ["value_compare class"]
7
-
ms.assetid: c306c5b9-3505-4357-aa6b-216451b951ed
8
7
---
9
-
# value_compare Class
8
+
# `value_compare` Class
10
9
11
-
Provides a function object that can compare the elements of a hash_map by comparing the values of their keys to determine their relative order in the hash_map.
10
+
Provides a function object that can compare the elements of a `hash_map` by comparing the values of their keys to determine their relative order in the `hash_map`.
: public binary_function<value_type, value_type, bool>
18
17
{
19
18
public:
20
19
bool operator()(
@@ -32,22 +31,22 @@ protected:
32
31
33
32
## Remarks
34
33
35
-
The comparison criteria provided by value_compare between `value_types` of whole elements contained by a hash_map is induced from a comparison between the keys of the respective elements by the auxiliary class construction. The member function operator uses the object `comp` of type `key_compare` stored in the function object provided by value_compare to compare the sort-key components of two elements.
34
+
The comparison criteria provided by `value_compare` between `value_types` of whole elements contained by a `hash_map` is induced from a comparison between the keys of the respective elements by the auxiliary class construction. The member function operator uses the object `comp` of type `key_compare` stored in the function object provided by `value_compare` to compare the sort-key components of two elements.
36
35
37
-
For hash_sets and hash_multisets, which are simple containers where the key values are identical to the element values, value_compare is equivalent to `key_compare`; for hash_maps and hash_multimaps they are not, because the value of the type `pair` elements is not identical to the value of the element's key.
36
+
For `hash_set`s and `hash_multiset`s, which are simple containers where the key values are identical to the element values, `value_compare` is equivalent to `key_compare`; for `hash_map`s and `hash_multimap`s they are not, because the value of the type `pair` elements is not identical to the value of the element's key.
38
37
39
38
## Example
40
39
41
-
See the example for [hash_map::value_comp](../standard-library/hash-map-class.md#value_comp) for an example of how to declare and use value_compare.
40
+
See the example for [`hash_map::value_comp`](hash-map-class.md#value_comp) for an example of how to declare and use `value_compare`.
0 commit comments