@@ -1402,10 +1402,8 @@ using OperatorSet = common::EnumSet<Operator, 32>;
1402
1402
1403
1403
std::string ToString (Operator op);
1404
1404
1405
- template <typename ... Ts, int Kind>
1406
- Operator OperationCode (
1407
- const evaluate::Operation<evaluate::LogicalOperation<Kind>, Ts...> &op) {
1408
- switch (op.derived ().logicalOperator ) {
1405
+ template <int Kind> Operator OperationCode (const LogicalOperation<Kind> &op) {
1406
+ switch (op.logicalOperator ) {
1409
1407
case common::LogicalOperator::And:
1410
1408
return Operator::And;
1411
1409
case common::LogicalOperator::Or:
@@ -1420,10 +1418,10 @@ Operator OperationCode(
1420
1418
return Operator::Unknown;
1421
1419
}
1422
1420
1423
- template < typename T, typename ... Ts>
1424
- Operator OperationCode (
1425
- const evaluate::Operation<evaluate:: Relational<T>, Ts... > &op) {
1426
- switch (op.derived (). opr ) {
1421
+ Operator OperationCode ( const Relational<SomeType> &op);
1422
+
1423
+ template < typename T> Operator OperationCode ( const Relational<T> &op) {
1424
+ switch (op.opr ) {
1427
1425
case common::RelationalOperator::LT:
1428
1426
return Operator::Lt;
1429
1427
case common::RelationalOperator::LE:
@@ -1440,70 +1438,60 @@ Operator OperationCode(
1440
1438
return Operator::Unknown;
1441
1439
}
1442
1440
1443
- template <typename T, typename ... Ts>
1444
- Operator OperationCode (const evaluate::Operation<evaluate::Add<T>, Ts...> &op) {
1441
+ template <typename T> Operator OperationCode (const Add<T> &op) {
1445
1442
return Operator::Add;
1446
1443
}
1447
1444
1448
- template <typename T, typename ... Ts>
1449
- Operator OperationCode (
1450
- const evaluate::Operation<evaluate::Subtract<T>, Ts...> &op) {
1445
+ template <typename T> Operator OperationCode (const Subtract<T> &op) {
1451
1446
return Operator::Sub;
1452
1447
}
1453
1448
1454
- template <typename T, typename ... Ts>
1455
- Operator OperationCode (
1456
- const evaluate::Operation<evaluate::Multiply<T>, Ts...> &op) {
1449
+ template <typename T> Operator OperationCode (const Multiply<T> &op) {
1457
1450
return Operator::Mul;
1458
1451
}
1459
1452
1460
- template <typename T, typename ... Ts>
1461
- Operator OperationCode (
1462
- const evaluate::Operation<evaluate::Divide<T>, Ts...> &op) {
1453
+ template <typename T> Operator OperationCode (const Divide<T> &op) {
1463
1454
return Operator::Div;
1464
1455
}
1465
1456
1466
- template <typename T, typename ... Ts>
1467
- Operator OperationCode (
1468
- const evaluate::Operation<evaluate::Power<T>, Ts...> &op) {
1457
+ template <typename T> Operator OperationCode (const Power<T> &op) {
1469
1458
return Operator::Pow;
1470
1459
}
1471
1460
1472
- template <typename T, typename ... Ts>
1473
- Operator OperationCode (
1474
- const evaluate::Operation<evaluate::RealToIntPower<T>, Ts...> &op) {
1461
+ template <typename T> Operator OperationCode (const RealToIntPower<T> &op) {
1475
1462
return Operator::Pow;
1476
1463
}
1477
1464
1478
- template <typename T, common::TypeCategory C, typename ... Ts>
1479
- Operator OperationCode (
1480
- const evaluate::Operation<evaluate::Convert<T, C>, Ts...> &op) {
1465
+ template <typename T, common::TypeCategory C>
1466
+ Operator OperationCode (const Convert<T, C> &op) {
1481
1467
if constexpr (C == T::category) {
1482
1468
return Operator::Resize;
1483
1469
} else {
1484
1470
return Operator::Convert;
1485
1471
}
1486
1472
}
1487
1473
1488
- template <typename T, typename ... Ts>
1489
- Operator OperationCode (
1490
- const evaluate::Operation<evaluate::Extremum<T>, Ts...> &op) {
1491
- if (op.derived ().ordering == evaluate::Ordering::Greater) {
1474
+ template <typename T> Operator OperationCode (const Extremum<T> &op) {
1475
+ if (op.ordering == Ordering::Greater) {
1492
1476
return Operator::Max;
1493
1477
} else {
1494
1478
return Operator::Min;
1495
1479
}
1496
1480
}
1497
1481
1498
- template <typename T> Operator OperationCode (const evaluate:: Constant<T> &x) {
1482
+ template <typename T> Operator OperationCode (const Constant<T> &x) {
1499
1483
return Operator::Constant;
1500
1484
}
1501
1485
1486
+ template <typename T> Operator OperationCode (const Designator<T> &x) {
1487
+ return Operator::Identity;
1488
+ }
1489
+
1502
1490
template <typename T> Operator OperationCode (const T &) {
1503
1491
return Operator::Unknown;
1504
1492
}
1505
1493
1506
- Operator OperationCode (const evaluate:: ProcedureDesignator &proc);
1494
+ Operator OperationCode (const ProcedureDesignator &proc);
1507
1495
1508
1496
} // namespace operation
1509
1497
0 commit comments