// example showing use of std::transform() with a select_update_iterator

// functor used in the transform example
class AddOneToExampleLong : public std::unary_function<Example, Example>
{
public:
	Example operator()(const Example &example)
	{
		Example result(example);
		result.exampleLong++;
		return result;
	}

};

// add one to the value of the exampleLong field for all rows in the table
void TransformSelectUpdate()
{
   DBView<Example> view("DB_EXAMPLE");

   DBView<Example>::select_update_iterator read_update_it = view.begin();
   std::transform(view.begin(), view.end(), read_update_it, AddOneToExampleLong());
}