diff --git a/book/en-us/04-containers.md b/book/en-us/04-containers.md index bdfe638..0f04375 100644 --- a/book/en-us/04-containers.md +++ b/book/en-us/04-containers.md @@ -292,7 +292,7 @@ This will iterate over the tuple: ```cpp for(int i = 0; i != tuple_len(new_tuple); ++i) // runtime indexing - std::cout << tuple_index(i, new_tuple) << std::endl; + std::cout << tuple_index(new_tuple, i) << std::endl; ``` ## Conclusion diff --git a/book/zh-cn/04-containers.md b/book/zh-cn/04-containers.md index a9999a6..d39205d 100644 --- a/book/zh-cn/04-containers.md +++ b/book/zh-cn/04-containers.md @@ -292,7 +292,7 @@ auto tuple_len(T &tpl) { // 迭代 for(int i = 0; i != tuple_len(new_tuple); ++i) // 运行期索引 - std::cout << tuple_index(i, new_tuple) << std::endl; + std::cout << tuple_index(new_tuple, i) << std::endl; ``` ## 总结