Passing dynamic arrays

so so at so.do
Mon Nov 8 16:11:46 PST 2010


> I like that explanation. Jonathan is saying the same, I think. I'll
> guess my misunderstanding is mainly caused by figuring out that a
> reassign is happening and that a reassign to a reference changes the
> reference. In C++ you cannot change a reference (I hope I'm right
> here.). When using a std::vector one does not need to think about this.
> What's the general use of a = new A() in the above code? Where is it
> useful?
>
> Jens

Yes in C++, you can't redirect a reference after initialization.
And also can't have a std::vector of references which is mainly by this  
reason.

-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/


More information about the Digitalmars-d mailing list