~= call copy ctor?

Namespace rswhite4 at googlemail.com
Fri Jul 20 07:02:18 PDT 2012


> Does:
>
> _arr[0] = Test(0);
>
> avoid the copy construction?
>
> R

[code]
void main() {
	Test[2] _arr = void;

	_arr[0] = Test(0);

	writeln("end main");
}
[/code]

puts

CTOR
DTOR
end main
DTOR
DTOR

If i wrote Test[] instead of Test[2] i get an exception.
There is no dynamic way for that problem? Even with "move" it 
prints "COPY CTOR"...


More information about the Digitalmars-d-learn mailing list