Skip to content

Commit b0ddd8d

Browse files
committed
Update docs about removing apply_stl
Issue `error: ‘apply_stl’ is not a member of ‘jlcxx::stl’` #488
1 parent 55c1339 commit b0ddd8d

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

README.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -977,19 +977,9 @@ You can also further specialize on `T` to get specific behavior depending on th
977977

978978
View [StdLib](./src/StdLib) to check available methods. The containers have iterators defined, and hence are iterable.
979979

980-
To add support for e.g. vectors of your own type `World`, either just add methods that use an `std::vector<World>` as an argument, or manually wrap them using `jlcxx::stl::apply_stl<World>(mod);`.
980+
To add support for e.g. vectors of your own type `World`, just add methods that use an `std::vector<World>` as an argument or return type.
981981
For this to work, add `#include "jlcxx/stl.hpp"` to your C++ file.
982982

983-
If the type `World` contains methods that take or return `std::` collections of type `World` or `World*`, however, you must first complete the type, so that CxxWrap can generate the type and the template specializations for the `std::` collections.
984-
In this case, you can add those methods to your type like this:
985-
986-
```
987-
jlcxx::stl::apply_stl<World*>(mod);
988-
mod.method("getSecondaryWorldVector", [](const World* p)->const std::vector<World*>& {
989-
return p->getSecondaries();
990-
});
991-
```
992-
993983
Linking wrappers using STL support requires adding `JlCxx::cxxwrap_julia_stl` to the `target_link_libraries` command in `CMakeLists.txt`.
994984

995985
### Working with `StdString`
@@ -1072,7 +1062,7 @@ The reason for this change is that the old method caused crahses on macOS with A
10721062
10731063
## Breaking changes in v0.17
10741064
1075-
* The binary parts of dependent packages need to be rebuilt against `libcxxwrap-julia` 0.14, which has a better way of adding STL functionality
1065+
* The binary parts of dependent packages need to be rebuilt against `libcxxwrap-julia` 0.14, which has a better way of adding STL functionality. This means the `apply_stl` function has been removed and calls to it should just be removed, since the appropriate types are now generated automatically.
10761066
10771067
## References
10781068
* [JuliaCon 2020 Talk: Julia and C++: a technical overview of CxxWrap.jl](https://www.youtube.com/watch?v=u7IaXwKSUU0)

0 commit comments

Comments
 (0)