If I call the function Template C as follows
Match(foo){
Case(C<SomeType>(arg0, arg1, arg2, arg3)){
/* ... */
}
Otherwise(){/*...*/}
} EndMatch
everything works as expected. However, if I write,
Match(foo){
Case(C<SomeType>(arg0, arg1, arg2, arg3, arg4)){
/* ... */
}
Otherwise(){/*...*/}
} EndMatch
the compiler complains about no matching function for call to 'C'.
I already looked at constructor.hpp and the implementations of the class templates constr{0,1,2,3,4}. I assume those to be the underlying base of C which almost certainly itself is a macro (is that right?), which would explain the limitation to 4 arguments of the call operator. But then I looked more closely and realized that only the number of template arguments changes. The call operator overloads (more or less) stay the same throughout the different versions of constr.
template <typename U> const T* operator()(const U* u) const noexcept { return dynamic_cast<const T*>(u); }
template <typename U> T* operator()( U* u) const noexcept { return dynamic_cast< T*>(u); }
template <typename U> const T* operator()(const U& u) const noexcept { return operator()(&u); }
template <typename U> T* operator()( U& u) const noexcept { return operator()(&u); }
const T* operator()(const T* t) const noexcept { return t; }
T* operator()( T* t) const noexcept { return t; }
const T* operator()(const T& t) const noexcept { return &t; }
T* operator()( T& t) const noexcept { return &t; }
Why is that? I'm probably missing something obvious here...
Could you elaborate the expansion of C a little further. Somehow I can't find the macro definition. I also tried to compile with gcc -E in order to view the expansions, without much success (however, the output did hurt my eyes).
Best regards
Florian
If I call the function Template C as follows
everything works as expected. However, if I write,
the compiler complains about no matching function for call to 'C'.
I already looked at constructor.hpp and the implementations of the class templates constr{0,1,2,3,4}. I assume those to be the underlying base of
Cwhich almost certainly itself is a macro (is that right?), which would explain the limitation to 4 arguments of the call operator. But then I looked more closely and realized that only the number of template arguments changes. The call operator overloads (more or less) stay the same throughout the different versions of constr.Why is that? I'm probably missing something obvious here...
Could you elaborate the expansion of C a little further. Somehow I can't find the macro definition. I also tried to compile with
gcc -Ein order to view the expansions, without much success (however, the output did hurt my eyes).Best regards
Florian