parallel_for will take any functor, which can be a lambda, a functor class or a plain old function; the following should work just fine too:
#include "tbb/tbb.h"
using namespace tbb;
...
void print( size_t n) {
printf("hellow world %d\n", n);
}
void print_range( const blocked_range<size_t> & r ){
for( size_t i = r.begin(); i != r.end(); ++i )
printf("hello from range: %d\n", i);
}
void doit() {
parallel_for<size_t>( 1, 10, 1, print );
parallel_for( blocked_range<size_t>(1,10), print_range );
}