The boost C library is a famous sandbox for the language and Standard Library features that absorbed with each new version of the Standard C . However boost components that eventually became a part of the Standard are still present in boost. One of the classic examples of said above are smart pointers. So why do I need Boost.SmartPtr
for the C compiler that supports C 11 and later?
CodePudding user response:
Why do I need Boost.SmartPtr for the C compiler that supports C 11 and later?
Because:
- You may need your program to compile with another compiler that doesn't support C 11 or later.
- You may not want to bother implementing
make_unique
yourself. Sure it's easy, but why do it when you can use an existing implementation? - You may want to use one of the smart pointers provided by Boost.SmartPtr besides shared pointer.
- You may already have been using it, and don't want to pay for the effort of stopping using it.