Why does this code fail?
#include <algorithm>
int main() {
int a[10];
enum { a_size = sizeof a / sizeof *a };
std::fill(a, a + a_size, a_size);
}
G++ 4.1.2 and 4.4.3:
In function 'int main()':
Line 5: error: no matching function for call to 'fill(int [10], int*, main()::<anonymous enum>)'
Is this code valid C++0x?