Remove public includes of <iomanip>

This commit removes `<iomanip>` from public GoogleTest header files.

As `<iomanip>` is not a common included file, its content is unlikely
to be included in translation units other than through GoogleTest
includes.

By reducing the number of include directives public headers in
GoogleTest, this may reduce the time taken to compile tests as it would
reduce the amount of work that the preprocessor and compiler front-end
need to do.
This commit is contained in:
Elliot Goodrich 2023-08-03 21:22:23 +01:00
parent cc366710bb
commit 9ef5e82269
2 changed files with 4 additions and 6 deletions

View File

@ -51,7 +51,6 @@
#include <cstddef>
#include <cstdint>
#include <iomanip>
#include <limits>
#include <memory>
#include <ostream>
@ -1574,12 +1573,12 @@ AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression,
}
::std::stringstream lhs_ss;
lhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
<< lhs_value;
lhs_ss.precision(std::numeric_limits<RawType>::digits10 + 2);
lhs_ss << lhs_value;
::std::stringstream rhs_ss;
rhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
<< rhs_value;
rhs_ss.precision(std::numeric_limits<RawType>::digits10 + 2);
rhs_ss << rhs_value;
return EqFailure(lhs_expression, rhs_expression,
StringStreamToString(&lhs_ss), StringStreamToString(&rhs_ss),

View File

@ -58,7 +58,6 @@
#include <cstdint>
#include <functional>
#include <iomanip>
#include <limits>
#include <map>
#include <set>