Skip to content

Commit 2b8f6f2

Browse files
committed
Fix examples in Fine docs
1 parent 2ae4c34 commit 2b8f6f2

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

c_src/pythonx/fine.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,16 @@ NIFs in C++.
1616

1717
- Smart pointer enabling safe management of resource objects.
1818

19-
- Registering NIFs and resource types via simple annotations. Creating
20-
all static atoms at load time.
19+
- Registering NIFs and resource types via simple annotations.
2120

2221
- Support for encoding/decoding Elixir structs based on compile time
2322
metadata.
2423

2524
- Propagating C++ exceptions as Elixir exceptions, with support for
2625
raising custom Elixir exceptions.
2726

27+
- Creating all static atoms at load time.
28+
2829
## Motivation
2930

3031
Some projects make extensive use of NIFs, where using the C API results
@@ -202,8 +203,8 @@ struct ExPoint {
202203
static constexpr auto module = &atoms::ElixirMyLibPoint;
203204
204205
static constexpr auto fields() {
205-
return std::make_tuple(std::make_tuple(&atoms::x, &ExPoint::x),
206-
std::make_tuple(&atoms::y, &ExPoint::y));
206+
return std::make_tuple(std::make_tuple(&ExPoint::x, &atoms::x),
207+
std::make_tuple(&ExPoint::y, &atoms::y));
207208
}
208209
};
209210
@@ -245,7 +246,7 @@ struct ExGenerator {
245246

246247
static constexpr auto fields() {
247248
return std::make_tuple(
248-
std::make_tuple(&atoms::resource, &ExGenerator::resource),
249+
std::make_tuple(&ExGenerator::resource, &atoms::resource),
249250
);
250251
}
251252
};
@@ -312,7 +313,7 @@ struct ExMyError {
312313

313314
static constexpr auto fields() {
314315
return std::make_tuple(
315-
std::make_tuple(&atoms::data, &ExMyError::data));
316+
std::make_tuple(&ExMyError::data, &atoms::data));
316317
}
317318

318319
static constexpr auto is_exception = true;

0 commit comments

Comments
 (0)