Fix syntax error parsing variadic template parameter pack arguments
that are function pointers Issue #1863
This commit is contained in:
parent
b13f584258
commit
70837bbc26
3 changed files with 32 additions and 6 deletions
|
|
@ -143,15 +143,38 @@ public:
|
|||
%inline %{
|
||||
template <typename... V> struct VariadicParms {
|
||||
public:
|
||||
void ParmsVal(V... vparms_v) {}
|
||||
void ParmsPtr(V*... vparms_p) {}
|
||||
void ParmsPtrRef(V*&... vparms_pr) {}
|
||||
void ParmsPtrRValueRef(V*&&... vparms_rvr) {}
|
||||
void ParmsVal(V... vparms_v) {}
|
||||
void ParmsRef(V&... vparms_r) {}
|
||||
void ParmsRValueRef(V&&... vparms_r) {}
|
||||
void ParmsConstRef(const V&... vparms_cr) {}
|
||||
|
||||
// TODO
|
||||
// void ParmsFuncPtr(int (*)(V...)) {}
|
||||
};
|
||||
%}
|
||||
|
||||
%template(VariadicParms1) VariadicParms<A>;
|
||||
%template(VariadicParms2) VariadicParms<A,B>;
|
||||
%template(VariadicParms3) VariadicParms<A,B,C>;
|
||||
|
||||
|
||||
// #1863
|
||||
%inline %{
|
||||
class Container {
|
||||
public:
|
||||
template<typename... Args>
|
||||
static void notifyMyTypes(void (fn)(Args...));
|
||||
};
|
||||
%}
|
||||
%{
|
||||
template<typename... Args>
|
||||
void Container::notifyMyTypes(void (fn)(Args...)) {}
|
||||
|
||||
// Explicit template instantiations
|
||||
template void Container::notifyMyTypes<>(void (tt)());
|
||||
template void Container::notifyMyTypes<int>(void (tt)(int));
|
||||
template void Container::notifyMyTypes<int, double>(void (tt)(int, double));
|
||||
%}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue