C++ vector<std::tuple<XXX, XXX, XXX>>
c++ vector套tuple 遍歷
C++ vector<std::tuple<XXX, XXX, XXX> >
std::vector<std::tuple<std::string, std::string, int> > vec;
1 #include <functional>
2 #include <iostream>
4 #include <tuple>
5 #include <vector>
44 void test6() {
45 std::vector<std::tuple<int, double, float> > temp;
46 temp.push_back(std::make_tuple(1, 1.2, 1.23));
47 temp.push_back(std::make_tuple(2, 2.2, 2.23));
48 temp.push_back(std::make_tuple(3, 3.2, 3.23));
49
50 for (int i = 0; i < temp.size(); i++) {
51 int t1 = std::get<0>(temp[i]);
52 std::cout << t1 << std::endl;
53
54 double t2 = std::get<1>(temp[i]);
55 std::cout << t2 << std::endl;
56
57 float t3 = std::get<2>(temp[i]);
58 std::cout << t3 << std::endl;
59 }
60
61 }
62 int main() {
63 test6();
64 return 0;
65 }
執行結果:
舉個例子, 懂的都懂!!!
結語:
時間: 2020-11-06
相關文章
- could not connect to redis Instance at xxx.xxx.xxx.xxx:6379Redis
- Linux虛擬機器配置IP時提示:determining ip information for ip xxx.xxx.xxx.xxx address is alreadyLinux虛擬機ORM
- Permission denied:user=xxx,access=WRITE,inode=xxx
- QT中error: xxx does not name a type xxx錯誤QTError
- No instances available for XXXAI
- vue Cannot find module @/xxx/xxx.ts or its corresponding typeVue
- 搭建 docker registry 私有倉庫並解決報錯Get https://xxx.xxx.xxx.xxx:5000/v1/_ping: http: server gave HTTP respDockerHTTPServer
- xxx cannot be resolved to a type
- zsh:command not found: xxx
- No bean named ''XXX“ availableBeanAI
- Array type xxx is not assignable
- type[xxx]的用法
- J2SE - Could not find the main class: xxx.xxx.Program will exitAI
- Result Maps collection already contains value for xxx.xxx.dao.BaseResultMap錯誤AI
- network xxx was found but has incorrect label com.docker.compose.network set to "xxx"Docker
- unable to access ‘https://gitee.com/XXX/XXX.git/‘: Failed to connect to 127.0.0.1 portHTTPGiteeAI127.0.0.1
- su - xxx Could not create sessionSession
- error: ‘xxx’ does not name a typeError
- const {xxx} = this 是什麼?
- C++(std::vector)C++
- The bean ‘xxx‘, defined in class path resource , ......Bean
- Linux 中 grep xxx的用法Linux
- bug solved | export 'default' was not found in 'xxx'Export
- nmap 學習和使用 另外問下大佬們是不是用 nmap -p 1-65535 -T4 -A -v --script=all xxx.xxx.xxx.xxx 命令掃描出來後手動分析就可以了?
- 當執行import vue from ‘vue‘ 或其它import xxx from ‘xxx‘ 時發生了什麼?ImportVue
- public @interface xxx 定義註解
- 正規表示式 \xxx 元字元字元
- xxx,一個神奇的 Python 庫Python
- HTB_pwn_rocket_blaster_xxx_expAST
- Host 'xxx' is not allowed to connect to this MySQL server.MySqlServer
- 英文短句“xxx for the rest of us”的意思REST
- go get時出現‘xxx is deprecated’Go
- bug solved | This experimental syntax requires enabling xxxUI
- beego報錯 table name: `xxx` not existsGo
- Required parameter $xxx follows optional parameter $yyyUI
- [PM2][ERROR] Process XXX not foundError
- 【問題解決】java.sql.SQLException: null, message from server: “Host ‘xxx.xx.xx.xxx‘ is blocked because ofJavaSQLExceptionNullServerBloC
- c++ std::vector 切記C++