[DOCS-15830] [C++] Update embedded object examples Created: 19/Jan/23  Updated: 23/Jan/23  Resolved: 23/Jan/23

Status: Closed
Project: Documentation
Component/s: Realm
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Dachary Carey Assignee: Dachary Carey
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
Participants:
Days since reply: 1 year, 2 weeks, 2 days ago
Epic Link: DOCSP-26490
Story Points: 1

 Description   

PR #20 in the realm-cpp repo updates the way embedded objects work. It looks like you can now directly access an embedded object as a member of the parent struct - i.e. some of the tests have been updated from:

realm.write([&foo]() {
       (*foo.foo).bar = 84;
});

To:

realm.write([&foo]() {
       foo.foo->bar = 84;
});

Update code examples for embedded objects to reflect this (much better) syntax.



 Comments   
Comment by Dachary Carey [ 23/Jan/23 ]

This ticket isn't exactly a duplicate, but I addressed this code example as part of the linked ticket, so this separate ticket is no longer needed.

Generated at Thu Feb 08 08:13:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.