aboutsummaryrefslogtreecommitdiffstats
path: root/include/gmock/internal/gmock-internal-utils.h
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386>2013-03-27 16:14:55 +0000
committerzhanyong.wan <zhanyong.wan@8415998a-534a-0410-bf83-d39667b30386>2013-03-27 16:14:55 +0000
commita9a59e06dd7cdfe52c988bf065bc156a7ed96a5c (patch)
tree83accf8a936e23d9a639303d299d33b69da59d8c /include/gmock/internal/gmock-internal-utils.h
parent1f122a06e6aad4d234123d2d8c1e352029ce0742 (diff)
downloadgoogletest-a9a59e06dd7cdfe52c988bf065bc156a7ed96a5c.tar.gz
googletest-a9a59e06dd7cdfe52c988bf065bc156a7ed96a5c.tar.bz2
googletest-a9a59e06dd7cdfe52c988bf065bc156a7ed96a5c.zip
Makes WhenSorted() support associative containers (by billydonahue@google.com).
Diffstat (limited to 'include/gmock/internal/gmock-internal-utils.h')
-rw-r--r--include/gmock/internal/gmock-internal-utils.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/gmock/internal/gmock-internal-utils.h b/include/gmock/internal/gmock-internal-utils.h
index f9b6b809..e12b7d7d 100644
--- a/include/gmock/internal/gmock-internal-utils.h
+++ b/include/gmock/internal/gmock-internal-utils.h
@@ -473,6 +473,20 @@ class StlContainerView< ::std::tr1::tuple<ElementPointer, Size> > {
// StlContainer with a reference type.
template <typename T> class StlContainerView<T&>;
+// A type transform to remove constness from the first part of a pair.
+// Pairs like that are used as the value_type of associative containers,
+// and this transform produces a similar but assignable pair.
+template <typename T>
+struct RemoveConstFromKey {
+ typedef T type;
+};
+
+// Partially specialized to remove constness from std::pair<const K, V>.
+template <typename K, typename V>
+struct RemoveConstFromKey<std::pair<const K, V> > {
+ typedef std::pair<K, V> type;
+};
+
// Mapping from booleans to types. Similar to boost::bool_<kValue> and
// std::integral_constant<bool, kValue>.
template <bool kValue>