Darren New wrote:
Christopher Smith wrote:
I guess the one pain point would be if you grabbed a std::auto_ptr in your closure,

That's the kind of thing I was thinking about. All of a sudden, it's not RIAA any more, since all the references to what appears to be a stack variable are actually copies of those variables.
I don't know if I would call say it not being RIAA any more, merely that someone has passed ownership to the closure, perhaps unintentionally, which is bad, bad, bad, but normally you'd be using a boost::scoped_ptr which would mean the compiler would beat you like a red-headed step child for doing such a thing.

In general, if you don't want copying, it is wise to make sure the copy operator and copy constructor just don't work. I guess since I have to worry about this kind of thing in C++ well before I start dealing with functors, I tend not to get burned once add them to the mix.
I'm not sure which is worse: all the "don't do that because it hurts" things in C++, or all the "nobody uses that because it's grody" things in Perl. :-)
I often think of Perl as "dynamically typed C++". ;-) I am always profoundly confused by Perl hackers who say "C++ is too baroque and complex", and equally confused by C++ hackers who say the same about Perl. It's like the abyss calling the black hole "black". ;-)

--Chris

--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to