@@ -1412,26 +1412,22 @@ std::string Cppyy::GetMethodArgDefault(TCppMethod_t method, TCppIndex_t iarg)
14121412
14131413std::string Cppyy::GetMethodSignature (TCppMethod_t method, bool show_formal_args, TCppIndex_t max_args)
14141414{
1415- if (Cppyy::IsTemplatedMethod (method)) {
1416- std::ostringstream sig;
1417- sig << " (" ;
1418- int nArgs = GetMethodNumArgs (method);
1419- if (max_args != (TCppIndex_t)-1 ) nArgs = std::min (nArgs, (int )max_args);
1420- for (int iarg = 0 ; iarg < nArgs; ++iarg) {
1421- sig << Cppyy::GetMethodArgTypeAsString (method, iarg);
1422- if (show_formal_args) {
1423- const char * argname = Cppyy::GetMethodArgName (method, iarg).c_str ();
1424- if (argname && argname[0 ] != ' \0 ' ) sig << " " << argname;
1425- const char * defvalue = Cppyy::GetMethodArgDefault (method, iarg).c_str ();
1426- if (defvalue && defvalue[0 ] != ' \0 ' ) sig << " = " << defvalue;
1427- }
1428- if (iarg != nArgs-1 ) sig << (show_formal_args ? " , " : " ," );
1415+ std::ostringstream sig;
1416+ sig << " (" ;
1417+ int nArgs = GetMethodNumArgs (method);
1418+ if (max_args != (TCppIndex_t)-1 ) nArgs = std::min (nArgs, (int )max_args);
1419+ for (int iarg = 0 ; iarg < nArgs; ++iarg) {
1420+ sig << Cppyy::GetMethodArgTypeAsString (method, iarg);
1421+ if (show_formal_args && Cppyy::IsTemplatedMethod (method)) {
1422+ std::string argname = Cppyy::GetMethodArgName (method, iarg);
1423+ if (!argname.empty ()) sig << " " << argname;
1424+ std::string defvalue = Cppyy::GetMethodArgDefault (method, iarg);
1425+ if (!defvalue.empty ()) sig << " = " << defvalue;
14291426 }
1430- sig << " )" ;
1431- return sig.str ();
1427+ if (iarg != nArgs-1 ) sig << (show_formal_args ? " , " : " ," );
14321428 }
1433-
1434- else return Cpp::GetFunctionSignature (method );
1429+ sig << " ) " ;
1430+ return sig. str ( );
14351431}
14361432
14371433std::string Cppyy::GetMethodPrototype (TCppMethod_t method, bool show_formal_args)
0 commit comments