Sorry, I only noted your PR now, I had made the changes by hand, but looks they are the same. PR now included in master
Builds better on Windows with gcc version 6.2.1 20160825 (GCC). No great chaos, but:
* installing *source* package 'breathteststan' ...
** libs
g++ -I"C:/R/include" -DNDEBUG -I"../inst/include" -I"`"C:/R/bin/x64/Rscript" --vanilla -e "cat(system.file('include', 'src', package = 'StanHeaders'))"`" -I"`"C:/R/bin/x64/Rscript" --vanilla -e "cat(system.file('include', 'boost_not_in_BH', package = 'rstan'))"`" -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG -DBOOST_NO_CXX11_RVALUE_REFERENCES -I"C:/R/library/StanHeaders/include" -I"C:/R/library/rstan/include" -I"C:/R/library/BH/include" -I"C:/R/library/Rcpp/include" -I"C:/R/library/RcppEigen/include" -O3 -mtune=native -Wno-unused-variable -Wno-deprecated-declarations -Wno-ignored-attributes -c stan_files/breath_test_1.cc -o stan_files/breath_test_1.o
g++ -I"C:/R/include" -DNDEBUG -I"../inst/include" -I"`"C:/R/bin/x64/Rscript" --vanilla -e "cat(system.file('include', 'src', package = 'StanHeaders'))"`" -I"`"C:/R/bin/x64/Rscript" --vanilla -e "cat(system.file('include', 'boost_not_in_BH', package = 'rstan'))"`" -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG -DBOOST_NO_CXX11_RVALUE_REFERENCES -I"C:/R/library/StanHeaders/include" -I"C:/R/library/rstan/include" -I"C:/R/library/BH/include" -I"C:/R/library/Rcpp/include" -I"C:/R/library/RcppEigen/include" -O3 -mtune=native -Wno-unused-variable -Wno-deprecated-declarations -Wno-ignored-attributes -c stan_files/breath_test_group_1.cc -o stan_files/breath_test_group_1.o
g++ -I"C:/R/include" -DNDEBUG -I"../inst/include" -I"`"C:/R/bin/x64/Rscript" --vanilla -e "cat(system.file('include', 'src', package = 'StanHeaders'))"`" -I"`"C:/R/bin/x64/Rscript" --vanilla -e "cat(system.file('include', 'boost_not_in_BH', package = 'rstan'))"`" -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG -DBOOST_NO_CXX11_RVALUE_REFERENCES -I"C:/R/library/StanHeaders/include" -I"C:/R/library/rstan/include" -I"C:/R/library/BH/include" -I"C:/R/library/Rcpp/include" -I"C:/R/library/RcppEigen/include" -O3 -mtune=native -Wno-unused-variable -Wno-deprecated-declarations -Wno-ignored-attributes -c init.cpp -o init.o
In file included from C:/R/library/StanHeaders/include/stan/math/prim/mat/functor/map_rect.hpp:13:0,
from C:/R/library/StanHeaders/include/stan/math/prim/mat.hpp:262,
from C:/R/library/StanHeaders/include/stan/math/rev/mat.hpp:12,
from C:/R/library/StanHeaders/include/src/stan/model/log_prob_grad.hpp:4,
from C:/R/library/StanHeaders/include/src/stan/model/test_gradients.hpp:7,
from C:/R/library/StanHeaders/include/src/stan/services/diagnose/diagnose.hpp:10,
from C:/R/library/rstan/include/rstan/stan_fit.hpp:34,
from C:/R/library/rstan/include/rstan/rstaninc.hpp:3,
from stan_files/breath_test_group_1.hpp:5,
from stan_files/breath_test_group_1.cc:3:
C:/R/library/StanHeaders/include/stan/math/prim/mat/functor/map_rect_concurrent.hpp: In function 'Eigen::Matrix<typename stan::return_type<T_shared_param, T_job_param>::type, -1, 1> stan::math::internal::map_rect_concurrent(const Eigen::Matrix<T_job_param, -1, 1>&, const std::vector<Eigen::Matrix<T_job_param, -1, 1> >&, const std::vector<std::vector<double> >&, const std::vector<std::vector<int> >&, std::ostream*)':
C:/R/library/StanHeaders/include/stan/math/prim/mat/functor/map_rect_concurrent.hpp:108:59: error: invalid use of incomplete type '__gnu_cxx::__alloc_traits<std::allocator<std::future<std::vector<Eigen::Matrix<double, -1, -1> > > > >::value_type {aka class std::future<std::vector<Eigen::Matrix<double, -1, -1> > >}'
const std::vector<matrix_d>& chunk_result = futures[i].get();