Hello,
very simple test case that showcases a problem I have:
template<typename Type>
struct Dummy
{
using type = Type;
};
template<typename Type>
void dummyFunction(typename Dummy<Type>::type type)
{
}
void main(void)
{
dummyFunction(1); // error: no instance of function "dummyFunction" fits argument list
dummyFunction<int>(1); // compiles
}
The problem I have is that dummyFunction(1) won't compile, only when I explicitely specify the template type.
In practice, this is a more complex part of my RTT-system where "Dummy<Type>" would modify the signature of the type depending on what it receives, but this is as simple a case as I could reduce it to so you can test for yourself. "Just put the type yourself" is a lot of unnecessary overhead in my real use-case, so I would like to avoid it.
So my quest:
1) Why does template argument deduction fail here? I know it is due to using the Dummy::type, but why is this a problem?
2) Is there any way around this, that still lets me get away without having to put dummyFunction<Type>(X)? Or is this some limitation of template-metaprogramming that I was not aware of? (Hopefully I didn't just forget an typename, then I'm going to kick something...)
EDIT: Well