improvement request - enabling by-value-containers

Michel Fortin michel.fortin at michelf.com
Tue Dec 14 18:29:58 PST 2010


On 2010-12-14 16:29:18 -0500, Jonathan Schmidt-Dominé 
<devel at the-user.org> said:

> Just about my experiences: When trying to hack some algorithms quickly in
> Ruby I made a lot of mistakes because I had to care about a .clone
> everywhere and because Array.new(5, []) does not work as expected (sorry,
> but Array.new(5) { return [] } is not nice). So in fact C++ made my life
> easier than the new, stylish, simple Ruby-programming-language, because of
> the great by-value-containers in the STL.

I have to echo a similar concern with by-reference containers from my 
experience of Cocoa. It's really too easy to have two references to the 
same container without realizing it. I feel much more secure that my 
logic is correct when I play with C++ containers than with Cocoa's.

-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/



More information about the Digitalmars-d mailing list