[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Coroutines and Go
- From: Duncan Cross <duncan.cross@...>
- Date: Thu, 12 Nov 2009 14:51:12 +0000
On Thu, Nov 12, 2009 at 12:01 PM, David Given <firstname.lastname@example.org> wrote:
> (...) [When using Go] You can't use structs
> as map keys (I don't know about pointers).
The specification page here:
...says that both pointers and *interfaces* can be used as map key
types. Which I would assume means that a struct can be used as long as
it implements an interface that includes the comparison operators.
This kind of conflicts with the FAQ question that only says that
structs "do not" implement comparison, though:
...so, it's rather confusing.