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

Ticket #1190 (new defect)

Opened 2 months ago

Last modified 1 month ago

Error instantiating min/max with single argument

Reported by: Vladimir Assigned to: sean
Priority: blocker Milestone: 0.99.8
Component: Tango Version: trunk
Keywords: math Cc: sean

Description

as was said on IRC, it might be useful for other templates

import tango.math.Math;

void main() {
	min( 10 );
}

fails to compile with

tango\math\Math.d(191): Error: argument int to typeof is not an expression
tango\math\Math.d(191): Error: argument int to typeof is not an expression
tango\math\Math.d(203): template instance tango.math.Math.minmaxtype!(int) error instantiating

Change History

07/14/08 13:03:29 changed by Vladimir

dmd 1.033

07/14/08 14:11:06 changed by mandel

Even if this case may look funny at first, it should be handled more gracefully.

07/16/08 05:41:12 changed by Don Clugston

I want to get min and max out of Math. They DEFINITELY do not belong in there. There's an open ticket for that. Do you have an opinion on where it should go? If we followed C++, where it's in <algorithm>, it would probably go into tango.core.Algorithm. I'd rather put it into the right place, before fixing it!

07/19/08 16:40:37 changed by larsivi

  • cc set to sean.
  • priority changed from normal to blocker.

Upgrading this, must be resolved by next release.

08/03/08 13:19:05 changed by kris

  • owner changed from kris to sean.