4 ms·
I'm tired of marketing boost as "modern C++". Alexei Alexandrescu, the author of "Modern C++ design" book has since gone on greener pastures and got involved wi
by zvrba 15y ago
I'm tired of marketing boost as "modern C++". Alexei Alexandrescu, the author of "Modern C++ design" book has since gone on greener pastures and got involved with the D language. He participated in the design of D, and wrote a book about it.
Not using shared_ptr a code smell? If you're not able to keep track of your objects yourself, you should not be using C or C++. It's not that hard like you would like us believe.
Also, apart from the cost of maintaining reference counts, shared_ptr makes an extra allocation for the control block. Unless you take care and use make_shared, you end up with allocations that are twice as slow.
On a cynical side: Boost has become Dave Abrahams' business (1) He (and co.) have a vested interest in making you believe that the Boost-way is "the" way of writing "modern" (as defined by HIM and his followers) C++ code. I just wonder whether he had that much foresight, or just took the chance when he saw the opportunity.
(1) I remember once asking about obtaining slides about fusion from a past BoostCon conference and got a blank "no". Slides were available only to the people who paid to attend the conference.
- timr 15y ago"Not using shared_ptr a code smell?" Yes. It's part of the C++ standard. All rants against Dave Abrahams and Boost aside, not using the standard library to do standard things is a code smell.
- zvrba 15y agoWhat "standard things"? shared_ptr is only one of many possible ways to keep track of object lifetimes. Rolling your own reference-counted smart pointer might be a code smell, but not choosing reference counting is far from that.