Skip to content

Commit b46dfd9

Browse files
committed
Qualify calls to template member functions in invoke_matching.
This is necessary to avoid a bug in which a template struct from another namespace can be confused with the member function by the parser (see gcc bug 55576; it's apparently a defect in the C++98 standard).
1 parent 956606e commit b46dfd9

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

boost/numpy/invoke_matching.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct dtype_template_invoker
4444
{
4545
if (dtype::get_builtin<T>() == m_dtype)
4646
{
47-
m_func.template apply<T>();
47+
m_func.Function::template apply<T>();
4848
throw dtype_template_match_found();
4949
}
5050
}
@@ -66,7 +66,7 @@ struct dtype_template_invoker< boost::reference_wrapper<Function> >
6666
{
6767
if (dtype::get_builtin<T>() == m_dtype)
6868
{
69-
m_func.template apply<T>();
69+
m_func.Function::template apply<T>();
7070
throw dtype_template_match_found();
7171
}
7272
}
@@ -87,7 +87,7 @@ struct nd_template_invoker
8787
{
8888
if (m_nd == N)
8989
{
90-
m_func.template apply<N>();
90+
m_func.Function::template apply<N>();
9191
throw nd_template_match_found();
9292
}
9393
}
@@ -107,7 +107,7 @@ struct nd_template_invoker< boost::reference_wrapper<Function> >
107107
{
108108
if (m_nd == N)
109109
{
110-
m_func.template apply<N>();
110+
m_func.Function::template apply<N>();
111111
throw nd_template_match_found();
112112
}
113113
}
@@ -148,7 +148,7 @@ template <typename T, typename Function>
148148
struct array_template_invoker_wrapper_2
149149
{
150150
template <int N>
151-
void apply() const { m_func.template apply<T,N>();}
151+
void apply() const { m_func.Function::template apply<T,N>();}
152152
array_template_invoker_wrapper_2(Function & func) : m_func(func) {}
153153

154154
private:

0 commit comments

Comments
 (0)