error C2784: could not deduce template argument
От: collider  
Дата: 15.10.15 08:41
Оценка:
Всем доброго...
Может существует финт ушами чтобы заставить компилятор(VS 2008) догадаться, что я хочу здесь сделать?


template<class T>
struct struct_t
{
    struct_t(const T& x):m_value(x)
    {
    }
    T m_value;
};


template<class T>
void test_t(const struct_t<T>& x)
{
}


int _tmain(int argc, _TCHAR* argv[])
{
    test_t(10);
}


выдает ошибку:
1>.\test.cpp(304) : error C2784: 'void test_t(const struct_t<T> &)' : could not deduce template argument for 'const struct_t<T> &' from 'int'
1> .\test.cpp(298) : see declaration of 'test_t'
Отредактировано 15.10.2015 8:42 collider . Предыдущая версия .
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.