QtConcurrent::mappedReduced使用仿函数(functor)
参考https://stackoverflow.com/questions/17019954/specifying-reduce-functor-for-mappedreduce
有三个要点:
1. MapFunctor必须定义result_type类型: 例如 typedef QList<int> result_type.
2. ReduceFunctor的operator()函数的第一个参数即是最终的结果
3. 调用blockingMappedReduced或者mappedReduced时需要显示指定模板参数的类型而不能依赖编译器推导。