use std::function as LoopFunc