Re: Defining constant values in struct

2015-06-17 Thread ketmar via Digitalmars-d-learn
On Wed, 17 Jun 2015 09:49:56 +0900, Mike Parker wrote: On 6/17/2015 6:17 AM, tcak wrote: As far as I known, when I define a string with enum and it is used at different parts of code, that string is repeated again and again in executable file instead of passing a pointer to string. So, using

Defining constant values in struct

2015-06-16 Thread tcak via Digitalmars-d-learn
As far as I known, when I define a string with enum and it is used at different parts of code, that string is repeated again and again in executable file instead of passing a pointer to string. So, using enum with string doesn't seem like a good idea. Hence, I defined string as const to make

Re: Defining constant values in struct

2015-06-16 Thread jklp via Digitalmars-d-learn
On Tuesday, 16 June 2015 at 21:17:37 UTC, tcak wrote: As far as I known, when I define a string with enum and it is used at different parts of code, that string is repeated again and again in executable file instead of passing a pointer to string. So, using enum with string doesn't seem like a

Re: Defining constant values in struct

2015-06-16 Thread anonymous via Digitalmars-d-learn
On Tuesday, 16 June 2015 at 21:17:37 UTC, tcak wrote: As far as I known, when I define a string with enum and it is used at different parts of code, that string is repeated again and again in executable file instead of passing a pointer to string. So, using enum with string doesn't seem like a

Re: Defining constant values in struct

2015-06-16 Thread tcak via Digitalmars-d-learn
On Tuesday, 16 June 2015 at 21:38:22 UTC, jklp wrote: On Tuesday, 16 June 2015 at 21:17:37 UTC, tcak wrote: [...] Do i miss a detail in your requirement ? --- struct TableSchema{ const string TABLE = users; struct FieldTypes{ static const string ID = BIGINT;

Re: Defining constant values in struct

2015-06-16 Thread Alex Parrill via Digitalmars-d-learn
On Tuesday, 16 June 2015 at 21:17:37 UTC, tcak wrote: As far as I known, when I define a string with enum and it is used at different parts of code, that string is repeated again and again in executable file instead of passing a pointer to string. So, using enum with string doesn't seem like a

Re: Defining constant values in struct

2015-06-16 Thread Mike Parker via Digitalmars-d-learn
On 6/17/2015 6:17 AM, tcak wrote: As far as I known, when I define a string with enum and it is used at different parts of code, that string is repeated again and again in executable file instead of passing a pointer to string. So, using enum with string doesn't seem like a good idea. The