fork(1) download
  1. #include <iostream>
  2. #include <cmath>
  3. #include <boost/preprocessor/repetition/enum.hpp>
  4.  
  5. #define ORDER(z, n, text) std::pow(z,n)
  6.  
  7. int main() {
  8. int const a[] = { BOOST_PP_ENUM(10, ORDER, ~) };
  9. std::size_t const n = sizeof(a)/sizeof(int);
  10. for(std::size_t i = 0 ; i != n ; ++i )
  11. std::cout << a[i] << "\n";
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0.02s 2724KB
stdin
Standard input is empty
stdout
1
2
4
8
16
32
64
128
256
512