use std::function, std::bind.
fix test.