# Function argument type that must be comparable

**URL:** <https://discourse.julialang.org/t/function-argument-type-that-must-be-comparable/6643>\
**Category:** General Usage\
**Tags:** question\
**Created:** [October 24, 2017, 2:34am UTC](https://discourse.julialang.org/t/function-argument-type-that-must-be-comparable/6643 "2017-10-24T02:34:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Azzaare](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/azzaare/32/21008_2.png) [@Azzaare](https://discourse.julialang.org/u/Azzaare)\
**Post date:** [October 24, 2017, 2:34am UTC](https://discourse.julialang.org/t/function-argument-type-that-must-be-comparable/6643/1 "2017-10-24T02:34:15Z")

</div>

Is there a way to force the type of an argument in a function to be comparable?

It is not a huge problem as if the isless (or \<) method is not available, it will raise an error. But I would rather enforce the type of the argument to be comparable.

---

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [October 24, 2017, 3:35am UTC](https://discourse.julialang.org/t/function-argument-type-that-must-be-comparable/6643/2 "2017-10-24T03:35:26Z")

</div>

It is impossible to do this in dispatch. You can check it in the function with `applicable` though that’s usually not needed and unreliable.
