Foreword: I find it annoying that an answer is marked as duplicate without actually checking if it solves one's problem. I've asked this question before, but didn't succeed. In particular, this question is not answered by Implementing Matlab's colon : operator in C++ expression templates class. It is fixed number of variables vs. variable number of variables + variable combination of ranges of integers and integer values. If you still think the right direction, then please provide a valid solution to my stated problem or just don't mark it simply as duplicate if you can't do so.
=> Please check back if it's answering my question, before you just hit that duplicate button. Thanks.
I'm trying to find the most elegant way to define a bitmask. This bitmask is an integer, and it defines the visibility of objects on a map (32 levels, so bits 0..31 define visibility on each of the 32 levels). The bitmaks creation helper should be able to handle a variable length list of integers, as well as integer ranges - AND any combination of these.
E.g. it could then look like:
int visibilityMask = CreateVisibilityMask([1..12], 16, 22);
I guess this one is really tough. But is it impossible?