6

I can't find the information on which C++ version is being currently used in bitcoin core project? Is it decided for future releases somehow? How does the situation looks now?

The only thing I could find was Pieter Wuille's comment:

Bitcoin Core is switching to C++11 in the upcoming 0.13 release. Meanwhile, C++14 is already standardized and C++17 is well underway. Stating that Bitcoin Core always uses the latest features seems like a strange statement.

It may look like some XY problem, so the reason I am asking is my GF is long time C++ dev and I am looking for resources to learn C++ to be able to understand bitcoin code. Her first question was which C++ version it's written in, as it supposedly doesn't make sense to learn older versions.

Pieter Wuille
  • 98,249
  • 9
  • 183
  • 287
Tony Sanak
  • 1,654
  • 4
  • 22
  • 2
    See https://github.com/bitcoin/bitcoin/issues/16684 and the latest comment by MarcoFalke for the specific features (such as the filesystem). – Antoine Poinsot Dec 14 '20 at 15:03
  • 2
    "it supposedly doesn't make sense to learn older versions" I strongly disagree. Even learning C helps develop C++ acquaintance. And it's too early to consider C++11 obsolete. You might want to skip the parts calling the Boost library since they have "The long term future goal ... to remove Boost as a dependency" and replace it with newer C++ features – MCCCS Dec 14 '20 at 15:38
  • Thanks @darosior! Exactly what I was looking for. @MCCCS thanks for the suggestion. – Tony Sanak Dec 14 '20 at 16:14

1 Answers1

9

Bitcoin Core:

  • v0.1.0...v0.12.x: C++03
  • v0.13.0...v0.21.x: C++11
  • v22.0...: C++17
Pieter Wuille
  • 98,249
  • 9
  • 183
  • 287
  • What particular language features are used from C++17 or even C++11? – Martin Schwarz Sep 30 '21 at 12:23
  • 1
    Lots of them, and which one changes from release to release. IIRC, in the first few C++11 releases some features were avoided because they weren't well supported on all compilers despite nominally supporting C++11. – Pieter Wuille Sep 30 '21 at 12:29