Skip to content

Commit

Permalink
Removed ostringstream use. Fixed C++03 problem with Ensure declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikołaj Małecki committed May 27, 2024
1 parent 8126c49 commit 216c1ed
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apps/logsupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ set<srt_logging::LogFA> SrtParseLogFA(string fa, set<string>* punknown)

void ParseLogFASpec(const vector<string>& speclist, string& w_on, string& w_off)
{
std::ostringstream son, soff;
fmt::obufstream son, soff;

for (auto& s: speclist)
{
Expand Down
2 changes: 1 addition & 1 deletion apps/uriparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ string UriParser::makeUri()
prefix = m_proto + "://";
}

std::ostringstream out;
fmt::obufstream out;

out << prefix << m_host;
if ((m_port == "" || m_port == "0") && m_expect == EXPECT_FILE)
Expand Down
6 changes: 5 additions & 1 deletion srtcore/sfmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,11 @@ struct Ensure
template<class AnyType>
struct Ensure<AnyType, false>
{
typename AnyType::wrong_condition v = AnyType::wrong_condition;
static void CheckIfCharsetNonEmpty()
{
typename AnyType::wrong_condition v = AnyType::wrong_condition;
(void)v;
}
};

template<size_t N1, size_t N2, size_t N3> inline
Expand Down
4 changes: 2 additions & 2 deletions srtcore/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,8 @@ struct explicit_t
// but this function has a different definition for C++11 and C++03.
namespace srt_pair_op
{
template <class Value1, class Value2>
std::ostream& operator<<(std::ostream& s, const std::pair<Value1, Value2>& v)
template <class Stream, class Value1, class Value2>
Stream& operator<<(Stream& s, const std::pair<Value1, Value2>& v)
{
s << "{" << v.first << " " << v.second << "}";
return s;
Expand Down

0 comments on commit 216c1ed

Please sign in to comment.