summaryrefslogtreecommitdiffstats
path: root/googletest/include/gtest/internal
diff options
context:
space:
mode:
authorDerek Mauro <dmauro@google.com>2023-01-24 16:40:51 (GMT)
committerCopybara-Service <copybara-worker@google.com>2023-01-24 16:41:35 (GMT)
commit544c96ed5b0fb97ef867c38fbe204df2eaa02d2b (patch)
treefa87f8efdceda982c4d48399e33646f06875913e /googletest/include/gtest/internal
parentec25eea8f8237cf86c30703f59747e42f34b6f75 (diff)
downloadgoogletest-544c96ed5b0fb97ef867c38fbe204df2eaa02d2b.zip
googletest-544c96ed5b0fb97ef867c38fbe204df2eaa02d2b.tar.gz
googletest-544c96ed5b0fb97ef867c38fbe204df2eaa02d2b.tar.bz2
Remove FloatingPoint::Max() in favor of std::numeric_limits::max()
In #4113 a user says Max clashes with a macro. Since it is only used in a test, use std::numeric_limits::max() instead. Note that in headers, the macro issue can be mitigated with parenthesis like this: `(std::numeric_limits<T>::max)()` PiperOrigin-RevId: 504284906 Change-Id: Ibf430caec1a6afdf6b303534fec6a4fd00a6373f
Diffstat (limited to 'googletest/include/gtest/internal')
-rw-r--r--googletest/include/gtest/internal/gtest-internal.h14
1 files changed, 0 insertions, 14 deletions
diff --git a/googletest/include/gtest/internal/gtest-internal.h b/googletest/include/gtest/internal/gtest-internal.h
index 3121d42..e1eb2b5 100644
--- a/googletest/include/gtest/internal/gtest-internal.h
+++ b/googletest/include/gtest/internal/gtest-internal.h
@@ -307,9 +307,6 @@ class FloatingPoint {
// Returns the floating-point number that represent positive infinity.
static RawType Infinity() { return ReinterpretBits(kExponentBitMask); }
- // Returns the maximum representable finite floating-point number.
- static RawType Max();
-
// Non-static methods
// Returns the bits that represents this number.
@@ -390,17 +387,6 @@ class FloatingPoint {
FloatingPointUnion u_;
};
-// We cannot use std::numeric_limits<T>::max() as it clashes with the max()
-// macro defined by <windows.h>.
-template <>
-inline float FloatingPoint<float>::Max() {
- return FLT_MAX;
-}
-template <>
-inline double FloatingPoint<double>::Max() {
- return DBL_MAX;
-}
-
// Typedefs the instances of the FloatingPoint template class that we
// care to use.
typedef FloatingPoint<float> Float;