>>538
std::vector<A*> a を generate_n で作るまでは OK として、その後は

  std::accumulate(v.begin(), v.end(), 0,
        boost::compose_f_gx_hy(
          std::plus<int>(),
          std::identity<int>(),
          std::mem_fun(&A::func)
        ));

ってな感じでどう?