Chris
Chris
This feature would be great, thanks :)
Tried something like this: ```mojo struct Bucket[T: CollectionElement]: var elements: List[T] fn __init__(inout self, elements: List[T]): self.elements = elements @staticmethod fn __contains__[C: ComparableCollectionElement](self: Bucket[C], borrowed elem: C) -> Bool: for...
Is there something similar to c++ `enable_if` that i'm missing? https://en.cppreference.com/w/cpp/types/enable_if
Or if we don't use a special method: ```mojo struct Bucket[T: CollectionElement]: var elements: List[T] fn __init__(inout self, elements: List[T]): self.elements = elements @staticmethod fn contains[C: ComparableCollectionElement](self: Bucket[C], value: C)...
Hey @rd4com and @laszlokindrat, not quite `Tuple` or `ListLiteral`, I've picked `InlineList` just as a starting point for me to get used to the codebase :) If available would you...
@rd4com I discovered that this test fails for `List` when testing `InlineList`: ```mojo def test_list_contains_str(): var x = List[String]("a", "b", "c") assert_false("d" in x) assert_true(x.__contains__("a")) assert_false(x.__contains__("e")) ``` ``` constraint failed:...