mirror of
https://github.com/gabime/spdlog.git
synced 2025-10-02 03:19:02 +08:00
fixes
This commit is contained in:
@@ -58,8 +58,7 @@ public:
|
||||
// If the queue is full, block the calling thread until there is room.
|
||||
template<typename TT>
|
||||
void push(TT&& item) {
|
||||
constexpr std::chrono::hours one_hour(1);
|
||||
while (!push(std::forward<TT>(item), one_hour));
|
||||
while (!push(std::forward<TT>(item), std::chrono::hours(1)));
|
||||
}
|
||||
|
||||
// Pop a copy of the front item in the queue into the given item ref.
|
||||
@@ -86,8 +85,7 @@ public:
|
||||
// Pop a copy of the front item in the queue into the given item ref.
|
||||
// If the queue is empty, block the calling thread util there is item to pop.
|
||||
void pop(T& item) {
|
||||
constexpr std::chrono::hours one_hour(1);
|
||||
while (!pop(item, one_hour));
|
||||
while (!pop(item, std::chrono::hours(1)));
|
||||
}
|
||||
|
||||
// Clear the queue
|
||||
|
@@ -15,9 +15,10 @@ public:
|
||||
_str = other._str;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
const std::string& str_ref() const {
|
||||
return _str;
|
||||
std::ostringstream oss;
|
||||
}
|
||||
|
||||
void clear() {
|
||||
@@ -47,13 +48,15 @@ class fast_oss:public std::ostream {
|
||||
public:
|
||||
fast_oss():std::ostream(&_dev) {}
|
||||
~fast_oss() = default;
|
||||
fast_oss(const fast_oss& other):std::basic_ios<char>(), std::ostream(),_dev(other._dev) {}
|
||||
|
||||
fast_oss(const fast_oss& other) :std::basic_ios<char>(), std::ostream(&_dev), _dev(other._dev) {}
|
||||
|
||||
fast_oss& operator=(const fast_oss& other) {
|
||||
if(&other != this)
|
||||
_dev = other._dev;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
const std::string& str_ref() const {
|
||||
return _dev.str_ref();
|
||||
}
|
||||
|
@@ -26,6 +26,8 @@ inline std::tm localtime()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
inline bool operator==(const std::tm& tm1, const std::tm& tm2)
|
||||
{
|
||||
return (tm1.tm_sec == tm2.tm_sec &&
|
||||
@@ -45,3 +47,6 @@ inline bool operator!=(const std::tm& tm1, const std::tm& tm2)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user