opConcatAll?

Steven Schveighoffer schveiguy at gmail.com
Thu Jul 2 18:40:21 UTC 2020


On 7/2/20 12:20 PM, jmh530 wrote:
> On Thursday, 2 July 2020 at 15:47:39 UTC, Steven Schveighoffer wrote:
>> If I have an array:
>>
>> int[] arr = [1, 2, 3];
>>
>> And I use it in a concatenation chain:
>>
>> auto newArr = [0] ~ arr ~ [4, 5, 6];
>>
>> [snip]
> 
> With a few small changes, you could just as easily have written
> 
> int[] newArr;
> newArr[] = [0, 0, 0] + arr[] + [4, 5, 6];
> 
> which is similar to the traditional type of problem that expression 
> templates were designed to solve.

Hm.. I think you misunderstand the example.

-Steve



More information about the Digitalmars-d mailing list