New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
util: Replace boost::signals2 with std::function #13961
Conversation
fa7b6df
to
fa7db59
Compare
For all bitcoind units that depend on util:
(gcc default ./configure) |
Excellent! Concept ACK |
Note to reviewers: This pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
utACK fa7db59 |
src/util.h
Outdated
extern const char * const BITCOIN_CONF_FILENAME; | ||
extern const char * const BITCOIN_PID_FILENAME; | ||
|
||
/** Translate a message to the native language of the user. */ | ||
const extern std::function<std::string(const char*)>* G_TRANSLATION_FUN; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about
const extern std::function<std::string(const char*)> G_TRANSLATION_FUN;
And below (L51) use https://en.cppreference.com/w/cpp/utility/functional/function/operator_bool?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
fa7db59
to
faaee49
Compare
faaee49
to
ddddce0
Compare
utACK ddddce0 |
ddddce0 util: Replace boost::signals2 with std::function (MarcoFalke) Pull request description: This removes the `#include <boost/signals2/signal.hpp>` from `util.h` (hopefully speeding up the build time and reducing the memory usage further after #13634) The whole translation interface is replaced by a function `G_TRANSLATION_FUN` that is set to nullptr in units that don't need translation. (Thus only set in the gui) Tree-SHA512: 087c717358bbed8bdb409463e225239d667f1ced381abb10e7cd31a41dcdd2cebe20b43c2ee86f0f8e55d53301f75e963f07421a99a7ff4c0cad2c6a375c5ab1
@@ -13,6 +13,8 @@ | |||
|
|||
#include <memory> | |||
|
|||
const std::function<std::string(const char*)> G_TRANSLATION_FUN = nullptr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These = nullptr
are not needed since it's not a pointer and the empty constructor has the same behaviour.
Backport Boost removal PRs Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#7613 - bitcoin/bitcoin#10502 - bitcoin/bitcoin#10193 - bitcoin/bitcoin#13961 - bitcoin/bitcoin#13734 - Only the second commit (we don't need the first). - bitcoin/bitcoin#14480 Part of #4819.
ddddce0 util: Replace boost::signals2 with std::function (MarcoFalke) Pull request description: This removes the `#include <boost/signals2/signal.hpp>` from `util.h` (hopefully speeding up the build time and reducing the memory usage further after bitcoin#13634) The whole translation interface is replaced by a function `G_TRANSLATION_FUN` that is set to nullptr in units that don't need translation. (Thus only set in the gui) Tree-SHA512: 087c717358bbed8bdb409463e225239d667f1ced381abb10e7cd31a41dcdd2cebe20b43c2ee86f0f8e55d53301f75e963f07421a99a7ff4c0cad2c6a375c5ab1 # Conflicts: # src/bench/bench_dash.cpp # src/qt/dash.cpp # src/qt/splashscreen.cpp # src/qt/transactiontablemodel.cpp # src/test/test_dash.cpp # src/util/system.h # src/wallet/coinselection.cpp
ddddce0 util: Replace boost::signals2 with std::function (MarcoFalke) Pull request description: This removes the `#include <boost/signals2/signal.hpp>` from `util.h` (hopefully speeding up the build time and reducing the memory usage further after bitcoin#13634) The whole translation interface is replaced by a function `G_TRANSLATION_FUN` that is set to nullptr in units that don't need translation. (Thus only set in the gui) Tree-SHA512: 087c717358bbed8bdb409463e225239d667f1ced381abb10e7cd31a41dcdd2cebe20b43c2ee86f0f8e55d53301f75e963f07421a99a7ff4c0cad2c6a375c5ab1 # Conflicts: # src/bench/bench_dash.cpp # src/qt/dash.cpp # src/qt/splashscreen.cpp # src/qt/transactiontablemodel.cpp # src/test/test_dash.cpp # src/util/system.h # src/wallet/coinselection.cpp
ddddce0 util: Replace boost::signals2 with std::function (MarcoFalke) Pull request description: This removes the `#include <boost/signals2/signal.hpp>` from `util.h` (hopefully speeding up the build time and reducing the memory usage further after bitcoin#13634) The whole translation interface is replaced by a function `G_TRANSLATION_FUN` that is set to nullptr in units that don't need translation. (Thus only set in the gui) Tree-SHA512: 087c717358bbed8bdb409463e225239d667f1ced381abb10e7cd31a41dcdd2cebe20b43c2ee86f0f8e55d53301f75e963f07421a99a7ff4c0cad2c6a375c5ab1 # Conflicts: # src/bench/bench_dash.cpp # src/qt/dash.cpp # src/qt/splashscreen.cpp # src/qt/transactiontablemodel.cpp # src/test/test_dash.cpp # src/util/system.h # src/wallet/coinselection.cpp
ddddce0 util: Replace boost::signals2 with std::function (MarcoFalke) Pull request description: This removes the `#include <boost/signals2/signal.hpp>` from `util.h` (hopefully speeding up the build time and reducing the memory usage further after bitcoin#13634) The whole translation interface is replaced by a function `G_TRANSLATION_FUN` that is set to nullptr in units that don't need translation. (Thus only set in the gui) Tree-SHA512: 087c717358bbed8bdb409463e225239d667f1ced381abb10e7cd31a41dcdd2cebe20b43c2ee86f0f8e55d53301f75e963f07421a99a7ff4c0cad2c6a375c5ab1 # Conflicts: # src/bench/bench_dash.cpp # src/qt/dash.cpp # src/qt/splashscreen.cpp # src/qt/transactiontablemodel.cpp # src/test/test_dash.cpp # src/util/system.h # src/wallet/coinselection.cpp
ddddce0 util: Replace boost::signals2 with std::function (MarcoFalke) Pull request description: This removes the `#include <boost/signals2/signal.hpp>` from `util.h` (hopefully speeding up the build time and reducing the memory usage further after bitcoin#13634) The whole translation interface is replaced by a function `G_TRANSLATION_FUN` that is set to nullptr in units that don't need translation. (Thus only set in the gui) Tree-SHA512: 087c717358bbed8bdb409463e225239d667f1ced381abb10e7cd31a41dcdd2cebe20b43c2ee86f0f8e55d53301f75e963f07421a99a7ff4c0cad2c6a375c5ab1 # Conflicts: # src/bench/bench_dash.cpp # src/qt/dash.cpp # src/qt/splashscreen.cpp # src/qt/transactiontablemodel.cpp # src/test/test_dash.cpp # src/util/system.h # src/wallet/coinselection.cpp
ddddce0 util: Replace boost::signals2 with std::function (MarcoFalke) Pull request description: This removes the `#include <boost/signals2/signal.hpp>` from `util.h` (hopefully speeding up the build time and reducing the memory usage further after bitcoin#13634) The whole translation interface is replaced by a function `G_TRANSLATION_FUN` that is set to nullptr in units that don't need translation. (Thus only set in the gui) Tree-SHA512: 087c717358bbed8bdb409463e225239d667f1ced381abb10e7cd31a41dcdd2cebe20b43c2ee86f0f8e55d53301f75e963f07421a99a7ff4c0cad2c6a375c5ab1 # Conflicts: # src/bench/bench_dash.cpp # src/qt/dash.cpp # src/qt/splashscreen.cpp # src/qt/transactiontablemodel.cpp # src/test/test_dash.cpp # src/util/system.h # src/wallet/coinselection.cpp
ddddce0 util: Replace boost::signals2 with std::function (MarcoFalke) Pull request description: This removes the `#include <boost/signals2/signal.hpp>` from `util.h` (hopefully speeding up the build time and reducing the memory usage further after bitcoin#13634) The whole translation interface is replaced by a function `G_TRANSLATION_FUN` that is set to nullptr in units that don't need translation. (Thus only set in the gui) Tree-SHA512: 087c717358bbed8bdb409463e225239d667f1ced381abb10e7cd31a41dcdd2cebe20b43c2ee86f0f8e55d53301f75e963f07421a99a7ff4c0cad2c6a375c5ab1 # Conflicts: # src/bench/bench_dash.cpp # src/qt/dash.cpp # src/qt/splashscreen.cpp # src/qt/transactiontablemodel.cpp # src/test/test_dash.cpp # src/util/system.h # src/wallet/coinselection.cpp
This removes the
#include <boost/signals2/signal.hpp>
fromutil.h
(hopefully speeding up the build time and reducing the memory usage further after #13634)The whole translation interface is replaced by a function
G_TRANSLATION_FUN
that is set to nullptr in units that don't need translation. (Thus only set in the gui)