# What is the meaning of Base.Order.ForwardOrdering?

**URL:** <https://discourse.julialang.org/t/what-is-the-meaning-of-base-order-forwardordering/24640>\
**Category:** General Usage\
**Created:** [May 27, 2019, 8:02am UTC](https://discourse.julialang.org/t/what-is-the-meaning-of-base-order-forwardordering/24640 "2019-05-27T08:02:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bsnyh](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Post date:** [May 27, 2019, 8:02am UTC](https://discourse.julialang.org/t/what-is-the-meaning-of-base-order-forwardordering/24640/1 "2019-05-27T08:02:59Z")

</div>

In my task, I need to write code to create a `mutable struct` with name `Si`, which has an attribute with name eventQueue, which is of type `PriorityQueue`. After playing with the code, the following works out well.

```julia
using DataStructures

mutable struct Evnt
     time::Float64
     Evnt() = new(-1.0)
end

mutable struct Si
     eventQueue::PriorityQueue{Evnt, Float64, Base.Order.ForwardOrdering}
     Si() = new()
end

si1 = Si()
e1=Evnt()
enqueue!(pq, e1,e1.time) 
si1.eventQueue = pq

```

My question is, is the above code good enough, i.e., is there a better way to accomplish this? Moreover, what is exactly the meaning of “Base.Order.ForwardOrdering” ? Many thanks.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [May 27, 2019, 8:14am UTC](https://discourse.julialang.org/t/what-is-the-meaning-of-base-order-forwardordering/24640/2 "2019-05-27T08:14:31Z")

</div>

> [@Role of Base.Order](https://discourse.julialang.org/t/role-of-base-order/20661):
>
> I was thinking about submitting a PR to extend findmax & friends to findmax(itr; lt, by, rev) similar to Base.sort!, but I found that the latter has an order argument, which uses constructs defined in the Base.Order module, for which I could not find documentation, but the source indicates that various ordering constructs encapsulate the role of by, lt, and rev in a single comparison. I wonder if someone could clarify the role of Base.Order, and the application of the lt(ord, a, b) form, spec…

> <https://github.com/JuliaLang/julia/pull/22388>
>
> This argument is only used internally and was not supposed to be documented
> (wh…ich was the case in Julia 0.6). Remove it everywhere it is not needed, that
> is in all functions except \`sortperm()\`, for which that argument is used by
> \`sortrows()\` and \`sortcols()\` internally. Remove it for docstrings anyway.
> 
> Also remove the initialized keyword argument to sort(), which had no effect
> and was not documented in Julia 0.6 either.
> 
> \-------------
> Fixes https://github.com/JuliaLang/julia/issues/22382 in the most radical way.
> 
> I must say I don't really understand the role of \`Ordering\` but since @StefanKarpinski said it was supposed to be internal I removed it from all places where it wasn't used. If that's not OK, I can change the PR to remove only the mentions in the docstrings.
> 
> Cc @kshyatt who added mentions of these arguments to the docstrings in https://github.com/JuliaLang/julia/pull/18041, probably to match the actual signature.
