Quantcast
Channel: User HolyBlackCat - Stack Overflow
Viewing all articles
Browse latest Browse all 1287

Comment by HolyBlackCat on Simple for loop in C preprocessor

$
0
0
Check out BOOST_PP_REPEAT and similar macros in boost.preprocessor. They achieve this by pregenerating N boilerplate macros, allowing you to loop up to N iterations. This is impossible to achieve without boilerplate, unless you're willing to list each template argument in the macro call. E.g. something like REPEAT( (1)(2)(3), template <> void myFunc<N_>(std::array<float, N_> data); ) should be doable (probably with a slightly more complex syntax, but the same idea).

Viewing all articles
Browse latest Browse all 1287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>