On Wednesday, June 24, 2020 at 3:55:07 PM UTC-7 Ian Lance Taylor wrote:
> On Wed, Jun 24, 2020 at 3:47 PM i3dmaster wrote:
> >
> > On Wednesday, June 24, 2020 at 3:02:43 PM UTC-7, Ian Lance Taylor wrote:
> >>
> >> The current generics design draft doesn't support the kind of
> >> constrain
On Wed, Jun 24, 2020 at 3:47 PM i3dmaster wrote:
>
> On Wednesday, June 24, 2020 at 3:02:43 PM UTC-7, Ian Lance Taylor wrote:
>>
>> The current generics design draft doesn't support the kind of
>> constraints you are looking for.
>
>
> Is there or will there be a plan? Using generic types with [],
On Wednesday, June 24, 2020 at 3:02:43 PM UTC-7, Ian Lance Taylor wrote:
>
> On Wed, Jun 24, 2020 at 2:33 PM i3dmaster >
> wrote:
> >
> > example:
> >
> > type Key interface {
> > type comparable, fmt.Stringer
> > }
> >
> > type Value interface {
> > type interface{}, copyable
On Wed, Jun 24, 2020 at 2:33 PM i3dmaster wrote:
>
> example:
>
> type Key interface {
> type comparable, fmt.Stringer
> }
>
> type Value interface {
> type interface{}, copyable
> }
>
> type Container(type K Key, V Value) interface {
>Add(K, V) bool
> }
>
> type HashMap(type K Key, V
example:
type Key interface {
type comparable, fmt.Stringer
}
type Value interface {
type interface{}, copyable
}
type Container(type K Key, V Value) interface {
Add(K, V) bool
}
type HashMap(type K Key, V Value) struct{ m map[K]V }
func (h *HashMap(K,V)) Add(k K, v V) bool {
h.