call of overloaded func() is ambiguous - Erron in gcc

Joined
Feb 26, 2008
Messages
1
Reaction score
0
Following piece of code , is getting compilation error in gcc344 , can any one help how to get ride of this...

#include <iostream>

template<class ValueType, int SomeValue>
struct TS
{
};

template<class ReturnType, class ArgType>
ReturnType func(const ArgType& f_arg)
{
return static_cast<ReturnType>(0);
}

template<class ReturnType, class ValueType, int SomeValue>
ReturnType func(const TS<ValueType, SomeValue>& f_arg)
{
return static_cast<ReturnType>(1);
}

int main()
{
TS<int, 10> val;
func<int>(val);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top