Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
196 views
in Technique[技术] by (71.8m points)

c++ - Which Boost features overlap with C++11?

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

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

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...