Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: generic hash set #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

VictorAssunc
Copy link

I had trouble getting the variadic parameter to work and the simplest solution I found was to change it to receive a slice.

So references like the following will not work:

linkedHashSet := set.NewLinkedHashSet(1, 1, 2, 2, 3, 3)
linkedHashSet.Add(1, 2, 3, 4)
linkedHashSet.Remove(0, 1, 2, 3)

Accepting ideas to work around it

@VictorAssunc VictorAssunc added enhancement New feature or request help wanted Extra attention is needed labels Mar 21, 2022
linkedhashset.go Outdated
import "golang.org/x/exp/constraints"

type Element interface {
constraints.Integer | constraints.Float
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can use constraints.Ordered

@ftcRibeiro
Copy link
Member

A tentativa desse przin deu bom.

A maior diferença foi usar o comparable 🤔. Fiz o pr antes de ver que tu já tinha começado aqui 🥲

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants