No member named 'begin' in namespace 'std'
问题 I successfully compiled on Windows a code that should be crossplatform. Now when compiling it in Xcode with Mac OS X, I get: std::valarray<float> v(32); ... std::sort(begin(v), end(v)); # Use of undeclared identifier 'begin' std::sort(std::begin(v), std::end(v)); # No member named 'begin' in namespace 'std' std::sort(std::valarray::begin(v), std::valarray::end(v)); # Idem, error as well Why does the error No member named 'begin' in namespace 'std' happen? 回答1: std::begin was introduced with C