# Understanding issorted's lt keyword

**URL:** <https://discourse.julialang.org/t/understanding-issorteds-lt-keyword/60918>\
**Category:** New to Julia\
**Created:** [May 10, 2021, 9:34pm UTC](https://discourse.julialang.org/t/understanding-issorteds-lt-keyword/60918 "2021-05-10T21:34:36Z")\
**Posts on this page:** 1\
**Showing post:** 68

<div class="post-metadata">

**Author:** ![goretkin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goretkin/32/167_2.png) [@goretkin](https://discourse.julialang.org/u/goretkin)\
**Post date:** [May 12, 2021, 6:44pm UTC](https://discourse.julialang.org/t/understanding-issorteds-lt-keyword/60918/68 "2021-05-12T18:44:45Z")

</div>

> [@Oscar\_Smith](#):
>
> The reason for this design is it only relies on users to define `==(a::T,b::T)` and `<(a::T,b::T)` .

That is not correct. All you need is `<` / `isless`. Take for example

```julia
julia> mutable struct Wrap
       _::Int
       end

julia> Base.isless(a::Wrap, b::Wrap) = isless(a._, b._)

julia> Wrap(3) == Wrap(3)
false

julia> issorted(map(Wrap, 1:10))
true

julia> issorted(map(Wrap, [1, 1, 1]))
true

```

---

_[View the full topic](https://discourse.julialang.org/t/understanding-issorteds-lt-keyword/60918)._
