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
相關文章
- Error querying database. XXXXXXXXXXXXX, No database selected。ErrorDatabase
- Error building Player: Win32Exception: ApplicationName=‘xxxxxxxxxxxxxxxxxx//sdk\tools\zipalign.exe' ...ErrorUIWin32ExceptionAPP
- Internal Error with background job scheduling XXXXXXXXXXXXX.Error
- // @require file://C:xxxxxxxxx.jsUIJS
- mysql Incorrect key file for table ‘/xxxxxxxx/xxxx.MYI'; try to repair itMySqlAI
- undefine macro xxxxxMac
- Spring:錯誤No bean named 'xxxxxxx' availableSpringBeanAI
- (徵文模板參考)xx技能樹/職業路線評測-xxxxxxxx
- Linux下編譯國標GB28181視訊推流元件EasyGBD報錯undefined reference to `xxxxxxxx@GLIBC_xxxxx‘解決Linux編譯元件Undefined
- Maven專案報錯:No bean named 'xxxxxx' availableMavenBeanAI
- [Linux] mutt /xxxx/xxxx/sent is not a mailbox.LinuxAI
- could not connect to redis Instance at xxx.xxx.xxx.xxx:6379Redis
- 報錯xxxx of undefinedUndefined
- Action Script for resource 'ora.xxxx.xxxx2.inst' stdout redirection failed forAI
- 表結構遷移檔案Identifier name 'xxxxxx' is too long解決IDE
- Struts2中there is no action mapped for acion name (/XXXXX)APP
- a commponent required a bean of type XXXXXX that could not be found-2022新專案UIBean
- CentOS 報錯 java.net.UnknownHostException: xxxxxx: 未知的名稱或服務CentOSJavaException
- java.sql.BatchUpdateException: Date truncation: Out of range value for column xxxxxJavaSQLBATException
- value xxx for the flexfield segment customer:does not exist in the value set xxxxFlex
- windows解壓檔案時,出錯:不能建立符號連結xxxxxxx客戶端沒有所需得特權Windows符號客戶端
- 關於cocopods更新第三方庫報ld: library not found for -lXXXXXX錯誤
- 使用req.session.xxx時出現 Cannot set property ‘xxxx‘ of undefinedSessionUndefined
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'xxxxx' iSpringFrameworkBeanException
- 正規表示式 \uxxxx 元字元UX字元
- “Host ‘xxxx‘ is not allowed to connect to this MySQL server“MySqlServer
- Permission denied:user=xxx,access=WRITE,inode=xxx
- Oracle Error:emcp:EKBL043: emcp_pseudo_ctl_ioctl: Invalid cmd 0xxxxxx, proc nameOracleError
- 【IOS】關於cocopods更新第三方庫報ld: library not found for -lXXXXXX錯誤iOS
- PostgreSQL cache lookup failed for type XXXX 錯誤SQLAI
- Linux awk 中 xxxx的應用Linux
- C++(std::vector)C++
- 關於報錯Error creating bean with name 'xxxxx': Invocation of init method....ErrorBean
- Oracle 表 XXXXX 發生了變化, 觸發器/函式不能讀它.Oracle觸發器函式
- 記解決OEM起不來提示C4J_DBConsole_xxxx(hostname)_xxxx(sid) not found
- Caused by: java.sql.SQLException: Access denied for user 'dell-pc'@'xxxxx' (using password: YES)JavaSQLException
- QT中error: xxx does not name a type xxx錯誤QTError
- could not autowire. No beans of 'xxxx' 問題解決Bean