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

Discussion in 'C Programming' started by vinay.muthyal, Feb 26, 2008.

  1. vinay.muthyal

    vinay.muthyal

    Joined:
    Feb 26, 2008
    Messages:
    1
    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);
    }
     
    vinay.muthyal, Feb 26, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ishekara

    ambiguous call to overloaded

    ishekara, Feb 25, 2005, in forum: C++
    Replies:
    7
    Views:
    6,554
    red floyd
    Feb 25, 2005
  2. Johnny
    Replies:
    3
    Views:
    477
    Robert Kern
    Aug 23, 2005
  3. rolandz
    Replies:
    5
    Views:
    535
    Jim Langston
    Jul 4, 2006
  4. subramanian100in@yahoo.com, India

    ambiguous call to overloaded function

    subramanian100in@yahoo.com, India, Sep 10, 2007, in forum: C++
    Replies:
    1
    Views:
    418
    Kai-Uwe Bux
    Sep 10, 2007
  5. Joseph Turian

    Ambiguous call to overloaded function

    Joseph Turian, Dec 20, 2007, in forum: C++
    Replies:
    4
    Views:
    547
    tragomaskhalos
    Dec 20, 2007
Loading...

Share This Page