p-ranav / indicators

Activity Indicators for Modern C++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to construct multiprogress with variable?

nickhuangxinyu opened this issue · comments

I see the multiprogress construct method as:

indicators::MultiProgress<indicators::ProgressBar, 3> bars;
but I want to init it using a variable, like this:

int a = 3;
indicators::MultiProgress<indicators::ProgressBar, a> bars;

Can I achieve this? i think dynamic_process has good method like push_back?

int a = 3;
indicators::MultiProgress<indicators::ProgressBar, a> bars;

The above is not possible in C++. MultiProgress is designed for the case where you know the number of progress bars at compile time.

For all other cases, I recommend you use DynamicProgress

This is exactly what I was trying to do, I considered using processor directives, I would appreciate this feature.