i have a template classa as shown below, i want to call it in for_each method using the temporary object... how can i do this. i have already done this by class variable, but i have to do same by temporary object.. can anybody help thanks
template <class T> class My_action
{
public:
My_action(T a)
{
cout << a << endl;
}
void operator() (T a)
{
cout << a << endl;
}
};