hi there, please read this code:
import std.stdio;
struct test(T)
{
alias typeof(*this) type;
T a;
}
void main()
{
test!(int).type t;
t.a = 123;
writeln(t.a);
}
I guessed it would work. but the compiler said:
main.d(7): Error: can only * a pointer, not a 'test!(int)'
main.d(14): Error:
choi heejo wrote:
hi there, please read this code:
import std.stdio;
struct test(T)
{
alias typeof(*this) type;
T a;
}
void main()
{
test!(int).type t;
t.a = 123;
writeln(t.a);
}
I guessed it would work. but the compiler said:
main.d(7): Error: can only *
Jacob Carlborg wrote:
On 2010-09-10 16:53, Pelle wrote:
On 09/10/2010 03:20 PM, Jacob Carlborg wrote:
On 2010-09-07 22:32, Don wrote:
Jacob Carlborg wrote:
On 2010-09-07 17:29, Don wrote:
Jacob Carlborg wrote:
I'm reading http://www.digitalmars.com/d/2.0/declaration.html#Typeof
where it
On 2010-09-10 16:53, Pelle wrote:
On 09/10/2010 03:20 PM, Jacob Carlborg wrote:
On 2010-09-07 22:32, Don wrote:
Jacob Carlborg wrote:
On 2010-09-07 17:29, Don wrote:
Jacob Carlborg wrote:
I'm reading http://www.digitalmars.com/d/2.0/declaration.html#Typeof
where it says:
typeof(this) will
On 2010-09-07 22:32, Don wrote:
Jacob Carlborg wrote:
On 2010-09-07 17:29, Don wrote:
Jacob Carlborg wrote:
I'm reading http://www.digitalmars.com/d/2.0/declaration.html#Typeof
where it says:
typeof(this) will generate the type of what this would be in a
non-static member function, even if
On 09/10/2010 03:20 PM, Jacob Carlborg wrote:
On 2010-09-07 22:32, Don wrote:
Jacob Carlborg wrote:
On 2010-09-07 17:29, Don wrote:
Jacob Carlborg wrote:
I'm reading http://www.digitalmars.com/d/2.0/declaration.html#Typeof
where it says:
typeof(this) will generate the type of what this
I'm reading http://www.digitalmars.com/d/2.0/declaration.html#Typeof
where it says:
typeof(this) will generate the type of what this would be in a
non-static member function, even if not in a member function.
From that I got the impression that the code below would print the same
result,
Jacob Carlborg wrote:
I'm reading http://www.digitalmars.com/d/2.0/declaration.html#Typeof
where it says:
typeof(this) will generate the type of what this would be in a
non-static member function, even if not in a member function.
From that I got the impression that the code below would
07.09.2010 17:00, Jacob Carlborg пишет:
I'm reading http://www.digitalmars.com/d/2.0/declaration.html#Typeof
where it says:
typeof(this) will generate the type of what this would be in a
non-static member function, even if not in a member function.
From that I got the impression that the
On 2010-09-07 17:29, Don wrote:
Jacob Carlborg wrote:
I'm reading http://www.digitalmars.com/d/2.0/declaration.html#Typeof
where it says:
typeof(this) will generate the type of what this would be in a
non-static member function, even if not in a member function.
From that I got the
On 2010-09-07 17:34, Stanislav Blinov wrote:
07.09.2010 17:00, Jacob Carlborg пишет:
I'm reading http://www.digitalmars.com/d/2.0/declaration.html#Typeof
where it says:
typeof(this) will generate the type of what this would be in a
non-static member function, even if not in a member function.
Jacob Carlborg wrote:
On 2010-09-07 17:29, Don wrote:
Jacob Carlborg wrote:
I'm reading http://www.digitalmars.com/d/2.0/declaration.html#Typeof
where it says:
typeof(this) will generate the type of what this would be in a
non-static member function, even if not in a member function.
From
12 matches
Mail list logo