for_each

Jedhi

Well-known member
Joined
Oct 2, 2003
Messages
127
I have base class, a derived class, an api class and a Form1 class. Only the Form1 class is managed.

I would like to access the Execute member function of the api class from the for_each, where every deviceid is
executed.

but for_each require that the function should be member of the baseclass. Any idea how to solve this problem ???

typedef std::vector <CBaseclass *> AllDevices;

class CAPI
{
public:
void Execute(CBaseclass *pbase)const;
AllDevices m_device;

}const api;


public __gc class Form1 : public System::Windows::Forms::Form
{
private: System::Void On_Click(System::Object * sender, System::EventArgs * e)
{
std::for_each(api.m_device.begin(),api.m_device.end(),const_mem_fun1_ref_t ???)
}
};
 
Back
Top