With DMD 2.053 the second assert of this program fires, is this a DMD bug or
it's me that's missing something?
struct Foo {
int[] data;
this(int n) {
data.length = n;
}
this(this) {
data = data.dup;
}
}
void main() {
Foo f1, f2;
f1 = Foo(1);
f2 =
Since some time the built-in associative arrays don't use search trees to
manage collisions, but just linked lists. So if you want to implement the hash
protocol for a struct do you need to add it a opCmp() too still (that was
needed just for those trees), or is now opEquals() enough (plus toHas
On 7/4/2011 10:39 PM, Daniel Murphy wrote:
"bearophile" wrote in message
news:iut093$1bjg$1...@digitalmars.com...
Daniel Murphy:
Same thing happens with pointers. Reduced:
Pointers to structs in CTFE will work in DMD 2.054 :-)
When they don't crash the compiler, that is.
http://d.puremag
On 2011-07-05 12:10, Ary Manzana wrote:
> On 7/4/11 11:39 PM, Daniel Murphy wrote:
> > "bearophile" wrote in message
> > news:iut093$1bjg$1...@digitalmars.com...
> >
> >> Daniel Murphy:
> >>> Same thing happens with pointers. Reduced:
> >> Pointers to structs in CTFE will work in DMD 2.054 :-)
>
On 7/4/11 11:39 PM, Daniel Murphy wrote:
"bearophile" wrote in message
news:iut093$1bjg$1...@digitalmars.com...
Daniel Murphy:
Same thing happens with pointers. Reduced:
Pointers to structs in CTFE will work in DMD 2.054 :-)
When they don't crash the compiler, that is.
http://d.puremagic
On 2011-07-05 11:29, Trass3r wrote:
> > If you want it to by dynamic all the way, you need to put
> > the dimensions in the parens like above. Personally, I _never_ put them
> > in the brackets, even when the dynamic array has just one dimension.
> > It's just
> > simpler to always put them in the
If you want it to by dynamic all the way, you need to put
the dimensions in the parens like above. Personally, I _never_ put them
in the brackets, even when the dynamic array has just one dimension.
It's just
simpler to always put them in the parens and not worry about it.
Maybe we should f
On 7/5/2011 2:00 AM, Jonathan M Davis wrote:
On 2011-07-04 23:56, Jonathan M Davis wrote:
On 2011-07-04 23:42, Bellum wrote:
Can anyone point me in the right direction for doing something like this
in D:
char[][] anArray;
int rows, cols;
...
anArray = new char[rows][c
On 2011-07-05 18:05, Ali Çehreli wrote:
I don't want to look like brushing off the problem but having many
constructors make the code complicated. For example, it may be confusing
which constructor gets called here:
auto d = DVECTOR2(1.5);
That might be true. I just did what felt most con
On Tue, 05 Jul 2011 16:20:44 +0200, Loopback wrote:
> On 2011-07-05 03:11, Ali Çehreli wrote:
>> struct S
>> {
>> this(T)(double d)
>> {}
>> }
>>
>> void main()
>> {
>> auto o = S(1.5);
>> }
>>
>> Error: template deneme.S.__ctor(T) does not match any function template
>> declaratio
On 2011-07-05 03:11, Ali Çehreli wrote:
On Tue, 05 Jul 2011 02:44:03 +0200, Loopback wrote:
I've researched a bit though I still haven't come up with a solution.
Since the problem lies within (the most simple) constructor, I tried to
modify it for another outcome. If I supplied a generic parame
On Tue, 05 Jul 2011 00:29:14 -0400, Jonathan Sternberg
wrote:
It's one of the applications that consumes command line arguments. So if
I wanted
to implement this, a copy of the D strings (and null terminated) would
have to be
made. I would also likely need to add another slot to the comman
On 01.07.2011 22:18, Ali Çehreli wrote:
On Fri, 01 Jul 2011 21:18:45 +0200, simendsjo wrote:
What is contained within this byte?
(T[0]).sizeof == 0, why isn't void also 0?
void* can point to any data, in which case it is considered to be
pointing at the first byte of the data. Having a size o
Jonathan M Davis Wrote:
> It quickly gets confusing when dealing with dimensions and static arrays IMHO.
I agree. I have raised this topic time ago with no results so far. I find it
surprising that Walter & Andrei too don't think of this as confusing :-|
Bye,
bearophile
On 2011-07-04 23:56, Jonathan M Davis wrote:
> On 2011-07-04 23:42, Bellum wrote:
> > Can anyone point me in the right direction for doing something like this
> >
> > in D:
> > char[][] anArray;
> > int rows, cols;
> >
> > ...
> >
> > anArray = new char[rows][cols];
15 matches
Mail list logo