diff dmd/TemplateDeclaration.d @ 94:3a0b150c9841

Objects -> Vector!Object iteration 1
author Eldar Insafutdinov <e.insafutdinov@gmail.com>
date Mon, 30 Aug 2010 23:00:34 +0100
parents 39648eb578f6
children a1cf34da9ebe
line wrap: on
line diff
--- a/dmd/TemplateDeclaration.d	Mon Aug 30 22:50:30 2010 +0200
+++ b/dmd/TemplateDeclaration.d	Mon Aug 30 23:00:34 2010 +0100
@@ -597,9 +597,9 @@
 		{
 			TemplateParameter tp = cast(TemplateParameter)parameters.data[i];
 
-			void* p = tp.dummyArg();
+			auto p = tp.dummyArg();
 			if (p)
-				ti.tiargs.data[i] = p;
+				ti.tiargs[i] = p;
 			else
 				ti.tiargs.setDim(i);
 		}
@@ -710,15 +710,15 @@
 				/* The extra initial template arguments
 				 * now form the tuple argument.
 				 */
-				Tuple t = new Tuple();
+				auto t = new Tuple();
 				assert(parameters.dim);
-				dedargs.data[parameters.dim - 1] = cast(void*)t;
+				dedargs[parameters.dim - 1] = t;
 
 				tuple_dim = nargsi - n;
 				t.objects.setDim(tuple_dim);
 				for (size_t i = 0; i < tuple_dim; i++)
 				{
-					t.objects.data[i] = cast(void*)targsi.data[n + i];
+					t.objects[i] = targsi[n + i];
 				}
 				declareParameter(paramscope, tp, t);
 			}
@@ -785,9 +785,9 @@
 		{
 			if (nfparams == 0 && nfargs != 0)		// if no function parameters
 			{
-				Tuple t = new Tuple();
+				auto t = new Tuple();
 				//printf("t = %p\n", t);
-				dedargs.data[parameters.dim - 1] = cast(void*)t;
+				dedargs[parameters.dim - 1] = t;
 				declareParameter(paramscope, tp, t);
 				goto L2;
 			}
@@ -815,15 +815,15 @@
 					/* The types of the function arguments
 					 * now form the tuple argument.
 					 */
-					Tuple t = new Tuple();
-					dedargs.data[parameters.dim - 1] = cast(void*)t;
+					auto t = new Tuple();
+					dedargs[parameters.dim - 1] = t;
 
 					tuple_dim = nfargs - (nfparams - 1);
 					t.objects.setDim(tuple_dim);
 					for (size_t i = 0; i < tuple_dim; i++)
 					{   
 						auto farg = fargs[fptupindex + i];
-						t.objects.data[i] = cast(void*)farg.type;
+						t.objects[i] = farg.type;
 					}
 					declareParameter(paramscope, tp, t);
 					goto L2;
@@ -1038,14 +1038,14 @@
 						 * the oded == oarg
 						 */
 						Declaration sparam;
-						dedargs.data[i] = cast(void*)oded;
+						dedargs[i] = oded;
 						MATCH m2 = tp2.matchArg(paramscope, dedargs, i, parameters, dedtypes, &sparam, 0);
 						//printf("m2 = %d\n", m2);
 						if (!m2)
 							goto Lnomatch;
 						if (m2 < match)
 							match = m2;		// pick worst match
-						if (dedtypes.data[i] !is cast(void*)oded)
+						if (dedtypes[i] !is oded)
 							error("specialization not allowed for deduced parameter %s", tp2.ident.toChars());
 					}
 				}
@@ -1056,7 +1056,7 @@
 						goto Lnomatch;
 				}
 				declareParameter(paramscope, tp2, oded);
-				dedargs.data[i] = cast(void*)oded;
+				dedargs[i] = oded;
 			}
 		}