www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ide - std.algorithm.iteration.aggregate function does not work in Visual

I tried to compile this code in Visual D v0.3.41 beta 1:

-----
import std.typecons : tuple;
import std.algorithm.iteration : aggregate;
import std.algorithm.comparison : equal, max, min;

void main() {

	auto data = [[4, 2, 1, 3], [4, 9, -1, 3, 2], [3]];

	// Single aggregating function
	auto agg1 = data.aggregate!max; // not working
	assert(agg1.equal([4, 9, 3]));

	// Multiple aggregating functions
	auto agg2 = data.aggregate!(max, min); // not working
	assert(agg2.equal([
		tuple(4, 1),
		tuple(9, -1),
		tuple(3, 3)
	]));
}
-----

Build Log

Building Debug\yes.exe

Command Line

set PATH=C:\D\dmd2\windows\bin\\windows\bin;C:\Program Files 
(x86)\Microsoft Visual Studio 14.0\\Common7\IDE;C:\Program Files 
(x86)\Windows Kits\8.1\\bin;%PATH%
set DMD_LIB=C:\DMC\dm\lib
C:\D\dmd2\windows\bin\dmd.exe -g -O -unittest -debug -X 
-Xf"Debug\yes.json" -deps="Debug\yes.dep" -c -of"Debug\yes.obj" 
main.d
if errorlevel 1 goto reportError

set LIB="C:\D\dmd2\windows\bin\..\lib"
echo. > 
C:\Users\REiS\DOCUME~1\VISUAL~2\Projects\yes\yes\Debug\yes.build.lnkarg
echo 
"Debug\yes.obj","Debug\yes.exe_cv","Debug\yes.map",user32.lib+ >> 
C:\Users\REiS\DOCUME~1\VISUAL~2\Projects\yes\yes\Debug\yes.build.lnkarg
echo kernel32.lib+ >> 
C:\Users\REiS\DOCUME~1\VISUAL~2\Projects\yes\yes\Debug\yes.build.lnkarg
echo C:\DMC\dm\lib\/NOMAP/CO/NOI/DELEXE /SUBSYSTEM:CONSOLE >> 
C:\Users\REiS\DOCUME~1\VISUAL~2\Projects\yes\yes\Debug\yes.build.lnkarg

"C:\Program Files (x86)\VisualD\pipedmd.exe" -deps 
Debug\yes.lnkdep C:\D\dmd2\windows\bin\link.exe 
 C:\Users\REiS\DOCUME~1\VISUAL~2\Projects\yes\yes\Debug\yes.build.lnkarg
if errorlevel 1 goto reportError
if not exist "Debug\yes.exe_cv" (echo "Debug\yes.exe_cv" not 
created! && goto reportError)
echo Converting debug information...
"C:\Program Files (x86)\VisualD\cv2pdb\cv2pdb.exe" 
"Debug\yes.exe_cv" "Debug\yes.exe"
if errorlevel 1 goto reportError
if not exist "Debug\yes.exe" (echo "Debug\yes.exe" not created! 
&& goto reportError)

goto noError

:reportError
echo Building Debug\yes.exe failed!

:noError
Output

C:\D\dmd2\windows\bin\..\..\src\phobos\std\algorithm\iteration.d(101): 
Error: template instance aggregate!(max) does not match template 
declaration aggregate(RoR)(RoR ror) if (isInputRange!RoR && 
isIterable!(ElementType!RoR))
C:\D\dmd2\windows\bin\..\..\src\phobos\std\algorithm\iteration.d(106): 
Error: template instance aggregate!(max, min) does not match 
template declaration aggregate(RoR)(RoR ror) if (isInputRange!RoR 
&& isIterable!(ElementType!RoR))
main.d(10): Error: template instance 
std.algorithm.iteration.aggregate!(max) error instantiating
C:\D\dmd2\windows\bin\..\..\src\phobos\std\algorithm\iteration.d(101): 
Error: template instance aggregate!(max) does not match template 
declaration aggregate(RoR)(RoR ror) if (isInputRange!RoR && 
isIterable!(ElementType!RoR))
C:\D\dmd2\windows\bin\..\..\src\phobos\std\algorithm\iteration.d(106): 
Error: template instance aggregate!(max, min) does not match 
template declaration aggregate(RoR)(RoR ror) if (isInputRange!RoR 
&& isIterable!(ElementType!RoR))
main.d(14): Error: template instance 
std.algorithm.iteration.aggregate!(max, min) error instantiating
Building Debug\yes.exe failed!
Apr 01 2015