-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(DOCSP-26735): C++: Add a Quick Start page #2575
Conversation
Readability for Commit Hash: dfd230b You can see any previous Readability scores (if they exist) by looking Flesch Reading Ease scores for changed documents:
The following table can be helpful in assessing the readability score of a document.
|
CHECK(*todoToUpdate.status == "Complete"); | ||
|
||
// :snippet-start: delete | ||
realm.write([&realm, &todo] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I replace this delete
block with this code, instead:
auto todoToDelete = todos[0];
realm.write([&realm, &todoToDelete] {
realm.remove(todoToDelete);
});
I get this error:
/Users/dachary.carey/workspace/docs-realm/examples/cpp/quick-start.cpp:47: FAILED:
{Unknown expression after the reported line}
due to unexpected exception with message:
Index out of range.
I would expect it to work because in line 66 above, we verify that todos
contains an item. I am assuming it has failed because of memory/unique_ptr shenanigans between 66 and here, but I could be misinterpreting this entirely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing in your alternate code sticks out as wrong to me. Might be worth bringing this up with the SDK team to see if this is a known issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments... looks good so far!
// For this example, get the userId for the Flexible Sync query | ||
auto userId = user.identifier(); | ||
auto subscriptions = realm.subscriptions(); | ||
auto updateSubscriptionSuccess = subscriptions.update([&](realm::mutable_sync_subscription_set &subs) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work?
auto updateSubscriptionSuccess = subscriptions.update([&](realm::mutable_sync_subscription_set &subs) { | |
auto updateSubscriptionSuccess = subscriptions.update([&](auto &subs) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that works in above where I'm clearing all subscriptions, but when I try to use it with add
, I get this error:
/Users/dachary.carey/workspace/docs-realm/examples/cpp/quick-start.cpp:133:14: error: use 'template' keyword to treat 'add' as a dependent template name
subs.add<Sync_Todo>("todos", [&userId](auto &obj) {
^
template
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, nevermind!
Pull Request Info
As part of this work, I removed the "LINQ" reference in the include that was shared across all the SDKs, and replaced it with the more generic "the SDK's query engine."
Jira
Staged Changes
Reminder Checklist
If your PR modifies the docs, you might need to also update some corresponding
pages. Check if completed or N/A.
Review Guidelines
REVIEWING.md