Skip to content

Commit

Permalink
Remove deprecated appendToStream - they're new on v7 (#454)
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <[email protected]>
  • Loading branch information
chapulina authored Jul 6, 2022
1 parent 3827f4c commit 34d481d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 54 deletions.
31 changes: 0 additions & 31 deletions include/gz/math/Helpers.hh
Original file line number Diff line number Diff line change
Expand Up @@ -466,37 +466,6 @@ namespace gz
sort2(_a, _b);
}

/// \brief Append a number to a stream. Makes sure "-0" is returned as "0".
/// \param[out] _out Output stream.
/// \param[in] _number Number to append.
/// \param[in] _precision Precision for floating point numbers.
/// \deprecated Use appendToStream(std::ostream, T) instead.
template<typename T>
inline void GZ_DEPRECATED(7) appendToStream(
std::ostream &_out, T _number, int _precision)
{
if (std::fpclassify(_number) == FP_ZERO)
{
_out << 0;
}
else
{
_out << precision(_number, _precision);
}
}

/// \brief Append a number to a stream, specialized for int.
/// \param[out] _out Output stream.
/// \param[in] _number Number to append.
/// _precision Not used for int.
/// \deprecated Use appendToStream(std::ostream, int) instead.
template<>
inline void GZ_DEPRECATED(7) appendToStream(
std::ostream &_out, int _number, int)
{
_out << _number;
}

/// \brief Append a number to a stream. Makes sure "-0" is returned as "0".
/// \param[out] _out Output stream.
/// \param[in] _number Number to append.
Expand Down
23 changes: 0 additions & 23 deletions src/Helpers_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -985,29 +985,6 @@ TEST(HelpersTest, AppendToStream)
{
std::ostringstream out;

GZ_UTILS_WARN_IGNORE__DEPRECATED_DECLARATION
// Deprecated in gz-math7
math::appendToStream(out, 0.12345678, 3);
EXPECT_EQ(out.str(), "0.123");

out << " ";

math::appendToStream(out, 0.0f, 5);
EXPECT_EQ(out.str(), "0.123 0");

out << " ";

math::appendToStream(out, 456, 3);
EXPECT_EQ(out.str(), "0.123 0 456");

out << " ";

math::appendToStream(out, 0, 3);
EXPECT_EQ(out.str(), "0.123 0 456 0");

out.str("");
GZ_UTILS_WARN_RESUME__DEPRECATED_DECLARATION

math::appendToStream(out, 0.0f);
EXPECT_EQ(out.str(), "0");

Expand Down

0 comments on commit 34d481d

Please sign in to comment.