Boost logo

Boost Users :

From: Jan Ohlenburg (jan.ohlenburg_at_[hidden])
Date: 2006-08-08 23:35:46


Hi everybody,
I would like to bind a member function within the template function using
the template argument. Please have a look at the following code:

template<typename T> void Object::setField(FieldId fieldId, const T&
fieldData)
{
  // call for_each with setFieldImpl ...
  shadowCopies->for_each ( boost::bind2nd(
boost::mem_fun(&Object::setFieldImpl<T>), fieldId, fieldData)));
}

template<typename T> void Object::setFieldImpl(FieldId fieldId, const T&
fieldData)
{
  ... do some stuff...
}

But the compiler tells me:

could not deduce template argument for 'overloaded function type' from
'overloaded function type'

Do you have any idea, how to do this?

Thanks in advance for your help.

Regards,
Jan

----------------------------------------------------------------------
Dipl.-Inform. Jan Ohlenburg
Fraunhofer Institut fuer Angewandte Informationstechnik FIT
Forschungsgruppe Collaborative Virtual and Augmented Environments
Schloss Birlinghoven
D - 53754 Sankt Augustin, Germany
Telefon: +49-2241-14-2724
e-Fax: +49-2241-14-4-2724
Telefax: +49-2241-14-2084
e-mail: mailto:jan.ohlenburg_at_[hidden]
 


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net