Jump to content

Talk:Immutable object

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Curvers (talk | contribs) at 11:10, 30 December 2005. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

there is an error: ImmutableCart is immutable only if elements of the list are themselves immutable. Otheriwse, you copy the list allright, but you share the elements with the caller, so he can mutate them as he pleases.

I changed all references to vector in the C++ example to std::vector, as the C++ example would presumably be in a header file and it is generally considered bad style to include a global using namespace directive in a header file. I think it's very important for code examples to exhibit good style even if that makes them a little more verbose. - Zixyer 02:24, 19 December 2005 (UTC)[reply]


why does defensive copying link to object (computer science) which has no information as to what "defensive copying" means probably a mistake, can somebody correct? --Alex 11:10, 30 December 2005 (UTC)[reply]