Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
barche committed Apr 1, 2024
1 parent 646ec4e commit dbeb773
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions examples/types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,8 @@ JLCXX_MODULE define_julia_module(jlcxx::Module& types)
return {std::shared_ptr<const World>(new World("shared vector const hello"))};
});

types.method("world_ptr_vector", []() { static World w; return std::vector({&w}); });

types.method("get_shared_vector_msg", [](const std::vector<std::shared_ptr<World>>& v)
{
return v[0]->greet();
Expand Down
2 changes: 1 addition & 1 deletion include/jlcxx/stl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ struct WrapQueueImpl
wrapped.module().set_override_module(StlWrappers::instance().module());
wrapped.method("cppsize", &WrappedT::size);
wrapped.method("push_back!", [] (WrappedT& v, const T& val) { v.push(val); });
wrapped.method("front", [] (WrappedT& v) -> const T { return v.front(); });
wrapped.method("front", [] (WrappedT& v) { return v.front(); });
wrapped.method("pop_front!", [] (WrappedT& v) { v.pop(); });
wrapped.module().unset_override_module();
}
Expand Down

0 comments on commit dbeb773

Please sign in to comment.