Skip to content

Commit 649d952

Browse files
Vipul-Cariappaaaronj0
authored andcommitted
resolve (), [], == ^ != ops (#148)
1 parent ce4b879 commit 649d952

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

clingwrapper/src/clingwrapper.cxx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1652,11 +1652,10 @@ void Cppyy::GetClassOperators(Cppyy::TCppScope_t klass,
16521652
Cpp::GetOperator(klass, Cpp::Operator::OP_Greater, operators);
16531653
else if (opname == "operator>=")
16541654
Cpp::GetOperator(klass, Cpp::Operator::OP_GreaterEqual, operators);
1655-
// FIXME: enabling `==` and `!=` requires friend operators
1656-
// else if (opname == "operator==")
1657-
// Cpp::GetOperator(klass, Cpp::Operator::OP_EqualEqual, operators);
1658-
// else if (opname == "operator!=")
1659-
// Cpp::GetOperator(klass, Cpp::Operator::OP_ExclaimEqual, operators);
1655+
else if (opname == "operator==")
1656+
Cpp::GetOperator(klass, Cpp::Operator::OP_EqualEqual, operators);
1657+
else if (opname == "operator!=")
1658+
Cpp::GetOperator(klass, Cpp::Operator::OP_ExclaimEqual, operators);
16601659
else if (opname == "operator<<")
16611660
Cpp::GetOperator(klass, Cpp::Operator::OP_LessLess, operators);
16621661
else if (opname == "operator>>")
@@ -1665,6 +1664,10 @@ void Cppyy::GetClassOperators(Cppyy::TCppScope_t klass,
16651664
Cpp::GetOperator(klass, Cpp::Operator::OP_Amp, operators);
16661665
else if (opname == "operator|")
16671666
Cpp::GetOperator(klass, Cpp::Operator::OP_Pipe, operators);
1667+
else if (opname == "operator()")
1668+
Cpp::GetOperator(klass, Cpp::Operator::OP_Call, operators);
1669+
else if (opname == "operator[]")
1670+
Cpp::GetOperator(klass, Cpp::Operator::OP_Subscript, operators);
16681671
}
16691672

16701673
Cppyy::TCppMethod_t Cppyy::GetGlobalOperator(
@@ -1707,6 +1710,11 @@ Cppyy::TCppMethod_t Cppyy::GetGlobalOperator(
17071710
Cpp::GetOperator(scope, Cpp::Operator::OP_Amp, overloads);
17081711
else if (opname == "|")
17091712
Cpp::GetOperator(scope, Cpp::Operator::OP_Pipe, overloads);
1713+
else if (opname == "()")
1714+
Cpp::GetOperator(scope, Cpp::Operator::OP_Call, overloads);
1715+
else if (opname == "[]")
1716+
Cpp::GetOperator(scope, Cpp::Operator::OP_Subscript, overloads);
1717+
17101718

17111719
std::vector<Cppyy::TCppMethod_t> unresolved_candidate_methods;
17121720
for (auto overload: overloads) {

0 commit comments

Comments
 (0)