Actually, I don't think the boost libraries are going to become legacy.
Yes, you should be able to use std::type_traits
, regex
, shared_ptr
, unique_ptr
, tuple<>
, std::tie
, std::begin
instead of Boost Typetraits/Utility, Boost Smartpointer, Boost Tuple, Boost Range libraries, but there should in practice be no real need to 'switch' unless you are moving more of your code to c++11.
Also, in my experience, the std
versions of most of these are somewhat less featureful. E.g. AFAICT the standard does not have
- Perl5 regular expressions
- call_traits
- Certain regex interface members (such as
bool boost::basic_regex<>::empty()
) and othe interface differences
- this bites more since the Boost interface is exactly matched with Boost Xpressive
- and it plays much more nicely with Boost String Algorithms
Obviously, the latter don't have standard counterparts (yet?)
- Many things relating to TMP (Boost Fusion)
Lazy, expression template-based lambdas; they have inevitable benefits in that they can be polymorphic today, as opposed to C++11. Therefore they can often be more succinct:
std::vector<int> v = {1,2,-9,3};
for (auto i : v | filtered(_arg1 >=0))
std::cout << i << "\n";
// or:
boost::for_each(v, std::cout << _arg1);
Most definitely, this still has some appeal over C++11 lambdas (with trailing return types, explicit capturing and declared parameters).
Also, there is a BIG role for Boost, precisely in facilitating path-wise migration from C++03 to C++11 and integrating C++11 and C++03 codebases. I'm particularly thinking of
- Boost Auto (BOOST_AUTO)
- Boost Utility (
boost::result_of<>
and related)
- Boost Foreach (BOOST_FOREACH)
- Don't forget: Boost Move - which makes it possible to write classes with move semantics with a syntax that will compile equally well on C++03 compilers with Boost 1_48+ and C++11 compilers.
Just my $0.02