add functor.cpp