//Purpose: // Provide alternative to soa method suggested here: // http://lists.boost.org/Archives/boost/2016/10/231136.php //=================================================== #include #include #include #include template < std::size_t N //array size , typename... T //array types > using soa_t= std::tuple < std::array... > ; int main() { enum citizen { first_name , last_name , salary , age }; std::size_t const n=5;//number of citizens soa_t soa_citizens; int avg = 0; int t = 1; for( int salary: std::get(soa_citizens)) { avg += (salary - avg) / t; ++t; } std::cout<<"avg="<