#include <stdio.h>
#include <vector>
#include <algorithm>
int main(int,char**)
{
#ifdef _MSC_VER
    // note: initializer lists not yet implemented for vc10
    std::vector<int> v;
    v.push_back(0);
    v.push_back(1);
    v.push_back(2);
    v.push_back(3);
#endif
#ifdef __GNUC__
    std::vector<int> v= {1,2,3,4};
#endif
#if !defined(_MSC_VER) && !defined(__GNUC__)

    // note: range for not yet implemented in vc10 or gcc4.5 or gcc4.6
    if (1) {
        for (auto x : v)
            printf(" %d", x);
        printf("\n");
    }
#endif
    if (1) {
        std::for_each(v.begin(), v.end(), [](int x) { printf(" %d", x); });
        printf("\n");
    }
    if (1) {
        for(auto x=v.begin(); x!=v.end(); x++) {
            printf(" %d", *x);
        }
        printf("\n");
    }

    return 0;
}
