I have seen many similar questions, but I do not think I have seen the same thing. It is pretty simple. Some of my teacherβs code did not compile, and I tried the problem in this case:
void foo(vector<int> v) { } void fooUsage() { foo({0, 1, 2}); }
This fails:
could not convert '{0, 1, 2}' from '<brace-enclosed initializer list>' to 'std::vector<int>
Note. It works on GCC 5.0.0 20141228, but it crashes on my GCC 4.7.1 (tdm-1).
Sorry if this is too easy, but I don't know C ++ 11 very well.
c ++ gcc c ++ 11
Stefan monov
source share