diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2022-04-19 18:06:21 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2022-04-20 09:40:36 +0200 |
commit | 80caf4d4566371cf02923abdc26ae2e8258ed376 (patch) | |
tree | a4f15caabd87d78fd8ce59b5949b7a3b21e10d3e /src/buildtool/build_engine/expression/expression.hpp | |
parent | db07e1adbb7f8758e1da04e8b48dd9587c2573ef (diff) | |
download | justbuild-80caf4d4566371cf02923abdc26ae2e8258ed376.tar.gz |
Remove unused "+" on expressions
To concatenate lists (the only ability the "+" operator had),
use "++".
Diffstat (limited to 'src/buildtool/build_engine/expression/expression.hpp')
-rw-r--r-- | src/buildtool/build_engine/expression/expression.hpp | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/src/buildtool/build_engine/expression/expression.hpp b/src/buildtool/build_engine/expression/expression.hpp index 52e67282..412de057 100644 --- a/src/buildtool/build_engine/expression/expression.hpp +++ b/src/buildtool/build_engine/expression/expression.hpp @@ -343,27 +343,6 @@ class Expression { [[nodiscard]] auto ComputeHash() const noexcept -> std::string; }; -[[nodiscard]] inline auto operator+(Expression const& lhs, - Expression const& rhs) -> Expression { - if (lhs.data_.index() != rhs.data_.index()) { - throw Expression::ExpressionTypeError{ - fmt::format("Cannot add expressions of different type: {} != {}", - lhs.TypeString(), - rhs.TypeString())}; - } - if (not lhs.IsList()) { - throw Expression::ExpressionTypeError{fmt::format( - "Cannot add expressions of type '{}'.", lhs.TypeString())}; - } - auto list = Expression::list_t{}; - auto const& llist = lhs.List(); - auto const& rlist = rhs.List(); - list.reserve(llist.size() + rlist.size()); - list.insert(list.begin(), llist.begin(), llist.end()); - list.insert(list.end(), rlist.begin(), rlist.end()); - return Expression{list}; -} - namespace std { template <> struct hash<Expression> { |