Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippGrulich committed Feb 5, 2024
1 parent e33c537 commit a2430a0
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <Interface/DataTypes/Integer/Int.hpp>
#include <Interface/DataTypes/InvocationPlugin.hpp>
#include <Exceptions/RuntimeException.hpp>
#include <functional>

namespace NES::Nautilus {

Expand All @@ -27,12 +28,12 @@ namespace NES::Nautilus {
std::optional<Value<>>
performBinaryOperationAndCast(const Value<> &left,
const Value<> &right,
std::function<Value<>(const Any &left, const Any &right)> function) const {
std::function<Value<>(const Any &left, const Any &right)> fun) const {
auto &leftValue = left.getValue();
auto &rightValue = right.getValue();
if ((isa<Float>(leftValue) && isa<Float>(rightValue)) ||
(isa<Double>(leftValue) && isa<Double>(rightValue))) {
return function(leftValue, rightValue);
return fun(leftValue, rightValue);
}
return {};
//throw NES::Exceptions::RuntimeException("Cast operation failed.");
Expand Down

0 comments on commit a2430a0

Please sign in to comment.