diff options
author | jgm <jgm@google.com> | 2012-04-10 16:02:11 +0000 |
---|---|---|
committer | jgm <jgm@google.com> | 2012-04-10 16:02:11 +0000 |
commit | 79a367eb217fcd47e2beaf8c0f87fe6d5926f739 (patch) | |
tree | 148e73f4c3b6354f900cae94be5e9495e04d7efa /include/gmock/internal/gmock-internal-utils.h | |
parent | 9bcb5f9146db42bc38b6bb744fb0cf518a0205be (diff) | |
download | googletest-79a367eb217fcd47e2beaf8c0f87fe6d5926f739.tar.gz googletest-79a367eb217fcd47e2beaf8c0f87fe6d5926f739.tar.bz2 googletest-79a367eb217fcd47e2beaf8c0f87fe6d5926f739.zip |
Reduced template instantiation depth for the AllOf and AnyOf matchers. Also some formatting changes.
Diffstat (limited to 'include/gmock/internal/gmock-internal-utils.h')
-rw-r--r-- | include/gmock/internal/gmock-internal-utils.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/gmock/internal/gmock-internal-utils.h b/include/gmock/internal/gmock-internal-utils.h index 34131ef6..aef9388e 100644 --- a/include/gmock/internal/gmock-internal-utils.h +++ b/include/gmock/internal/gmock-internal-utils.h @@ -354,7 +354,8 @@ template <typename T> struct remove_reference<T&> { typedef T type; }; // NOLINT // 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 @@ class StlContainerView< ::std::tr1::tuple<ElementPointer, Size> > { // 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 |