Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated appendToStream - they're new on v7 #454

Merged
merged 1 commit into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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