version: multiple conditions

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Tue Jun 16 20:05:08 PDT 2015


On 6/16/2015 6:06 PM, Daniel Murphy wrote:
> "Walter Bright"  wrote in message news:mlorvv$1nb6$1 at digitalmars.com...
>
>> On 6/14/2015 9:53 AM, bitwise wrote:
>> > What if I need AndroidOrWP8, and I
>> > also need Win32OrWin64? This can quickly become a much larger pita.
>>
>> If you need those, the design is wrong. It is better to think about what the
>> code is trying to do with Android or WP8, and label *that* a version.
>
> This works well until the code that needs to be versioned is split over many
> source files, and now each one needs to duplicate the version setting code.

If this is resulting, you're doing it wrong.

Abstract the concept into a template or function, and put that in a separate module.

(Much like how Port:: works.)


More information about the Digitalmars-d mailing list