Skip to content

Commit 07f2d6d

Browse files
authored
Implicitly create bytes in exchange()
1 parent 28c9481 commit 07f2d6d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cppjson/src/object.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ cppjson::JsonObject::JsonObject(const cppjson::JsonObject& other)
1818
cppjson::JsonObject::JsonObject(JsonObject&& other)
1919
{
2020
this->_dataType = std::exchange(other._dataType, cppjson::JsonType::Null);
21-
this->_dataStorage = std::exchange(other._dataStorage, ::operator new(DataStorageSize));
21+
this->_dataStorage = std::exchange(other._dataStorage, static_cast<std::byte*>(::operator new(DataStorageSize)));
2222
}
2323
cppjson::JsonObject& cppjson::JsonObject::operator=(const cppjson::JsonObject& other)
2424
{
@@ -35,7 +35,7 @@ cppjson::JsonObject& cppjson::JsonObject::operator=(cppjson::JsonObject&& other)
3535
if (&other != this)
3636
{
3737
this->_dataType = std::exchange(other._dataType, cppjson::JsonType::Null);
38-
this->_dataStorage = std::exchange(other._dataStorage, ::operator new(DataStorageSize));
38+
this->_dataStorage = std::exchange(other._dataStorage, static_cast<std::byte*>(::operator new(DataStorageSize)));
3939
}
4040
return *this;
4141
}

0 commit comments

Comments
 (0)