vs2010 bug of partial template specialization?


Joined
Mar 12, 2017
Messages
1
Reaction score
0
Code:
template <typename C, typename R ,typename Arg1, typename Arg2>
class FunctionWrapper2
{
public:
    enum ArgsCounter{ I_C, I_Arg1, I_Arg2, ARGS_COUNT };

    struct None;

    template<int INDEX, typename S=void>
    struct argsType{ typedef None Type; };

    template<typename S>
    struct argsType<((int) I_C), S>{ typedef C* Type; };

    template<typename S>
    struct argsType<((int) I_Arg1), S>{ typedef Arg1 Type; };

    template<typename S>
    struct argsType<((int) I_Arg2), S>{ typedef Arg2 Type; };
};

int main(int argc, char* argv[])
{
    typedef FunctionWrapper2<char,int,float,double>::argsType<2,void>::Type TypeofArg2;
    TypeofArg2 arg2; // Error C2079: "arg2" using undefined struct "FunctionWrapper2<C, R, Arg1, Arg2>::None"
}
 
Ad

Advertisements

Joined
Jul 11, 2010
Messages
5,758
Reaction score
552
Hi javeme welcome to PCR and enjoy and join in, I am sure someone on the site will be able to help you unfortunately I am not able to as I am a Linux user, but once again welcome to PCR.:cheers:
 

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

Similar Threads


Top