Edit2: Guys, sorry but I find it annoying that an answer is marked as duplicate without actually checking if it solves one's problem. The suggested SO answer does not fit the stated problem. 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.
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).
What I ideall would like to have:
int visibilityMask = CreateVisibilityMask(0..12, 16, 22);
So the above would be a variadic function that creates the bit mask, where the .. needs to be overloaded to create a bitmask by itself which would then be OR'ed with the other values.
I guess this one is really tough. But is it impossible?
Edit: Sorry guys, but if you think this answer is a duplicate of the answer you suggested, then please create an example of how the other one could be used according to my needs. The provides answer doesn't allow any combination of a range, and single int values in a variable - if you think it is easy to resolve, please provide.
Note: The original question was about overloading "..", which is not possible. Thanks for clarification on this.