diff options
author | Christian Parpart <christian@parpart.family> | 2018-10-15 21:17:20 +0800 |
---|---|---|
committer | Christian Parpart <christian@ethereum.org> | 2018-10-16 00:21:34 +0800 |
commit | 04612936c2ceb41e1c63bfa637eb65f000319c23 (patch) | |
tree | bacc0409559b46e2eb00f25f9872280da30a268e /libdevcore | |
parent | 238494752192a2c834eb8913b244671afb48d693 (diff) | |
download | dexon-solidity-04612936c2ceb41e1c63bfa637eb65f000319c23.tar dexon-solidity-04612936c2ceb41e1c63bfa637eb65f000319c23.tar.gz dexon-solidity-04612936c2ceb41e1c63bfa637eb65f000319c23.tar.bz2 dexon-solidity-04612936c2ceb41e1c63bfa637eb65f000319c23.tar.lz dexon-solidity-04612936c2ceb41e1c63bfa637eb65f000319c23.tar.xz dexon-solidity-04612936c2ceb41e1c63bfa637eb65f000319c23.tar.zst dexon-solidity-04612936c2ceb41e1c63bfa637eb65f000319c23.zip |
Yul: Introduces a block flattening pass + tests
Diffstat (limited to 'libdevcore')
-rw-r--r-- | libdevcore/CommonData.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libdevcore/CommonData.h b/libdevcore/CommonData.h index 98136b44..f208c425 100644 --- a/libdevcore/CommonData.h +++ b/libdevcore/CommonData.h @@ -239,9 +239,10 @@ bool contains(T const& _t, V const& _v) /// on the current element and after that. The actual replacement takes /// place at the end, but already visited elements might be invalidated. /// If nothing is replaced, no copy is performed. -template <class T> -void iterateReplacing(std::vector<T>& _vector, std::function<boost::optional<std::vector<T>>(T&)> _f) +template <typename T, typename F> +void iterateReplacing(std::vector<T>& _vector, const F& _f) { + // Concept: _f must be Callable, must accept param T&, must return optional<vector<T>> bool useModified = false; std::vector<T> modifiedVector; for (size_t i = 0; i < _vector.size(); ++i) |