Reduced template instantiation depth for the AllOf and AnyOf matchers. Also some formatting changes.
diff --git a/include/gmock/internal/gmock-internal-utils.h b/include/gmock/internal/gmock-internal-utils.h
index 34131ef..aef9388 100644
--- a/include/gmock/internal/gmock-internal-utils.h
+++ b/include/gmock/internal/gmock-internal-utils.h
@@ -354,7 +354,8 @@
// crashes).
template <typename T>
inline T Invalid() {
- return *static_cast<typename remove_reference<T>::type*>(NULL);
+ return const_cast<typename remove_reference<T>::type&>(
+ *static_cast<volatile typename remove_reference<T>::type*>(NULL));
}
template <>
inline void Invalid<void>() {}
@@ -459,6 +460,11 @@
// StlContainer with a reference type.
template <typename T> class StlContainerView<T&>;
+// Mapping from booleans to types. Similar to boost::bool_<kValue> and
+// std::integral_constant<bool, kValue>.
+template <bool kValue>
+struct BooleanConstant {};
+
} // namespace internal
} // namespace testing