sync code

This commit is contained in:
Ned Wright
2024-09-13 08:59:25 +00:00
parent f4bad4c4d9
commit 69063463d1
50 changed files with 370 additions and 174 deletions

View File

@@ -28,6 +28,7 @@
#include <memory>
#include <string>
#include <vector>
#include <map>
#include <sstream>
#include <iomanip>
#include <sys/types.h>
@@ -145,6 +146,30 @@ operator<<(ostream &os, const vector<Printable> &obj)
return os;
}
// LCOV_EXCL_START Reason: Currently not used in 4.8 coverage but is used in alpine.
template <typename PrintableKey, typename PrintableValue>
ostream &
operator<<(ostream &os, const pair<PrintableKey, PrintableValue> &)
{
// Uncomment when g++ 4.8 is no longer supported
// return os << obj.first << ':' << obj.second;
return os;
}
// LCOL_EXCL_STOP
template <typename PrintableKey, typename PrintableValue>
ostream &
operator<<(ostream &os, const map<PrintableKey, PrintableValue> &)
{
// Uncomment when g++ 4.8 is no longer supported
// bool first = true;
// for (const auto &pair : obj) {
// os << (first ? "" : ", ") << pair;
// first = false;
// }
return os;
}
} // namespace std
#endif // __COMMON_H__

View File

@@ -30,6 +30,7 @@
#include "buffer.h"
#include "scope_exit.h"
#include "tostring.h"
#include "time_print.h"
std::ostream& operator<<(std::ostream &os, const Buffer &buf);

View File

@@ -20,6 +20,7 @@
#include <vector>
#include "common.h"
#include "time_print.h"
#include "singleton.h"
#include "scope_exit.h"