Skip to content

Commit

Permalink
fix: queue methods
Browse files Browse the repository at this point in the history
  • Loading branch information
PraneethJain authored and barche committed Jun 19, 2024
1 parent 20eaeb7 commit 9029b2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions include/jlcxx/stl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ struct WrapQueueImpl

wrapped.module().set_override_module(StlWrappers::instance().module());
wrapped.method("cppsize", &WrappedT::size);
wrapped.method("q_empty", [] (WrappedT& v) { return v.empty(); });
wrapped.method("push_back!", [] (WrappedT& v, const T& val) { v.push(val); });
wrapped.method("front", [] (WrappedT& v) { return v.front(); });
wrapped.method("pop_front!", [] (WrappedT& v) { v.pop(); });
Expand All @@ -238,6 +239,7 @@ struct WrapQueueImpl<bool>

wrapped.module().set_override_module(StlWrappers::instance().module());
wrapped.method("cppsize", &WrappedT::size);
wrapped.method("q_empty", [] (WrappedT& v) { return v.empty(); });
wrapped.method("push_back!", [] (WrappedT& v, const bool val) { v.push(val); });
wrapped.method("front", [] (WrappedT& v) -> bool { return v.front(); });
wrapped.method("pop_front!", [] (WrappedT& v) { v.pop(); });
Expand Down
3 changes: 2 additions & 1 deletion src/stl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ JLCXX_API StlWrappers::StlWrappers(Module& stl) :
vector(stl.add_type<Parametric<TypeVar<1>>>("StdVector", julia_type("AbstractVector"))),
valarray(stl.add_type<Parametric<TypeVar<1>>>("StdValArray", julia_type("AbstractVector"))),
deque(stl.add_type<Parametric<TypeVar<1>>>("StdDeque", julia_type("AbstractVector"))),
queue(stl.add_type<Parametric<TypeVar<1>>>("StdQueue", julia_type("AbstractVector"))),
// Assign appropriate parent types after iterators are implemented
queue(stl.add_type<Parametric<TypeVar<1>>>("StdQueue")),
priority_queue(stl.add_type<Parametric<TypeVar<1>>>("StdPriorityQueue")),
set(stl.add_type<Parametric<TypeVar<1>>>("StdSet")),
multiset(stl.add_type<Parametric<TypeVar<1>>>("StdMultiset")),
Expand Down

0 comments on commit 9029b2c

Please sign in to comment.