C++ Logo

SG10

Advanced search

Subject: Re: [SG10] Digit separators
From: Jens Maurer (Jens.Maurer_at_[hidden])
Date: 2014-03-16 09:47:57


On 03/13/2014 05:57 PM, Nelson, Clark wrote:
> A long-delayed reply:
>
> From: Richard Smith
> Sent: Saturday, February 22, 2014 3:13 PM
>
>> I'm a little concerned about providing a digit separators feature test macro. It seems to encourage people to use digit separators in #ifdef'd code, which doesn't work, so I'm not sure how much value the macro adds.
>
> I agree that there's a problem here. Of course I would say, without
> qualification, that the problem is caused entirely by the syntax selected
> for digit separators.

Well, with a macro, one could do the following:

#ifdef HAS_DIGIT_SEPARATORS
#include "readable_file_with_constants.h"
#else
#include "unreadable_constants.h"
#endif

This should still work, even with the interesting syntax that
digit separators chose to employ.

Thus, I believe we should provide a macro.

Jens


SG10 list run by herb.sutter at gmail.com