Fix compatibility with GCC 4.8

Closes #2045
This commit is contained in:
Benoit Blanchon
2024-02-01 21:37:45 +01:00
parent c98b05e207
commit 72642e3090
9 changed files with 50 additions and 9 deletions

View File

@ -90,6 +90,10 @@ class AllocatorLog {
append(entry);
}
void clear() {
log_.str("");
}
void append(const AllocatorLogEntry& entry) {
for (size_t i = 0; i < entry.count(); i++)
log_ << entry.str() << "\n";
@ -165,7 +169,7 @@ class SpyingAllocator : public ArduinoJson::Allocator {
}
void clearLog() {
log_ = AllocatorLog();
log_.clear();
}
const AllocatorLog& log() const {

View File

@ -212,3 +212,8 @@ TEST_CASE("Polyfills/type_traits") {
CHECK(is_enum<double>::value == false);
}
}
TEST_CASE("is_std_string") {
REQUIRE(is_std_string<std::string>::value == true);
REQUIRE(is_std_string<EmptyClass>::value == false);
}