阅读背景:

为什么“std :: begin()”在这种情况下总是返回“const_iterator”?

来源:互联网 
#include <vector>
#include <iostream>

using namespace std;

int main()
{
    vector<int> coll;

    decltype(std::begin(std::declval<vector<int>>()))
        pos_1 = coll.begin();
    auto pos_2 = coll.begin();

    cout << typeid(decltype(pos_1)).name() << endl;
    cout << typeid(decltype(pos_2)).name() << endl;
}
#include <vector>
#include <iostream>

using na



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: