In C++ I need to iterate a certain number of times, but I don\'t need an iteration variable. For example:
for( int x=0; x<10; ++x ) { /* code goes her
this works in GCC and clang and any compiler that supports the gnu attributes:
for( [[gnu::unused]] auto x : boost::irange(0,10) ) {
and should compile in any c++11 compiler but may not suppress the warning if the compiler doesn't recognise the gnu attributes.