Skip to content

Commit 475864c

Browse files
authored
Add missing namespace to quick start snippet (#3248)
## Pull Request Info - [Quick Start](https://preview-mongodbdacharyc.gatsbyjs.io/realm/cpp-add-missing-namespace/sdk/cpp/quick-start/): Add the missing `namespace` line to the quick start model. ### Reminder Checklist Before merging your PR, make sure to check a few things. - [x] Did you tag pages appropriately? - genre - meta.keywords - meta.description - [x] Describe your PR's changes in the Release Notes section - [x] Create a Jira ticket for related docs-app-services work, if any ### Release Notes - **C++ SDK** - Quick Start: Fix omitted `namespace` line in the object model. ### Review Guidelines [REVIEWING.md](https://github.com/mongodb/docs-realm/blob/master/REVIEWING.md)
1 parent a5a5d85 commit 475864c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

examples/cpp/sync/quick-start.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ struct Local_Todo {
2020
std::string status;
2121
};
2222
REALM_SCHEMA(Local_Todo, _id, name, status);
23+
} // namespace realm
2324

2425
// :snippet-start: model
26+
namespace realm {
2527
struct Sync_Todo {
2628
realm::primary_key<realm::object_id> _id{realm::object_id::generate()};
2729
std::string name;
@@ -31,8 +33,8 @@ struct Sync_Todo {
3133
std::string ownerId;
3234
};
3335
REALM_SCHEMA(Sync_Todo, _id, name, status, ownerId);
34-
// :snippet-end:
3536
} // namespace realm
37+
// :snippet-end:
3638

3739
TEST_CASE("non-sync quick start", "[realm][write]") {
3840
auto relative_realm_path_directory = "quick-start/";

source/examples/generated/cpp/quick-start.snippet.model.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
namespace realm {
12
struct Todo {
23
realm::primary_key<realm::object_id> _id{realm::object_id::generate()};
34
std::string name;
@@ -7,3 +8,4 @@ struct Todo {
78
std::string ownerId;
89
};
910
REALM_SCHEMA(Todo, _id, name, status, ownerId);
11+
} // namespace realm

0 commit comments

Comments
 (0)