On 15/11/2011 22:56, bearophile wrote:
Johannes Totz:
class EnumType
{
int x;
alias x this;
this(int i)
{
x = i;
}
void opCall(int i)
{
}
}
enum X : EnumType
{
a = EnumType(1),
b = 2
}
Error
Johannes Totz:
> class EnumType
> {
> int x;
> alias x this;
>
> this(int i)
> {
> x = i;
> }
>
> void opCall(int i)
> {
> }
> }
>
> enum X : EnumType
> {
> a = EnumType(1),
> b = 2
> }
>
>
> Errors range are always
On 15/11/2011 20:37, Mike Wey wrote:
On 11/14/2011 11:25 PM, Johannes Totz wrote:
Hi!
I'm having trouble with named typed enums.
This works (unnamed):
enum : string
{
a = "a",
b = "b"
}
int main(string[] argv)
{
writeln(a);
return 0;
}
But this does not:
enum X : string
{
a = "a", // Error
On 11/14/2011 11:25 PM, Johannes Totz wrote:
Hi!
I'm having trouble with named typed enums.
This works (unnamed):
enum : string
{
a = "a",
b = "b"
}
int main(string[] argv)
{
writeln(a);
return 0;
}
But this does not:
enum X : string
{
a = "a", // Error: Integer constant expression expected
On 15/11/2011 16:30, Steven Schveighoffer wrote:
On Tue, 15 Nov 2011 11:15:01 -0500, Johannes Totz wrote:
On 15/11/2011 15:56, Steven Schveighoffer wrote:
On Tue, 15 Nov 2011 10:55:44 -0500, Steven Schveighoffer
wrote:
On Tue, 15 Nov 2011 10:47:22 -0500, Johannes Totz
wrote:
Ah, when I c
On Tue, 15 Nov 2011 11:15:01 -0500, Johannes Totz wrote:
On 15/11/2011 15:56, Steven Schveighoffer wrote:
On Tue, 15 Nov 2011 10:55:44 -0500, Steven Schveighoffer
wrote:
On Tue, 15 Nov 2011 10:47:22 -0500, Johannes Totz
wrote:
Ah, when I compile on the command line with:
dmd -g -debug ma
On 15/11/2011 15:56, Steven Schveighoffer wrote:
On Tue, 15 Nov 2011 10:55:44 -0500, Steven Schveighoffer
wrote:
On Tue, 15 Nov 2011 10:47:22 -0500, Johannes Totz
wrote:
Ah, when I compile on the command line with:
dmd -g -debug main.d
main.d(6): Error: enum main.X base type must be of int
On Tue, 15 Nov 2011 10:47:22 -0500, Johannes Totz wrote:
On 15/11/2011 15:43, Johannes Totz wrote:
On 14/11/2011 22:32, Timon Gehr wrote:
On 11/14/2011 11:25 PM, Johannes Totz wrote:
Hi!
I'm having trouble with named typed enums.
This works (unnamed):
enum : string
{
a = "a",
b = "b"
}
in
On Tue, 15 Nov 2011 10:55:44 -0500, Steven Schveighoffer
wrote:
On Tue, 15 Nov 2011 10:47:22 -0500, Johannes Totz
wrote:
Ah, when I compile on the command line with:
dmd -g -debug main.d
main.d(6): Error: enum main.X base type must be of integral type, not
char[]
main.d(8): Error: cann
On 15/11/2011 15:43, Johannes Totz wrote:
On 14/11/2011 22:32, Timon Gehr wrote:
On 11/14/2011 11:25 PM, Johannes Totz wrote:
Hi!
I'm having trouble with named typed enums.
This works (unnamed):
enum : string
{
a = "a",
b = "b"
}
int main(string[] argv)
{
writeln(a);
return 0;
}
But this d
On 14/11/2011 22:32, Timon Gehr wrote:
On 11/14/2011 11:25 PM, Johannes Totz wrote:
Hi!
I'm having trouble with named typed enums.
This works (unnamed):
enum : string
{
a = "a",
b = "b"
}
int main(string[] argv)
{
writeln(a);
return 0;
}
But this does not:
enum X : string
{
a = "a", // Err
On 11/14/2011 11:25 PM, Johannes Totz wrote:
Hi!
I'm having trouble with named typed enums.
This works (unnamed):
enum : string
{
a = "a",
b = "b"
}
int main(string[] argv)
{
writeln(a);
return 0;
}
But this does not:
enum X : string
{
a = "a", // Error: Integer constan
t expression expec
Hi!
I'm having trouble with named typed enums.
This works (unnamed):
enum : string
{
a = "a",
b = "b"
}
int main(string[] argv)
{
writeln(a);
return 0;
}
But this does not:
enum X : string
{
a = "a", // Error: Integer constant expression expected
// instead of "a"
b
13 matches
Mail list logo