enum
{
a = "foo",
b = "bar",
c = "baz";
}
is identical to
enum a = "foo";
enum b = "bar";
enum c = "baz";
Thanks Jonathan I think that changes my point of perspective.
And Jacob Carlborg I like the third option a lot with aliases
good to know that
enum Foo : string
{
KErde
On 2017-12-17 20:45, Jonathan M Davis wrote:
That's pretty much just declaring manifest constants with braces so that you
don't repeat the keyword enum a bunch of times.
Anonymous enum is what the spec calls it and was available before
manifest constants.
--
/Jacob Carlborg
On Sunday, December 17, 2017 12:47:26 kerdemdemir via Digitalmars-d-learn
wrote:
> What I meant with anonymous enums was:
> https://dlang.org/spec/enum.html#anonymous_enums. Maybe I
> couldn't explain well but I believe D have anonymous enums. I am
> sorry I have forgotten to remove " :string" in
On 2017-12-17 12:49, kerdemdemir wrote:
I have an enum statement :
enum : string
{
KErdem
Ali
Zafer
Salih
//etc...
}
I don't want to give a name to my enum class since I am accessing this
variables very often.
But I also have a function like:
double ReturnCoolNess(
What I meant with anonymous enums was:
https://dlang.org/spec/enum.html#anonymous_enums. Maybe I
couldn't explain well but I believe D have anonymous enums. I am
sorry I have forgotten to remove " :string" in my example from
the "enum : string". Please stretch out ": string" part my
problem is
On Sunday, December 17, 2017 11:49:58 kerdemdemir via Digitalmars-d-learn
wrote:
> I have an enum statement :
>
> enum : string
> {
> KErdem
> Ali
> Zafer
> Salih
> //etc...
> }
>
>
> I don't want to give a name to my enum class since I am accessing
> this variables very o
I have an enum statement :
enum : string
{
KErdem
Ali
Zafer
Salih
//etc...
}
I don't want to give a name to my enum class since I am accessing
this variables very often.
But I also have a function like:
double ReturnCoolNess( /* Is there any way? */ enumVal )
{
switch