C++ a výjimka v destruktoru

JSH

Re:C++ a výjimka v destruktoru
« Odpověď #195 kdy: 14. 02. 2014, 23:23:44 »
Díky za opravu. Ještě že jsem to zatím nemusel použít. Bohatě mi stačí pasti kolem automatických konverzí, pořadí vedlejších efektů a nedefinovaných operací.


Mr. Curious

Re:C++ a výjimka v destruktoru
« Odpověď #196 kdy: 24. 02. 2014, 15:55:24 »
Z jineho soudku, ale podobneho testa - https://www.imperialviolet.org/2014/02/22/applebug.html

Mr. Curious

Re:C++ a výjimka v destruktoru
« Odpověď #197 kdy: 21. 03. 2014, 09:45:12 »
Why should I have written ZeroMQ in C, not C++ (part I)

Just to be clear from the very beginning: This is not going to be a Torvalds-ish rant against C++ from the point of view of die-hard C programmer.

I've been using C++ whole my professional career and it's still my language of choice when doing most projects.

Naturally, when I started ZeroMQ project back in 2007, I've opted for C++. The main reasons were:

Library of data structures and algorithms (STL) is part of the language. With C I would have to either depend on a 3rd party library or had to write basic algorithms of my own in 1970's manner.
C++ enforces some basic consistency in the coding style. For example, having the implicit 'this' parameter doesn't allow to pass pointer to the object being worked on using several disparate mechanisms as it often happens to be the case with C projects. Same applies to explicit marking of member variables as private and many other features of the language.
This point is actually a subset of the previous one, but it's worth of explicit mention: Implementing virtual functions in C is pretty complex and tends to be slightly different for each class which makes understanding and managing the code a pain.
And finally: Everybody loves destructors being invoked automatically at the end of the block.

http://250bpm.com/blog:4

Mr. Pointless

Re:C++ a výjimka v destruktoru
« Odpověď #198 kdy: 03. 05. 2014, 03:43:32 »