Skip to content

Commit 3fd4d26

Browse files
committed
Better documentation
1 parent 92142ef commit 3fd4d26

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ NIFs in C++.
3232

3333
- STL compatible Erlang-backend mutex and rwlock.
3434

35-
- Compatible with STL container allocators and polymorphic memor
35+
- Compatible with STL container allocators and polymorphic memory
3636
resources.
3737

3838
## Motivation
@@ -573,7 +573,7 @@ struct MyAllocator { ... };
573573
574574
std::pmr::memory_resource* my_memory_resource = ...;
575575
576-
std::vector<std::pmr::string, MyAllocator<std::pmr::string>> duplicate(
576+
std::vector<std::pmr::string, MyAllocator<std::pmr::string>> repeat_string(
577577
ErlNifEnv *,
578578
std::basic_string<char, std::char_traits<char>, MyAllocator<char>>
579579
string,
@@ -586,9 +586,13 @@ std::vector<std::pmr::string, MyAllocator<std::pmr::string>> duplicate(
586586
587587
return strings;
588588
}
589-
FINE_NIF(duplicate, 0);
589+
FINE_NIF(repeat_string, 0);
590590
```
591591
592+
Attempting to decode STL containers making use of `std::pmr::polymorphic_allocator`
593+
will result in the `std::pmr::get_default_resource()` memory resource being
594+
used.
595+
592596
<!-- Docs -->
593597
594598
## Prior work

0 commit comments

Comments
 (0)