forked from bblanchon/ArduinoJson
Remove ARDUINOJSON_HAS_RVALUE_REFERENCES
(#1820)
This commit is contained in:
@ -72,7 +72,6 @@ TEST_CASE("BasicJsonDocument") {
|
|||||||
REQUIRE(log.str() == "A4096A4096FF");
|
REQUIRE(log.str() == "A4096A4096FF");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ARDUINOJSON_HAS_RVALUE_REFERENCES
|
|
||||||
SECTION("Move construct") {
|
SECTION("Move construct") {
|
||||||
{
|
{
|
||||||
BasicJsonDocument<SpyingAllocator> doc1(4096, log);
|
BasicJsonDocument<SpyingAllocator> doc1(4096, log);
|
||||||
@ -87,7 +86,6 @@ TEST_CASE("BasicJsonDocument") {
|
|||||||
}
|
}
|
||||||
REQUIRE(log.str() == "A4096F");
|
REQUIRE(log.str() == "A4096F");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
SECTION("Copy assign larger") {
|
SECTION("Copy assign larger") {
|
||||||
{
|
{
|
||||||
@ -134,7 +132,6 @@ TEST_CASE("BasicJsonDocument") {
|
|||||||
REQUIRE(log.str() == "A1024A1024FF");
|
REQUIRE(log.str() == "A1024A1024FF");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ARDUINOJSON_HAS_RVALUE_REFERENCES
|
|
||||||
SECTION("Move assign") {
|
SECTION("Move assign") {
|
||||||
{
|
{
|
||||||
BasicJsonDocument<SpyingAllocator> doc1(4096, log);
|
BasicJsonDocument<SpyingAllocator> doc1(4096, log);
|
||||||
@ -150,7 +147,6 @@ TEST_CASE("BasicJsonDocument") {
|
|||||||
}
|
}
|
||||||
REQUIRE(log.str() == "A4096A8FF");
|
REQUIRE(log.str() == "A4096A8FF");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
SECTION("garbageCollect()") {
|
SECTION("garbageCollect()") {
|
||||||
BasicJsonDocument<ControllableAllocator> doc(4096);
|
BasicJsonDocument<ControllableAllocator> doc(4096);
|
||||||
|
@ -4,12 +4,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if __cplusplus >= 201103L
|
|
||||||
# define ARDUINOJSON_HAS_RVALUE_REFERENCES 1
|
|
||||||
#else
|
|
||||||
# define ARDUINOJSON_HAS_RVALUE_REFERENCES 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef ARDUINOJSON_HAS_NULLPTR
|
#ifndef ARDUINOJSON_HAS_NULLPTR
|
||||||
# if __cplusplus >= 201103L
|
# if __cplusplus >= 201103L
|
||||||
# define ARDUINOJSON_HAS_NULLPTR 1
|
# define ARDUINOJSON_HAS_NULLPTR 1
|
||||||
|
@ -52,11 +52,9 @@ class BasicJsonDocument : AllocatorOwner<TAllocator>, public JsonDocument {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Move-constructor
|
// Move-constructor
|
||||||
#if ARDUINOJSON_HAS_RVALUE_REFERENCES
|
|
||||||
BasicJsonDocument(BasicJsonDocument&& src) : AllocatorOwner<TAllocator>(src) {
|
BasicJsonDocument(BasicJsonDocument&& src) : AllocatorOwner<TAllocator>(src) {
|
||||||
moveAssignFrom(src);
|
moveAssignFrom(src);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
BasicJsonDocument(const JsonDocument& src) {
|
BasicJsonDocument(const JsonDocument& src) {
|
||||||
copyAssignFrom(src);
|
copyAssignFrom(src);
|
||||||
@ -90,12 +88,10 @@ class BasicJsonDocument : AllocatorOwner<TAllocator>, public JsonDocument {
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ARDUINOJSON_HAS_RVALUE_REFERENCES
|
|
||||||
BasicJsonDocument& operator=(BasicJsonDocument&& src) {
|
BasicJsonDocument& operator=(BasicJsonDocument&& src) {
|
||||||
moveAssignFrom(src);
|
moveAssignFrom(src);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
BasicJsonDocument& operator=(const T& src) {
|
BasicJsonDocument& operator=(const T& src) {
|
||||||
|
Reference in New Issue
Block a user