Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I put my C++ skills on the shelf several years ago and it seems now, when I need them again, the landscape has changed.

We have got C++11 now, and my understanding is that it overlaps many Boost features.

Is there some summary where those overlaps lie, which Boost libraries going to become legacy, recommendation of which C++11 features to use instead of boost ones and which better not?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
179 views
Welcome To Ask or Share your Answers For Others

1 Answer

Replaceable by C++11 language features or libraries

TR1 (they are marked in the documentation if those are TR1 libraries)

Features back-ported from C++11:

  • Atomic ← std::atomic
  • Chrono ← <chrono> (see below)
  • Move ← Rvalue references

Replaceable by C++17 language features:

  • String_ref → std::string_view
  • Filesystem<filesystem> (Filesystem TS)
  • Optional → std::optional (Library Fundamentals TS v1)
  • Any → std::any (Library Fundamentals TS v1)
  • Math/Special Functions<cmath> (Special Math IS), see the list below
    • beta function
    • (normal / associated / spherical) Legendre polynomials
    • (normal / associated) Legendre polynomials
    • Hermite polynomials
    • Bessel (J / Y / I / K) functions (Y is called Neumann function in C++)
    • spherical Bessel (j / y) functions
    • (incomplete / complete) elliptic integrals of (first / second / third kind)
    • Riemann zeta function
    • exponential integral Ei
  • Variant → std::variant (P0088R2)

The standard team is still working on it:

A large part of MPL can be trimmed down or removed using variadic templates. Some common use cases of Lexical cast can be replaced by std::to_string and std::stoX.

Some Boost libraries are related to C++11 but also have some more extensions, e.g. Boost.Functional/Hash contains hash_combine and related functions not found in C++11, Boost.Chrono has I/O and rounding and many other clocks, etc. so you may still want to take a look at the boost ones before really dismissing them.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...