相关疑难解决方法(0)

减少begin()迭代器,然后再次增加它

这些陈述是否符合标准?

std::string str{"123"};
auto it = str.begin();
--it;
++it; // Does *it point to character '1' now?
Run Code Online (Sandbox Code Playgroud)

我在g ++ 4.7.2和clang ++ 3.5上尝试了这个 - *it返回'1'.这是c ++ 11中的标准行为吗?

c++ c++11

7
推荐指数
1
解决办法
789
查看次数

标签 统计

c++ ×1

c++11 ×1