How to construct multiprogress with variable?
nickhuangxinyu opened this issue · comments
xyhuang commented
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?
Pranav commented
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
Jake Nelson commented
This is exactly what I was trying to do, I considered using processor directives, I would appreciate this feature.