On Friday, April 13, 2018, Chris Glover wrote:
There are of course other reasons for choosing the boost variant over the std variant, even outside of boost. Four that often influence me are:
- Boost often offers an extended API
- Boost components can be forward declared
- Boost offers the same implementation across platforms
- I can fix a boost version should I need to
My projects tend to reach for boost over std for most components as a result of this.
-- chris
Additionally, speaking specifically about boost::shared_ptr here:
1. Reasons some users choose boost::shared_ptr in C++11 and C++14 code:
- shared_ptr<T[]> (C++17 only)
- local_shared_ptr<T> (Boost only, interoperates with boost::shared_ptr<T>)
2. Reasons some users choose boost::shared_ptr in C++17 code:
- make_shared<T[]> and allocate_shared<T[]> (C++20 only)
- local_shared_ptr<T> (Boost only, interoperates with boost::shared_ptr<T>)
3. Reasons some users choose boost::shared_ptr in C++2a code:
- make_shared<T[]> and allocate_shared<T[]> (until all vendors implement it)
- local_shared_ptr<T> (Boost only, interoperates with boost::shared_ptr<T>)
Glen