const_interator的用法
来源:互联网 发布:java基础知识体系结构 编辑:程序博客网 时间:2024/05/20 12:51
// string::cbegin/cend#include <iostream>#include <string>int main (){ std::string str ("Lorem ipsum"); for (auto it=str.cbegin(); it!=str.cend(); ++it) std::cout << *it; std::cout << '\n'; return 0;}
A const_iterator is an iterator that points to const content. This iterator can be increased and decreased (unless it is itself also const), just like the iterator returned by string::begin, but it cannot be used to modify the contents it points to, even if the string object is not itself const.
注意的是:const_iterator不能改变所指向的值。
0 0
- const_interator的用法
- C++中的const_interator
- ?的用法
- ?的用法
- ---" ~ " 的用法---
- ---" ~ " 的用法---
- ~ 的用法
- 的用法
- ##的用法
- ##的用法
- 的用法
- ${ }的用法
- ##的用法
- ${ }的用法
- "->"的用法
- ${ }的用法
- >>的用法
- &的用法
- 简述UITextField的属性和用法
- 『IOS』报错:failed to get the task for process XXX(解决方案)
- 在PowerShell中使用Vim
- 每天一个linux命令(5):rm 命令
- leetcode dfs Validate Binary Search Tree
- const_interator的用法
- Java NIO 系列教程
- Android背景平铺
- Anagram --- 哈希算法
- 蓝桥杯试题
- 3Sum Closest
- Java NIO系列教程(一) Java NIO 概述
- Android 编程下 Touch 事件的分发和消费机制
- AWK