Re: std.socket.Address not allowed in tuples

2019-01-23 Thread Neia Neutuladh via Digitalmars-d-learn
On Thu, 24 Jan 2019 01:35:57 +, Steven O wrote: > Is there any documentation or examples of how to do that? The > RedBlackTree documentation gives trivial examples like You define a function implementing the "less" operation for a pair of Tuple!(Address, int) (or whatever you have). ---

Re: std.socket.Address not allowed in tuples

2019-01-23 Thread Steven O via Digitalmars-d-learn
On Wednesday, 23 January 2019 at 16:30:33 UTC, Neia Neutuladh wrote: As always, it helps a lot to post the error message the compiler gave you. Sorry about that. The issue is that Address doesn't have a comparison operator defined, so the resulting tuple type can't be compared with the

Re: std.socket.Address not allowed in tuples

2019-01-23 Thread Neia Neutuladh via Digitalmars-d-learn
On Wed, 23 Jan 2019 15:56:15 +, Steven O wrote: > Why am I not allowed to put Address types in tuples? As always, it helps a lot to post the error message the compiler gave you. The message is: /usr/include/dmd/phobos/std/functional.d-mixin-215(215): Error: template

std.socket.Address not allowed in tuples

2019-01-23 Thread Steven O via Digitalmars-d-learn
Can anyone please explain to me what's going on here? import std.container; import std.socket; import std.typecons; void main() { /* Doesn't work alias Rec_type = Tuple!(Address, "x", int, "y", int, "z"); RedBlackTree!Rec_type[] records; */ // Works alias Rec_type =