I'm not sure about proper understanding of RAII idiom, but should objects in array be automatically constructed during array initialization?

Example.

class ClassPoint {
    int x,y;
}

struct StructPoint {
    int x,y;
}

ClassPoint[8] arr; //static array of null references;
StructPoint[8] arr2;

arr[0].x=1 //error, there is no object
arr2[0].x=1 //OK.

Here I have two questions:

1) Can you have automatically constructed objects with default class constructor? 2) Can you setup memory attributes for static array using core.memory functions, say, to force GC not to scan this portion of memory during collection?

Reply via email to