Могу ли я использовать (ускорять) привязку шаблон функции?

Можно ли привязать аргументы к шаблону функции с помощью (boost) bind ?

// Define a template function (just a silly example)
template
ARG1 FCall2Templ(ARG1 arg1, ARG2 arg2)
{
    return arg1 + arg2;
}

// try to bind this template function (and call it)
...
boost::bind(FCall2Templ, 42, 56)(); // This works

boost::bind(FCall2Templ, 42, 56)(); // This emits 5 pages of error messages on VS2005
// beginning with: error C2780: 
//   'boost::_bi::bind_t<_bi::dm_result::type,boost::_mfi::dm,_bi::list_av_1::type> 
//   boost::bind(M T::* ,A1)' : expects 2 arguments - 3 provided

boost::bind(FCall2Templ, 42, 56)(); // error C2665: 'boost::bind' : none of the 2 overloads could convert all the argument types

Идеи?

12
задан Martin Ba 12 August 2011 в 11:32
поделиться