is pointer

bearophile bearophileHUGS at
Fri Mar 19 19:11:55 PDT 2010

Moritz Warning:
>I think the problem is that is(T : T*) becomes is(int* : int**) and that's false.<

Thank you, you can be right.
So D docs are wrong, or that syntax has a semantic bug, or I have not understood the situation yet.
If someone else has ideas I'm all ears.


Ellery Newcomer:
> Curious behavior DArrays exhibit:

Thankfully this doesn't compile:

import std.stdio: writeln;
import std.c.stdlib: calloc;

struct Array {
    int* ptr;
    size_t length;

void main() {
    enum size_t N = 5;
    int* p = cast(int*)calloc(N, int.sizeof);
    Array a = Array(p, N);

This solves the second question, I'll file it as a bug or specs bug. Thank you.


More information about the Digitalmars-d-learn mailing list