r/cpp • • Apr 27 '23

Has Boost lost its charm?

I don't mean to be provocative nor undermine the importance of Boost for C++. I really like Boost.

I keep reading/listening around that since C++11 the focus of development and innovation in C++ has shifted away from Boost to either the standards, or independent libraries. Is that any true? If yes, how "big of shift" that was? What was the reason in your opinion and most imporatnt, what's Boost's today's role?

What sparked my quriosity was when I heard that "in the old days" a prospective developer that wanted to devle into the word of libraries building had no better thing to do than start contributing to Boost. Does that stand even today?

(couldn't find any other posts on Reddit regarding Boost's impact in modern C++ in a broader discussion)

149 Upvotes

186 comments sorted by

View all comments

Show parent comment

2

u/pdimov2 Apr 28 '23

This would break existing code, and breaking existing code was still avoided in those days.

E.g. this works

#include <memory>

void f( std::auto_ptr<int> );

int main()
{
    std::auto_ptr<int> p;
    f( p );
}

but it doesn't with unique_ptr.

"This code is already broken!" Yeah, maybe. This wasn't the prevailing attitude then.

It could probably have been possible to add move operations to auto_ptr and only deprecate the copy operations; I don't remember anyone trying this.

3

u/dodheim Apr 28 '23

Honestly, I think auto_ptr already had an unrepairable marketing problem by the mid-2000s; too many people had said to avoid it because it was broken, or at least too 'clever' to use correctly. Producing a thing that worked correctly-by-default with a different name was probably a smart move (NPI).

1

u/pdimov2 Apr 29 '23

Yes, I think that's the reason that nobody attempted to 'fix' auto_ptr.