The following code prints:
/home/c494/c719.d(27): Error: (Vec2!(float) __ctmp1173 =
_D4c71911__T4Vec2TfZ4Vec26__initZ;
, __ctmp1173).this(4F, 2F) is not an lvalue
[code]
import std.stdio;
struct Vec2(T) {
public:
T x;
T y;
this(T x, T y) {
}
Looks like a bug in function overload selection.
On Sunday, 27 January 2013 at 11:42:29 UTC, Dicebot wrote:
Looks like a bug in function overload selection.
I hope not!
That would be really bad. That is part of my solution as long as
auto ref isn't there. :D
On Sunday, 27 January 2013 at 09:49:33 UTC, Philippe Sigaud wrote:
Hi,
If think in your code, your testing whether or a not a
mixin(...)
statement is valid D. Which it is.
But what I'm surprised by is that the behavior of hasDataMember
with my implementation works fine for all test cases
Same with this code: http://dpaste.1azy.net/2c98fe95
But there I found no workaround.
This works: new C(cast(A) new B(), FloatRect(0, 1, 2, 3));
But that is ugly. o.O
I think you are right and it is a bug in function overload
selection. :(
On 01/27/13 12:47, Olivier Grant wrote:
On Sunday, 27 January 2013 at 09:49:33 UTC, Philippe Sigaud wrote:
You cannot write to .init, it's not a member. It's a built-in
property, like .sizeof or .offsetof.
Makes sense.
It does, but apparently the compiler disagrees.
2) Is there a better
I'd put the mixin externally:
template hasDataMember( T, string M )
{
mixin(
enum hasDataMember = __traits(
compiles,
( ref T x, ref T y ){ x. ~ M ~ = y. ~ M ~ ; }
););
}
I've just tried that and it unfortunately does not work, the same
test case still fails.
Ok, I will open a bug report for this.
On Saturday, 26 January 2013 at 20:42:27 UTC, Tyro[17] wrote:
So why do we need to mov RBP, RSP in [2] but not in [1]? I'm
thinking this is because RBP contains the address of args but
not sure.
The x64 calling convention passes the first few arguments via
registers. I think it's most likely
i've grabbed the dmd-master.zip from github an opended the dmd_msc_vs10.sln
but i get 3 errors
C:\Test\dmd-master\src\mars.c wants missing include verstr.h
C:\Test\dmd-master\src\c1xx missing ph.h
C:\Test\dmd-master\src\c1xx missing util.c
what else is needed to build from source this way?
I had the same problem, few days ago.
I wrote this short make script [1] which works for me.
My solution is that you must clean before, call the vs buildme
and then build again with the normal make file.
Sounds weird but it works (for me).
[1] makefile:
set DM_HOME=D:\D
cd dmd
cd src
make
On Saturday, 26 January 2013 at 20:42:27 UTC, Tyro[17] wrote:
Trying to learn from the ground up and would appreciate some
assistance making sense of the following:
// void main(){} [1]
[...]
This might not be directly relevant here, but in general, I'd
steer clear of main() for such
and if i want to use the solution file?
Am 27.01.2013 14:45, schrieb Namespace:
I had the same problem, few days ago.
I wrote this short make script [1] which works for me.
My solution is that you must clean before, call the vs buildme
and then build again with the normal make file.
Sounds
On Saturday, 26 January 2013 at 20:57:54 UTC, Tyro[17] wrote:
On 1/26/13 3:42 PM, Tyro[17] wrote:
The second is the use of leave in [2]. If I understand
correctly, leave
is the exact same as:
movRBP,RSP
popRBP
So why do we need to mov RBP, RSP in [2] but not in [1]?
DO YOU PREFER A LANGUAGE ALL IN UPPERCASE?
Hahahaha! I find it ugly too. I prefer lowercaps null, as in Java.
On Friday, 25 January 2013 at 16:11:57 UTC, Maxim Fomin wrote:
On Friday, 25 January 2013 at 14:22:20 UTC, Don wrote:
On Friday, 25 January 2013 at 01:17:44 UTC, Ali Çehreli wrote:
On 01/24/2013 12:42 PM, Matthew Caron wrote:
for not null checks
if ( ptr !is null) ...
And too much perl
On Sunday, 27 January 2013 at 12:58:39 UTC, Philippe Sigaud wrote:
I'd put the mixin externally:
template hasDataMember( T, string M )
{
mixin(
enum hasDataMember = __traits(
compiles,
( ref T x, ref T y ){ x. ~ M ~ = y. ~ M ~ ; }
););
}
I've just tried that and it
string hasDataMember( T )(string M )
{
return __traits(compiles, {
Test t;
auto _ = t.D; // reading t.M
t. ~ M ~ = t. ~ M ~ ; // assign to t.M
});
}
What is the purpose of auto _ = t.D; ?
Just testing whether t.M can be assigned to something (ie, is it
no match
match with implicit conversions
match with conversion to const
exact match
Explain me, why this code prints:
Error: A() is not an lvalue
[code]
import std.stdio;
struct A { }
void foo(A a, float r) {
}
void foo(const A a, float r) {
}
void foo(ref A a, float r) {
pull request - bug report. I'm a bit confused today.
I remember there being a tutorial on how to build DMD and such from
source. I've been searching for a while and can't find it. It won't
show up on google searches. Does anyone have a link?
Right now I'm most interested in a tutorial on how to build the docs.
Thanks.
On Sun, Jan 27, 2013 at 04:13:08PM -0500, Chad Joan wrote:
I remember there being a tutorial on how to build DMD and such from
source. I've been searching for a while and can't find it. It
won't show up on google searches. Does anyone have a link?
http://wiki.dlang.org/Building_DMD
Right
On 1/27/13 8:57 AM, David Nadlinger wrote:
On Saturday, 26 January 2013 at 20:42:27 UTC, Tyro[17] wrote:
Trying to learn from the ground up and would appreciate some
assistance making sense of the following:
// void main(){} [1]
[...]
This might not be directly relevant here, but in general,
On Sunday, January 27, 2013 12:42:28 Dicebot wrote:
Looks like a bug in function overload selection.
Definitely.
- Jonathan M Davis
On Sunday, 27 January 2013 at 23:05:16 UTC, Jonathan M Davis
wrote:
On Sunday, January 27, 2013 12:42:28 Dicebot wrote:
Looks like a bug in function overload selection.
Definitely.
- Jonathan M Davis
And that prevents a workaround for the missing auto ref. :o)
It seems dmd 2.060 is far
This fails:
void main() {
int z;
typeof((int a){return z;}) dg;
dg = (int a) {return z;};
}
Error: cannot implicitly convert expression (__lambda2) of type
int delegate(int a) nothrow @safe to int delegate(int a) pure
nothrow @safe
But I can't make the delegate pure:
dg = (int
On 01/27/2013 04:34 PM, H. S. Teoh wrote:
On Sun, Jan 27, 2013 at 04:13:08PM -0500, Chad Joan wrote:
I remember there being a tutorial on how to build DMD and such from
source. I've been searching for a while and can't find it. It
won't show up on google searches. Does anyone have a link?
27 matches
Mail list logo