On 11/25/15 12:17 AM, tcak wrote:
On Wednesday, 25 November 2015 at 03:59:01 UTC, Steven Schveighoffer wrote:
On 11/24/15 10:51 PM, tcak wrote:
I have seen a code a while ago, but even by looking at documentation, I
couldn't have found anything about it.
Let's say I have defined an enum;
enum
On Wednesday, 25 November 2015 at 21:26:09 UTC, Meta wrote:
Since when?
A long time, at least with the -w switch turned on when compiling.
On Wednesday, 25 November 2015 at 21:26:09 UTC, Meta wrote:
On Wednesday, 25 November 2015 at 20:47:35 UTC, anonymous wrote:
Use `final switch`. Ordinary `switch`es need an explicit
default case. `final switch`es have to cover all possibilities
individually. Implicit default cases are not allow
On Wednesday, 25 November 2015 at 20:47:35 UTC, anonymous wrote:
Use `final switch`. Ordinary `switch`es need an explicit
default case. `final switch`es have to cover all possibilities
individually. Implicit default cases are not allowed.
Ordinary `switch`es need an explicit default case
Si
On 25.11.2015 21:06, Meta wrote:
...Which doesn't work because it won't compile without a default case.
Is this a recent change? I don't remember D doing this before.
Use `final switch`. Ordinary `switch`es need an explicit default case.
`final switch`es have to cover all possibilities individ
On Wednesday, 25 November 2015 at 20:00:01 UTC, Meta wrote:
One way you could do it:
import std.conv: to;
try
{
switch (userValue.to!Status)
{
...
}
}
catch (ConvException c)
{
//Default case
}
...Which doesn't work because it won't compile without a default
case. Is
On Wednesday, 25 November 2015 at 03:51:48 UTC, tcak wrote:
I have seen a code a while ago, but even by looking at
documentation, I couldn't have found anything about it.
Let's say I have defined an enum;
enum Status: ubyte{
Busy = 1,
Active = 2
}
and received a ubyte value from user.
ubyt
On Wednesday, 25 November 2015 at 03:59:01 UTC, Steven
Schveighoffer wrote:
On 11/24/15 10:51 PM, tcak wrote:
I have seen a code a while ago, but even by looking at
documentation, I
couldn't have found anything about it.
Let's say I have defined an enum;
enum Status: ubyte{
Busy = 1,
Acti
On 11/24/15 10:51 PM, tcak wrote:
I have seen a code a while ago, but even by looking at documentation, I
couldn't have found anything about it.
Let's say I have defined an enum;
enum Status: ubyte{
Busy = 1,
Active = 2
}
and received a ubyte value from user.
ubyte userValue;
I want to s
I have seen a code a while ago, but even by looking at
documentation, I couldn't have found anything about it.
Let's say I have defined an enum;
enum Status: ubyte{
Busy = 1,
Active = 2
}
and received a ubyte value from user.
ubyte userValue;
I want to switch over userValue, but that shoul
10 matches
Mail list logo