Skip to content

Commit 1994d72

Browse files
aaronj0vgvassilev
authored andcommitted
Add Cppyy::IsStaticTemplate
Based on wlav@240ea54, required for wlav/CPyCppyy@c6d623a in CPyCppyy
1 parent 8954873 commit 1994d72

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

clingwrapper/src/capi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ extern "C" {
109109
RPY_EXPORTED
110110
int cppyy_is_namespace(cppyy_scope_t scope);
111111
RPY_EXPORTED
112+
int cppyy_is_static_template(cppyy_scope_t scope, const char* name);
113+
RPY_EXPORTED
112114
int cppyy_is_template(const char* template_name);
113115
RPY_EXPORTED
114116
int cppyy_is_abstract(cppyy_type_t type);

clingwrapper/src/clingwrapper.cxx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,6 +1599,13 @@ bool Cppyy::IsTemplatedMethod(TCppMethod_t method)
15991599
return Cpp::IsTemplatedFunction(method);
16001600
}
16011601

1602+
bool Cppyy::IsStaticTemplate(TCppScope_t scope, const std::string& name)
1603+
{
1604+
if (Cpp::TCppFunction_t tf = GetMethodTemplate(scope, name, ""))
1605+
return Cpp::IsStaticMethod(tf);
1606+
return false;
1607+
}
1608+
16021609
Cppyy::TCppMethod_t Cppyy::GetMethodTemplate(
16031610
TCppScope_t scope, const std::string& name, const std::string& proto)
16041611
{

clingwrapper/src/cpp_cppyy.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,8 @@ namespace Cppyy {
318318
RPY_EXPORTED
319319
bool IsTemplatedMethod(TCppMethod_t method);
320320
RPY_EXPORTED
321+
bool IsStaticTemplate(TCppScope_t scope, const std::string& name);
322+
RPY_EXPORTED
321323
TCppMethod_t GetMethodTemplate(
322324
TCppScope_t scope, const std::string& name, const std::string& proto);
323325
RPY_EXPORTED

0 commit comments

Comments
 (0)