On Wednesday, 23 November 2016 at 18:58:55 UTC, ketmar wrote:
We can define static array without counting the elements as following:


enum array_ = [1u,2,3,4];
uint[array_.length] static_array = array_;

there are workarounds, of course. yet i'll take mine `uint[$] a = [1u,2,3,4];` over that quoted mess at any time, without second thought. ;-)

I think you may write it (I mean actual D) with using some template like this:

auto array = static_array!uint(1, 2, 3, 4)

Could you please help to write down this template in the best and clear manner?

Reply via email to