#include <iostream>
#include <boost/preprocessor/repetition/enum.hpp>
#define VALUE(z, n, text) f(n)
int f(int x) { return x * 10; }
int main() {
int const a[] = { BOOST_PP_ENUM(10, VALUE, ~) }; //N = 10
std::size_t const n = sizeof(a)/sizeof(int);
std::cout << "count = " << n << "\n";
for(std::size_t i = 0 ; i != n ; ++i )
std::cout << a[i] << "\n";
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKI2luY2x1ZGUgPGJvb3N0L3ByZXByb2Nlc3Nvci9yZXBldGl0aW9uL2VudW0uaHBwPgogICAgCiNkZWZpbmUgVkFMVUUoeiwgbiwgdGV4dCkgZihuKQoKaW50IGYoaW50IHgpIHsgcmV0dXJuIHggKiAxMDsgfQoKaW50IG1haW4oKSB7CiAgaW50IGNvbnN0IGFbXSA9IHsgQk9PU1RfUFBfRU5VTSgxMCwgVkFMVUUsIH4pIH07ICAvL04gPSAxMAogIHN0ZDo6c2l6ZV90IGNvbnN0IG4gPSBzaXplb2YoYSkvc2l6ZW9mKGludCk7CiAgc3RkOjpjb3V0IDw8ICJjb3VudCA9ICIgPDwgbiA8PCAiXG4iOwogIGZvcihzdGQ6OnNpemVfdCBpID0gMCA7IGkgIT0gbiA7ICsraSApIAogICAgc3RkOjpjb3V0IDw8IGFbaV0gPDwgIlxuIjsKICByZXR1cm4gMDsKfQ==