
7 Jan
2012
7 Jan
'12
9:29 p.m.
Yes, it's incomplete... Can someone with access to many compilers and compiler versions try to compile the example below and let me know if it compiles? (I only have access to MSVC 8.0 and GCC 4.5.3).
#include #include
int main() { struct s { void operator()(int x) { std::cout << x << std::endl; } } l;
int nums[] = {1, 2, 3}; std::for_each(nums, nums + 3, l);
return 0; }
I have access to GCC 4.3 through 4.7. On GCC 4.3 and 4.4, it does not compile, with or without --std=c++0x On GCC 4.5, 4.6, and 4.7, it compiles with --std=c++0x, but not without Presumably it would not compile on older GCC versions either. Regards, Nate