ugurcsen / gods-generic

GoDS-Generic (Go Generic Data Structures) - Sets, Lists, Stacks, Maps, Trees, Queues, and much more
https://pkg.go.dev/github.com/ugurcsen/gods-generic
Other
64 stars 6 forks source link

Replace Circular Buffer comparable type with any or similar #10

Open maestre3d opened 8 months ago

maestre3d commented 8 months ago

Is your feature request related to a problem? Please describe. I want to use a circular buffer with a custom struct. Nevertheless, I found myself in a problem as the circular buffer interface requires a comparable type. My struct is not comparable so I can't use this data structure at all.

Describe the solution you'd like I would like that we consider replacing comparable with any or similar to avoid these kind of issues. AFAIK, we don't need comparable for a buffer ring case. At least not for the main functionalities for this data structure.

Describe alternatives you've considered Right now, the only alternative is using the GoDS legacy lib as it uses the interface{} type.

Additional context Add any other context or screenshots about the feature request here.

sleepymole commented 7 months ago

I have a similar thought in https://github.com/emirpasic/gods/issues/243.

sleepymole commented 7 months ago

I have submitted a PR https://github.com/emirpasic/gods/pull/244 to emirpasic/gods.