Skip to content

Commit

Permalink
Add bson bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
leemaguire committed Mar 22, 2024
1 parent 4cd54a7 commit ff5e1d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cpprealm/bson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,15 +339,15 @@ namespace realm {
bsoncxx::document::document(const document& v)
{
#ifdef CPPREALM_HAVE_GENERATED_BRIDGE_TYPES
*reinterpret_cast<CoreDocument*>(&m_document) = *reinterpret_cast<const CoreDocument*>(&v.m_document);
new (&m_document) CoreDocument(*reinterpret_cast<const CoreDocument*>(&v.m_document));
#else
m_document = v.m_document;
#endif
}
bsoncxx::document::document(document&& v)
{
#ifdef CPPREALM_HAVE_GENERATED_BRIDGE_TYPES
*reinterpret_cast<CoreDocument*>(&m_document) = std::move(*reinterpret_cast<const CoreDocument*>(&v.m_document));
new (&m_document) CoreDocument(std::move(*reinterpret_cast<CoreDocument*>(&v.m_document)));
#else
m_document = std::move(v.m_document);
#endif
Expand Down

0 comments on commit ff5e1d9

Please sign in to comment.