由买买提看人间百态

topics

全部话题 - 话题: inputing
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
i********r
发帖数: 131
1
来自主题: Programming版 - C++怎么写任意重重循环?
If the number of loops are only known at run time, the variadic template won
't work. The only way I can think of is recursion:
#include
#include
using namespace std;
void do_something(const vector& vars)
{
cout << "do_something with loop variables: ";
for (auto& i: vars)
cout << i << " ";
cout << endl;
}
// method 2:
void myLoop(const vector& inputs, vector& vars)
{
if (inputs.size() == vars.size()) {
... 阅读全帖
K****n
发帖数: 5970
2
看,这就是google这个网站全部的源代码:
大哥大嫂过年好!
content="text/html; charset=UTF-8">Google