On Monday, June 11, 2012 02:08:53 Mehrdad wrote: > >> Type deduction. > > > > Exactly. And if they need to be assigned to a static array, > > then the compiler > > can automatically do what it needs to do to avoid the extra > > heap allocation. > > > > - Jonathan M Davis > > "Type deduction"? o.O > I don't understand... could someone give me an example of what > would break if we used the rule I suggested?
Pretty much anything involving templates would break. For instance, auto found = find(arr, [1, 2]); wouldn't compile, because [1, 2] would be considered a static array, which isn't a range. - Jonathan M Davis
