This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/53211] range-based 'for' expression of type 'const int []' has incomplete type


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53211

--- Comment #2 from niXman <i.nixman at gmail dot com> 2012-05-03 16:04:26 UTC ---
This code also works:

#include <iostream>

template<typename... Args>
void func(Args... args) {
   const int arr[] = {args...};
   for (int it: arr) { // !!!!!!!!!!!!!!!!!!!!!
      std::cout << it << std::endl;
   }
}

int main() {
   func(1,2,3,4);
}


I'm confused...


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]