Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #322 (closed enhancement: duplicate)

Opened 17 years ago

Last modified 17 years ago

Need support for concrete types in containers

Reported by: sean Assigned to: kris
Priority: major Milestone: 0.97 RC 1
Component: Core Functionality Version:
Keywords: Cc:

Description

This was posted to the forums by Ansible:

It looks like the key in TreeMap?! is required to be able to be null. This means you can't create a map with a numeric key! I got it to compile by creating a container for the double:

class TheKey
{
	this(double aD)
	{
		mD = aD;
	}
	
	bool opCmp(double aD) { return mD < aD; }
	
	double mD;
}

But this is a silly thing to have to do; should I file a ticket on this?

HashMap? has the same problem, and also requires some kind of IReader stuff on the 'myclass' part. Maybe this read/write stuff should be in a HashMap? descendant, so you aren't required to have your class be capable of IReader or whatever.

Change History

03/11/07 19:21:53 changed by larsivi

  • status changed from new to closed.
  • resolution set to duplicate.

Using #323