Given an Expression object in dmd, I'd like to know how many
subexpressions it contains and, even better, iterate over them. I'd
like to do this in a general way, without having to create cases for all
of the different kinds of Expressions. Is there some way to do this
that I've been missing?
Don Wrote:
LMB wrote:
[...]
So, is there any complete example on how to implement reference counting in
D2?
I don't think so. While trying to do it, Bartosz found some severe bugs
in D which made it impossible; they were fixed in the last release.
He's since found bug 3516 might
I've got a problem calling an immutable getter on an ordinary object.
struct A {
float _pole;
float pole() immutable {
return _pole;
}
}
void main() {
A a;
auto x = a.pole; // Ouch!
}
Error: function hello.A.pole () immutable is not callable using argument types
Tomek Sowiñski Wrote:
I've got a problem calling an immutable getter on an ordinary object.
[snip]
Weird: if I reverse the situation -- the object is immutable and function is
ordinary -- I also get an error.
struct A {
float _pole;
float pole() {
return _pole;
}
}
void
Tomek Sowiñski Wrote:
Weird: if I reverse the situation -- the object is immutable and function is
ordinary -- I also get an error.
struct A {
float _pole;
float pole() {
return _pole;
}
}
void main() {
immutable A a;
auto x = a.pole; // Ouch!
}
On Sun, 29 Nov 2009 13:23:07 +0100, Tomek Sowiñski j...@ask.me wrote:
I've got a problem calling an immutable getter on an ordinary object.
struct A {
float _pole;
float pole() immutable {
return _pole;
}
}
void main() {
A a;
auto x = a.pole; // Ouch!
}
Error:
Nick Sabalausky wrote:
Is there an idiom, preferably D1, to detect whether or not the code is
currently executing as a ctfe?
Ie:
void foo()
{
(static?) if( )
{
// Run-time code here
// that does stuff the CTFE engine chokes on
}
else
{
// CTFE
Simen kjaeraas Wrote:
On Sun, 29 Nov 2009 13:23:07 +0100, Tomek Sowiñski j...@ask.me wrote:
I've got a problem calling an immutable getter on an ordinary object.
struct A {
float _pole;
float pole() immutable {
return _pole;
}
}
void main() {
A a;
On Sun, 29 Nov 2009 19:15:19 +0100, Tomek Sowiñski j...@ask.me wrote:
A is not implicitly castable to immutable(A), only to const(A).
I think it is. This compiles:
immutable a = A(3.4);
But only because it's copied.
Not quite. If you try
immutable(A) a;
a = A(3.4);
you should find that it
Qian Xu Wrote:
Hi All,
I am using QtD to do some gui stuff. As the QtD documentation described, Qt-
data types should be declared with keyword scope, so that all variables
can be deallocated in a right order.
I found a memory leak problem accidentally, when I executed the following
10 matches
Mail list logo