Баг MSVC2013, variadic templates & default arguments
От: johny5 Новая Зеландия
Дата: 02.08.15 00:15
Оценка:

template<typename T>
class Zunctor;

template<typename ReturnType, typename ... Args>
struct Zunctor<ReturnType (Args...)> : private bool_test_support
{
    ReturnType ZunkMe(const Args& ... args, int def = int()) const
    {}

    static const int a = sizeof ...(Args);
};

void test()
{
    Zunctor<void (bool)> functor;
     int z = &Zunctor<void (bool)>::ZunkMe;

    functor.ZunkMe(true);
}


Выхлоп:
error C2440: 'initializing' : cannot convert from 'void (__thiscall Zunctor<void (bool)>::* )(const bool &,int) const' to 'int'
1> There is no context in which this conversion is possible
error C2660: 'Zunctor<void (bool)>::ZunkMe' : function does not take 1 arguments
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.