Implemented a trick for NAME not to use BOOST_TYPEOF without requiring to repeat the function type (doing a typedef on the local class so to access the functor type in NAME).