No member named 'begin' in namespace 'std'

后端 未结 2 1609
生来不讨喜
生来不讨喜 2021-01-20 01:06

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 v(32)         


        
2条回答
  •  逝去的感伤
    2021-01-20 01:18

    std::begin was introduced with C++11. See this answer for how to enable C++11 in XCode 4.2 (the precise name of the dialect has probably changed by now).

    Alternatively, if you can't move to C++11, switch to std::vector and use v.begin().

提交回复
热议问题