On 01/18/2016 04:38 PM, Adam D. Ruppe wrote:
On Tuesday, 19 January 2016 at 00:33:21 UTC, Johan Engelen wrote:
Is it possible to do conditional compilation inside an array initializer?
No, but you might break it up:
enum inttable_1 = [1,4];
version(smth)
enum inttable_middle = [5,6
On Tuesday, 19 January 2016 at 00:33:21 UTC, Johan Engelen wrote:
Is it possible to do conditional compilation inside an array
initializer?
No, but you might break it up:
enum inttable_1 = [1,4];
version(smth)
enum inttable_middle = [5,6];
else
enum inttable_middle = [];
enum
Is it possible to do conditional compilation inside an array
initializer? Something like this:
int[] inttable =
[
1,
4,
version(smth) { // <--- does not compile
5,
6,
}
8,
1345
];
(real world case:
https://github.com/ldc-developers/ldc/blob/merge-2.069/ddmd/idgen.d#L