On Thursday, January 03, 2013 13:34:16 Ali Çehreli wrote:
> On 01/03/2013 07:58 AM, Phil Lavoie wrote:
> > header.c:
> > #define MY_CONST 1
> > ...
> > module.d:
> > enum {
> > MY_CONST = 1
> > }
>
> Further, there is no need for that anonymous scope in D:
>
> enum MY_CONST = 1;
>
> Even further
On 01/03/2013 07:58 AM, Phil Lavoie wrote:
> header.c:
> #define MY_CONST 1
> ...
> module.d:
> enum {
> MY_CONST = 1
> }
Further, there is no need for that anonymous scope in D:
enum MY_CONST = 1;
Even further, I am one of those who reserve all capitals to macros.
Since there are no macr
But if your concern is const variables at module scope being
optimized out of
existence, it is my understanding that they won't be.
All right, thanks for your answer! My concern is indeed const
variable at module scope. I felt like using enums for #define
translations were more appropriate, a
On Thursday, January 03, 2013 16:58:11 Phil Lavoie wrote:
> Hi,
>
> I have a question concerning compiler optimizations and their
> likelihood for const vs. enum declarations.
>
> I came across some code recently that had a bunch of const
> declarations that were extracted from a C header. In thi
Hi,
I have a question concerning compiler optimizations and their
likelihood for const vs. enum declarations.
I came across some code recently that had a bunch of const
declarations that were extracted from a C header. In this very
header, those definitions are in fact #define clauses.
I w