# Comparing enums without their associated values

**URL:** <https://forums.swift.org/t/comparing-enums-without-their-associated-values/18944>\
**Category:** Pitches\
**Created:** [December 19, 2018, 6:02pm UTC](https://forums.swift.org/t/comparing-enums-without-their-associated-values/18944 "2018-12-19T18:02:39Z")\
**Posts on this page:** 1\
**Showing post:** 21

<div class="post-metadata">

**Author:** ![alobaili](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@alobaili](https://forums.swift.org/u/alobaili)\
**Post date:** [December 15, 2024, 6:36pm UTC](https://forums.swift.org/t/comparing-enums-without-their-associated-values/18944/21 "2024-12-15T18:36:26Z")

</div>

Another interesting idea is to utilize macros for this. It's already mentioned here:

> [@Comparing enum cases while ignoring associated values](https://forums.swift.org/t/comparing-enum-cases-while-ignoring-associated-values/15922/11):
>
> This might be an interesting use case for a macro, which could generate a nested Cases enum with one case for each case in the outer enum but without the payloads, along with a computed property that maps the payload cases in the outer enums to the corresponding no-payload cases in the inner enum.

I don't have the knowledge to implement a macro that would achieve this, but I'm very interested in using one.

---

_[View the full topic](https://forums.swift.org/t/comparing-enums-without-their-associated-values/18944)._
