Re:Why should I have written ZeroMQ in C, not C++ (part II)
by VikingCoder on Thursday August 30, 2012 @03:17PM
(#4456264)
Yeah, I pretty much agree with everything you're saying, but trust me, std::list really does work by copying the items, so your point was not technically correct.
[ Parent
| on HN ]
Re:Why should I have written ZeroMQ in C, not C++ (part II)
by ArbitraryLimits on Thursday August 30, 2012 @03:36PM
(#4456339)
Well, if we're striving for technical correctness, std::list really works by invoking the assingment operator on the items. The original article is strictly correct when it says:
> EDIT: Assume that the object to be contained in the list is non-Assignable as is the case with any non-trivial objects, for example those holding large memory buffers, file descriptors, handles etc. If the object is Assignable simple std::list<person> would do and there is no problem.
Except that normal C++ programmers would deal with that by overriding the assigment operator on this class to copy buffer pointers or whatever as appropriate.
Re:Why should I have written ZeroMQ in C, not C++ (part II)
by rumcajz on Friday August 31, 2012 @01:37AM
(#4458423)
Try copying a complex object with threads running inside it, open file descriptors being used etc. What does it mean, for example, to copy a running DB engine? Some objects are just non-copyable by principle.